01-29-2015 12:37 PM
Hi,
requested feature: code a batch input, that fills a bunch of fields in transaction VA01, including some long texts (goto -> header -> text) and let the batch input stop, BEFORE saving the order. the user has to press the save-button, after he has checked the contents.
problem: the long text name is the order no - which I do not have before saving the order, AND: the long texts control in VA01 is not batchable, and even it would be, I don't want to batch input long texts. how can I trick the VA01 into writing the long texts into the (still unsaved!) order?
Our SD user exists are full of coding, so I don't want to extend a user exit (because this would cause many tests).
Thanks
Ralf
01-29-2015 12:52 PM
Hi Ralf,
You can update long texts using FM SAVE_TEXT by passing textname, text ID, text objects and language. But, I don't think it is possible to update it in unsaved order.
01-29-2015 12:55 PM
Hi,
I am developer since 1998 - so I know FM save_text. But as I wrote: I don't have a text name before saving the order - because the order no IS the text name.
01-29-2015 1:01 PM
01-29-2015 1:20 PM
Try to save text in local catalog (let the standard commit update the database) with key similar to "XXXXXXXXXX"
Hint: You can try to find this (or accurate version for your system) by debug, call VA01, enter some text, start debug and display local catalog of text : (SAPLSTXD)CATALOG
Regards,
Raymond
01-29-2015 2:19 PM
I am experimenting with this coding:
DATA:
catalog TYPE STANDARD TABLE OF tcatalog,
mem_id TYPE char20,
BEGIN OF text,
header TYPE thead,
lines TYPE STANDARD TABLE OF tline,
END OF text.
* build text header and catalog entry
APPEND INITIAL LINE TO catalog ASSIGNING FIELD-SYMBOL(<catalog>).
<catalog>-tdobject = text-header-tdobject = 'VBBK'.
<catalog>-tdid = text-header-tdid = '0002'.
<catalog>-tdname = text-header-tdname = 'XXXXXXXXXX'.
<catalog>-tdspras = text-header-tdspras = sy-langu.
<catalog>-id = '000001'.
* export catalog
mem_id = 'SAPLSTXD' && <catalog>-id.
EXPORT catalog = catalog TO MEMORY ID 'SAPLSTXD'.
* build text body
APPEND INITIAL LINE TO text-lines ASSIGNING FIELD-SYMBOL(<textline>).
<textline>-tdformat = '*'.
<textline>-tdline = 'this is a test'.
* write text to text memory
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
header = text-header
local_cat = 'X'
TABLES
lines = text-lines.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
object = text-header-tdobject
name = text-header-tdname
id = text-header-tdid
language = text-header-tdspras
local_cat = 'X'.
* open VA01 and hope, that there is a long text existing
CALL TRANSACTION 'VA01'.
But unfortunately, (SAPLSTXD)CATALOG[] is empty in VA01 😞
01-29-2015 2:36 PM
The EXPORT should be:
EXPORT catalog = catalog TO MEMORY ID mem_id.
01-29-2015 2:42 PM
01-29-2015 2:54 PM
Perhaps there is a refresh done by standard coding in VA01.
Although you don't want it you can try in a userexit if the memory id is still there.
If not you can use an own memory id to pass the data to the userexit and fill the SAPLSTXD stuff there.
01-30-2015 9:56 AM
But in a user exit I can not determine if the order has been posted by my call transaction. And only in this case (as a result of some IF statements in my program) I want to insert special long texts.
01-30-2015 10:01 AM
This code must be executed during the transaction in one of the User Exits In Sales Document Processing, and don't commit the text yourself.
Regards,
Raymond
01-29-2015 1:42 PM
Hi,
post the sales order by means of CALL TRANSACTION VA01 or BAPI. Get the sales order number from parameter id or BAPI return. Save the text.
Ask in a loop for the lock entry. If it is gone call transaction VA02.
01-29-2015 1:46 PM
Then I have a posted order in the system, which has not been audited. I need the text BEFORE saving.
I am trying to get the texts into the local text memory of VA01 (Raymonds posting), but until now it does not work...
01-30-2015 2:48 AM
I believe you are calling VA01 from custom prog. What if we create a long text with key $000001. hope it will load. once saved when control backs to custom prog, delete it?
01-30-2015 5:18 PM
01-31-2015 4:38 PM
when we create a new order and go in to the long text, the key will be something like $000001 as order is not yet created. So I was proposing to create a new long text with this key and check whether this is being read in VA01.