‎2007 Sep 12 6:46 AM
hi,
can a variable defined as a string hold upto five or six lines of content.
because i will be fetching the content from standard text in an internal table by using the READ_TEXT FM and then i want to store all the info of that internal table into a string type variable and display the same in the script.
can i do it or not.
thanks and regards,
md.ibrahim
‎2007 Sep 12 6:49 AM
Hi ,
You can do it concatnating all the lines into one string variable and display it. That also depends on the size of the text or window into which you are displayin.
Hope this solves your purpose.
Award points if it helps.
-Gaurang
‎2007 Sep 12 6:50 AM
Yes you can do it .
Declare a variable of size string and after calling Read_text fm which return an internal table TLINE .loop at tline and concatenate into the string .
This works .
Please reward if useful.
‎2007 Sep 12 6:55 AM
Check this example
DATA : it_lines LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : l_str TYPE string.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F01'
language = sy-langu
name = '4400000386'
object = 'EKKO'
TABLES
lines = it_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT it_lines.
CONCATENATE l_str it_lines-tdline INTO l_str SEPARATED BY space.
CLEAR : it_lines.
ENDLOOP.
WRITE : l_str.Regards
Gopi