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

Append text using SAVE_TEXT

Former Member
0 Likes
3,047

I'm trying to append text lines to the existing data for a given text id. And it seems to replace it each time.

Is there a way to do it?

This did not work....call replaces the text data.


    call function 'SAVE_TEXT'
      EXPORTING
        header   = thead
        insert   = 'I'
      TABLES
        lines    = tline
      EXCEPTIONS
        id       = 1
        language = 2
        name     = 3
        object   = 4
        others   = 5.

    if sy-subrc <> 0.

    endif.
    CALL FUNCTION 'COMMIT_TEXT'.
    COMMIT WORK.

Thank you,

Pam

5 REPLIES 5
Read only

Former Member
0 Likes
1,377

I think you would need to use READ_TAXT first to retrieve the existing text, then add your new text to the internal table and call SAVE_TEXT with the full text.

Read only

0 Likes
1,377

Ok...I have the code in place...its so messy but I guess I don't have much options. The reason I say its messy 'cause I get to many lines and too many text ids.

You would think SAP provides this common feature!!

thanks.

Read only

ferry_lianto
Active Contributor
0 Likes
1,377

Hi Pam,

You need to use FM READ_TEXT and FM EDIT_TEXT then use FM SAVE_TEXT.

Hope this will help.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
1,377

Hi Parimala,

The function module SAVE_TEXT

1. replaces the existing text if the INSERT parameter is SPACE

2. Inserts new text if the INSERT parameter not equal to SPACE.

Hope this helps.

Sajan.

Read only

0 Likes
1,377

Sajan,

does not seem to work like that. I tried with all possible values. I'm now using read_text and appending data to tline following with a save_text.

Thank for your timely suggestions.