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: 

Problem with SAVE_TEXT FM

Former Member
0 Kudos

Hello,

I am having a problem with using the SAVE_TEXT FM.

Here is the scenario.

I am trying to populate the Long Text on a PM work order component line for a reservation.

Prior to populating this field, no text will exist in this field.

I create the name key using the following:

sy-mandt + resb-rsnum + resb-rspos + resb-rsart

The object id AUFK and the ID is MATK.

INSERT = X

SAVEMODE_DIRECT = X

OWNER_SPECIFIED = space

LOCAL_CAT = space

When I call the FM I get a return code of 0 and when I do a READ_TEXT FM using this key I can see that the text exists in table STXH.

However, when I go to view the long text for the reservation component in IW32 there is no text there.

If I now manually add text to the long text and save, if I now run the SAVE_TEXT FM with the same key, the FM overwrites the value of the text which was manually entered with the value from the FM.

So, does anyone know why the FM writes an entry to STXH which isn't visible in IW32 prior to manually adding text, but is visible after manually adding text?

Has anyone experienced this problem before?

I would appreciate any help anyone could give me.

thanks,

Kevin

7 REPLIES 7

Former Member
0 Kudos

Hi Kevin,

Iam experienceing same kind of problem where in when I update the long text through

BAPI_ALM_ORDER_MAINTAIN and when I view the long text in IW32 iam seeing the text which is updated recently and the old text has been replaced.But when I do a BAPI_ALM_ORDER_GET_DETAIL Iam seeing the all the texts(both old and new)..

Did you find a the reason behind it...?

Pls share if you have found anything on that...

Thanks for your help

Larry

0 Kudos

Ok,

I guess you will have to try the option of first getting the old text maintained in an internal table and then add the new text and then pass it back to the BAPI. I guess that might solve the problem. Looks weird that the old text is not visible but to first read and then append might solve the issue.

Hope this helps,

Sudhi

0 Kudos

Thanks for the reply Sudhi...

Even I thought of this ..But when I replace 'TEXT1' with 'TEXT1' + 'TEXT2' in first attempt..

and in second I might end up with 'TEXT1' 'TEXT1+TEXT2' & 'TEXT3' at the third attempt...

Hope you understand..The Old replacements are not gone they are stored and extracted by

GETDETAILS BAPI....

Can you think of any other solution...Thanks for your help...

Larry

former_member194669
Active Contributor
0 Kudos

I think you have to call INIT_TEXT then SAVE_TEXT.

aRs

raymond_giuseppi
Active Contributor
0 Kudos

I believe to remember that IW32/ check a flag in table AUFK, view CAUFV, which indicates existence of a long text.

Maybe you have to put this flag on before the program accept to display your text.

Regards.

0 Kudos

Sorry table was RESB, but answer is correct anyway,

field is RESB-LTXSP.

Look at <a href="https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/corr_instr/correction_detail.htm?_CINSTA=0120061532&_CALEID=0000356881&_CPAKID=1&_PGMID=LIMU&_OBJ=REPS&_OBJNAM=ZDELRESBLTXSP&tab=2">Example of program updating flag long text</a> or note <a href="https://service.sap.com/sap/support/notes/706261">Note 488862 - No long text for component although long text flag existing</a>

Regards

Clemenss
Active Contributor
0 Kudos

Hi Kevin,

try function COMMIT_TEXT after SAVE_TEXT. SAVE_TEXT will save the text to a special text memory area; from there it must be commited to database using FM COMMIT_TEXT.

Regards,

Clemens