Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Create text in VA01(MV45AZZ - form userexit_save_document)

marcelom_bovo
Participant
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Try calling the SAVE_TEXT FM in seperate task.

CALL FUNCTION SAVE_TEXT in seperate task T1.

Hope this helps.

7 REPLIES 7

former_member156446
Active Contributor
0 Kudos

This message was moderated.

0 Kudos

Hi Jay,

As I said to Vikas, it just work when the user hasn't inputed anything manyally in the text

Former Member
0 Kudos

Hi,

Try calling the SAVE_TEXT FM in seperate task.

CALL FUNCTION SAVE_TEXT in seperate task T1.

Hope this helps.

former_member288351
Participant
0 Kudos

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

0 Kudos

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.

raymond_giuseppi
Active Contributor
0 Kudos

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.

0 Kudos

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