02-15-2010 7:04 AM
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
02-15-2010 7:08 AM
02-15-2010 7:12 AM
This F.M can also take certain length of text .and we cant append more lines to this input parameter
02-15-2010 7:16 AM
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.
02-15-2010 7:20 AM
Hello Dzed,
I will opt for FORMAT_TEXTLINES in this case as the output param of this is of structure TLINE
BR,
Suhas
02-15-2010 7:20 AM
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