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 SAPScript text linse to normal stream text format

Former Member
0 Likes
1,367

Hi Gurus.

We have a custom popup FM that displays text lines from a file provided by SAPScript text format.. (after u2018call function u2018READ_TEXTu2019).

However, for example, the Tab indent markers in this text u2013 represented by two commas u2018,,u2019 are printing instead of spaces representing the indent in our popup.

We are searching a FM that takes the SAPScript text format and converts it to plain text format (before our Z_popup is called) where the Tab markers are replaced by spaces (in our case this is four spaces for each Tab mark).

We have already tried FMu2019s: CONVERT_text; CONVERT_ITF_TO_STREAM_TEXT; CONVERT_ITF_TO_STREAM_TEXT. But none of them seem to fulfill the requirements stated above.

Can anyone please advice?

2 REPLIES 2
Read only

Former Member
0 Likes
645

hey,

this read_text method may help you.

http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=79888699

regards,

Orhan

Read only

I066686
Product and Topic Expert
Product and Topic Expert
0 Likes
645

Hi Arnie,

Instead of searching for FM you can manually code which is flexible.

 "after gettting text from READ_TEXT in lt_tline.
Data: lt_string type table of string,
         lv_string type string.
CONSTANTS: c_par  TYPE char2 VALUE ',,'. " Sign for tabs

  LOOP AT  lt_tline INTO  wa_tline.
       CONCATENATE lv_string  wa_tline-tdline INTO lv_string SEPARATED BY ' '.
       REPLACE ALL OCCURRENCES OF c_par   IN lv_string WITH ' '.
        Append lv_string to lt_string.  "if needed in string table
  ENDLOOP.

Regards,

Kiruba