Advertising:
Read texts and notes with function module READ TEXT
From SAP Knowledge Base
The text is written to a simple internal table with type 'TLINE'. Often the goal is to store the content in a string.
The concatenation depends on the TDFORMAT:
IF sy-subrc = 0 AND lines( text_lines ) > 0.
LOOP AT text_lines ASSIGNING FIELD-SYMBOL(<text_line>).
IF <text_line>-tdformat EQ '*' AND sy-tabix > 1.
result = |{ result }{ cl_abap_char_utilities=>cr_lf }{ <text_line>-tdline }|.
ELSEIF <text_line>-tdformat EQ '=' OR sy-tabix = 1.
result = |{ rv_result }{ <text_line>-tdline }|.
ELSE.
result = |{ result } { <text_line>-tdline }|.
ENDIF.
ENDLOOP.
ENDIF.
Text conversion from ITF to ASCII after reading SAPScript text modules
If a text is read from an SO10 text, unwanted text formatting may be present here. For example, if there is a comma, the output will display the comma with '(,)'.
With fm 'CONVERT_ITF_TO_ASCII' the SAPScript can be converted into an ASCII format. Alternatively, you can use keyword REPLACE.