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: 

Longtext update by using save_text F.M

Former Member
0 Kudos

Hi All ,

I am updating longtext using F.M save_text the problem is

my longtext is in the form longtext type c length 1000.

Now how do i split this longtext such that i can pass the data in save_text.

the parameter TDLINE is only 132 character.

i tried using F.M tr_split_text at 132 char but the input parameter of this F.M can only take data of certain

length

Do any bdy know hw to go about it?

Regards

Bhanu

5 REPLIES 5

Former Member
0 Kudos

Hello

Try FM RKD_WORD_WRAP

0 Kudos

This F.M can also take certain length of text .and we cant append more lines to this input parameter

0 Kudos

Hello

Just use logic of this FM for split string.

Copy this FM into own Z-FM and modify input parameter as per you need.

0 Kudos

Hello Dzed,

I will opt for FORMAT_TEXTLINES in this case as the output param of this is of structure TLINE

BR,

Suhas

0 Kudos

Hi,

If your long text is in multiple lines of an internal table use the below code and take the text into some string varaible (lv_text_string here).

  • Concatenate the text into a string variable

LOOP AT lt_lines INTO lw_lines.
        CONCATENATE lv_text_string lw_lines-tdline INTO
                    lv_text_string SEPARATED BY space.
        CLEAR : lw_lines.
      ENDLOOP.

  • Split the text into 132 char lines

CALL FUNCTION 'RSDG_WORD_WRAP'
        EXPORTING
          textline            = lv_text_string
          delimiter           = space
          outputlen           = 132
        IMPORTING
          out_line1           = lv_outline1
          out_line2           = lv_outline2
          out_line3           = lv_outline3
        TABLES
          out_lines           = lt_text_lines
        EXCEPTIONS
          outputlen_too_large = 1
          OTHERS              = 2.

Now use lt_text_lines for calling save_text FM. (Here lt_text_lines should be delared as an internal table of char132).

Hope this helps you !!!

Regards,

Ganga