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

string for standard text

Former Member
0 Likes
1,213

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

3 REPLIES 3
Read only

Former Member
0 Likes
698

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

Read only

Former Member
0 Likes
698

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.

Read only

gopi_narendra
Active Contributor
0 Likes
698

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