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

How do I save long text while preserving formatting ?

Former Member
0 Likes
1,891

Hi friends,

I have a text editor section on my screen painter (module pool) and I read it using  cl_gui_textedit->set_text_as_r3table method. Further I get all the lines into a TLINE type internal table and call function module SAVE_TEXT to save the text into corresponding text element. However I am not able to get it in the formatting that I want.

Eg: I type the below text(in italics) in my screen painter: I can manually force formatting (line break) using TDFORMAT = '*' everytime there is a blank line. But what about those cases where its not a blank line but still it has to be considered as a new line - as in the example below this new line is

'Some large supermarkets..'   So while I save the text in SO10, how do I make sure I get the '*' indicating a line break ? Thanks and appreciate all the help!

A grocery store is a retail store that sells food and other non-food items. Large grocery stores that stock products other than food, such as clothing or household items are called supermarkets.

Some large supermarkets also include a pharmacy and an electronics section, the latter selling DVDs, headphones, digital alarm clocks, and similar items. Small grocery stores that mainly sell fruits and vegetables are known as produce markets (U.S.) or greengrocers (Britain), and small grocery stores that predominantly sell prepared food, such as candy and snacks, are known as convenience stores or delicatessens.

1 ACCEPTED SOLUTION
Read only

tkaess
Participant
0 Likes
1,191

Hello Aradhana,

please try the method:

get_text_as_stream

and than

  CALL FUNCTION 'CONVERT_STREAM_TO_ITF_TEXT'

    TABLES

      text_stream = lt_text

      itf_text    = lt_tline.

Best regards

Thomas

2 REPLIES 2
Read only

tkaess
Participant
0 Likes
1,192

Hello Aradhana,

please try the method:

get_text_as_stream

and than

  CALL FUNCTION 'CONVERT_STREAM_TO_ITF_TEXT'

    TABLES

      text_stream = lt_text

      itf_text    = lt_tline.

Best regards

Thomas

Read only

Former Member
0 Likes
1,191

Thanks Thomas, you are a life savior!! This solution works like a charm ! Appreciate all the help !