Skip to Content
Former Member
Apr 06, 2016 at 08:33 AM

Creating a longtext


Hello ABAP friends,

at the moment i am trying to create a longtext via an user exit after entering an action. This shall be done in transaction IW21, IW22 which is creation and changing PM notifications! But this is minor.

In fact i want to read longtext from the catalog and post it to the actual action of the PM notification as default values.

The long text of the catalog is read by the FM READ_TEXT which is working quite well. After that i want to store the longtext to the action but i have to consider two things:

1. Text shall be inserted and readable after clicking the longtext button

2. Text shall only be saved when user pushes Save button of the transaction (when DB commit is done)

Now here comes my problem. When doing this i tried using FM SAVE_TEXT and COMMIT_TEXT which is working quite good for transaction IW22. So for an already existing document its no problem to store the longtext.

When i try to do this for an not posted document, the text is not stored wether in text memory nor in the database table STXH. What am i doing wrong. The key for the text is built with the temporary notification number %00000000001 and the counter of the action.

I think i am not getting how this SAP Script thing is working. Did anybody had a similar problem or can anyone figgure out what am i doing wrong! How is SAP handling temporary longtext while creating documents?

In my opinion and in my understanding i have to call SAVE_TEXT to store the text into ABAP memory and after that i have to call COMMIT_TEXT to create and posting job for the update programm that will then finally commit the text while leaving transactions.

I don't know what do to please give me some hints, how this whole SAP Script longtext thing is working!

Thank you in advance!


Tobi wan Kenobi 😊