06-02-2015 10:45 PM
Hello people,
I have a requirement to create a text in VA01 on object VBBK ID 0001 when the order is saved.
First I read the it to see if there is something already inputed on the ID, then I add my text on it. This part is working fine, but when I use the function SAVE_TEXT nothing happen. It executes normally, but the text is not saved
I coded on the form userexit_save_document of MV45AZZ but nothing happens after the SAVE_TEXT
header-tdid = '0001'.
header-tdspras = sy-langu.
header-tdname = vbak-vbeln.
header-tdobject = 'VBBK'.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
header = header
TABLES
lines = lines
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
Does anyone know what this might be?
thanks
06-03-2015 5:08 AM
Hi,
Try calling the SAVE_TEXT FM in seperate task.
CALL FUNCTION SAVE_TEXT in seperate task T1.
Hope this helps.
06-02-2015 11:11 PM
06-03-2015 3:37 PM
Hi Jay,
As I said to Vikas, it just work when the user hasn't inputed anything manyally in the text
06-03-2015 5:08 AM
Hi,
Try calling the SAVE_TEXT FM in seperate task.
CALL FUNCTION SAVE_TEXT in seperate task T1.
Hope this helps.
06-03-2015 6:10 AM
Hi,
Please call
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = '*'
NAME = '*'
ID = '*'
LANGUAGE = '*'
SAVEMODE_DIRECT = 'X'.
ENDIF.
after SAVE_TEXT to update text in header its working for me.
with regards
vikas pandey
06-03-2015 2:58 PM
Hi,
Tried it out, when the user inputs no text manually it works perfectly, but when he writes something then the function does not work.
I read what the user inserted, then append 1 line with my text save and commit, but does not work.
06-03-2015 3:46 PM
I hope you called READ_TEXT before SAVE_TEXT to find already input text (*) ?
Hint: But maybe it is too late, if transaction already executed the COMMIT_TEXT the CALL FUNCTION... IN UPDATE TASK statement were already executed, try to set a break-point at start of COMMIT_TEXT FM. In this case move your code to USEREXIT_SAVE_DOCUMENT_PREPARE and insure not to add text twice.
Regards,
Raymond
(*) Eventually execute a IMPORT catalog FROM MEMORY ID 'SAPLSTXD', internal table of structure TCATALOG to get texts currently in memory.
06-03-2015 5:04 PM
Yep, I read it correctly, just the saving is wrong.
I put a break point in commit and it is indeed being called before my enhancement, I'll try to change it's place and see if it works