Application Development and Automation 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: 
Read only

Problem with SAVE_TEXT

ameesa_sameen
Explorer
0 Likes
6,586

I am trying to save long text in transaction iW32 using SAVE_TEXT but i am unable to see the text in the transaction.

I am able to see the entries in STXH but not on screen. I am passing the correct values to the FM paramters with leading zeros.

lwa_thead-tdobject = AUFK.
lwa_thead-tdname = concatenating sy-mandt + aufnr with leading zeros.
lwa_thead-tdid = KOPF
lwa_thead-tdspras = sy-langu.

CALL FUNCTION 'SAVE_TEXT'
EXPORTING
header = lwa_thead
savemode_direct = abap_true
TABLES
lines = lt_tline2
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.


CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = c_object
NAME = concatenating sy-mandt + aufnr with leading zeros.
ID = KOPF
LANGUAGE = sy-langu
SAVEMODE_DIRECT = abap_true

Please help

13 REPLIES 13
Read only

Former Member
0 Likes
2,702

Hi,

what is the value of c_object ? It should be 'AUFK'.

Regards,

Klaus

Read only

0 Likes
2,702

the object is AUFK

Read only

ipravir
Active Contributor
0 Likes
2,702

Hi Ami,

Fill all below header fields, and also pass 'X" value for INSERT parameters,.

HEADER-TDOBJECT      =      
HEADER-TDNAME      =      
HEADER-TDID        =       ''.
HEADER-TDSPRAS        =       ''.
HEADER-TDFORM        =       ''.
HEADER-TDLINESIZE    =       ''.

HEADER-TDTRANSTAT    =       '0'.

HEADER-MANDT          =       ''.

INSERT=       'X'.

And call only Commit_TEXT function module without any parameters.

It will work.

I did the same for one of my requirement, and data is storing in respective text.

Regards,

Praveer.

Read only

0 Likes
2,702

I have tried this but when i give insert = X save_text gives me sysubrc 5

Read only

ipravir
Active Contributor
0 Likes
2,702

Are you trying to insert new text or updating the old text?

Read only

0 Likes
2,702

i am trying to replace the existing text

Read only

ipravir
Active Contributor
0 Likes
2,702

You can do one thing,

CALL READ_TEXT Function 1st, get HEADER information.

Update LINES Information, and then call SAVE_TEXT function module to update with new information.

pass SAVEMODE_DIRECT = SPACE while calling SAVE_TEXT.

note: Insert : Indicator: Text is new

Regards,

Praveer.

Read only

0 Likes
2,702

it is not working if i give savemode_direct = space.

Read only

0 Likes
2,702

It works fine if i have an existing text and i am trying to append some text to the existing text.. but if there is no text then it is not working

Read only

ipravir
Active Contributor
0 Likes
2,702

If there is no text, means you are creating the new one.

Then you no need to call READ_TEXT FM and have to user INSERT parameter, in SAVE_TEXT FM with new header inforamtion.

Regards,

Praveer.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,702

There is a flag in the order for long text (now used for long text language) and SAVE_TEXT won't set this text. (Reference also in 1982719 - Texts cannot be displayed - Usage of function module SAVE_TEXT for PM/CS modules, there are other notes/KBA for other modules)

So either use BAPI_ALM_ORDER_MAINTAIN to create long text or update the flag from your report (a simple UPDATE SET is "allowable")

Regards,

Raymond

Read only

0 Likes
2,702

but it is working for notifications only with save_text.

Read only

0 Likes
2,702

Hi,

if the text is new, you have to set parameter

INSERT = 'X'

for fm SAVE_TEXT.

Regards,

Klaus