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

Convert long text to string

Former Member
0 Likes
11,482

Hello

I'm looking for a standard way to get a string out of a long text table (tline table).

I get the long text by using the read_text function, and it returns a table that contains the text, with the format column. I need a function that gets this table and returns a formatted string.

Please tell me if there's a standard way of doing this.

Best regards,

Udi.

4 REPLIES 4
Read only

Former Member
0 Likes
5,033

HI try this,

After the READ_TEXT, say data is in internal table it_tline.

data : v_text type string.

loop at it_tline.

concatenate v_text it_tline-tdline into v_text seperated by space.

endloop.

write v_text.

Read only

Sm1tje
Active Contributor
5,033

What about 'CONVERT_ITF_TO_STREAM_TEXT'

Edited by: Micky Oestreich on May 14, 2009 10:21 AM

Read only

Former Member
0 Likes
5,033

Hi Udi ,

You need to loop the internal table that fetches record from the table type TLINE.

After that you need to concatenate the field string value into a variable type STRING.

DATA : t_itab LIKE TABLE OF tline,
       fs_itab LIKE LINE OF t_itab,
       w_string TYPE string ,   " To hold Continous text
SELECT .......
LOOP AT t_itab INTO fs_itab.
  CONCATENATE fs_itab-tdline w_string INTO w_string.  " Concatenate to get it continous
ENDLOOP.
WRITE : w_string.   " Displaying continuous text

If want space between the concatenated parts use SEPERATED BY SPACE at the

end of CONCATENATE statement . Like -

CONCATENATE fs_itab-tdline w_string INTO w_string SEPERATED BY SPACE.

Check my post in the bellow link -

[https://forums.sdn.sap.com/click.jspa?searchID=-1&messageID=7484684]

Regards

Pinaki

Read only

Former Member
0 Likes
5,033

Thank you all,

I specifically asked for a standard way of doing this, like what Micky suggested.

But I realized it won't be much different than doing it by myself, so that's how I did it eventually.

Thanks everyone.