‎2006 Aug 14 3:28 PM
I would like to add a line break into a string that I want to write with the WRITE statement, but without using SKIP or NEWLINE or WRITE: \.
CONCATENATE 'part1'
?the_line_break?
'part2'
INTO lv_string.
WRITE lv_string.
Any idea?
‎2006 Aug 14 3:40 PM
Hi Daniel,
CONCATENATE 'part1'
cl_abap_char_utilities=>line_feed
'part2'
INTO lv_string.
WRITE lv_string.
Best regards,
Prashant
‎2006 Aug 14 3:43 PM
cl_abap_char_utilities=>line_feed does not exist.
And cl_abap_char_utilities=>newline or cl_abap_char_utilities=>cr_lf don't work. They are just written as '##'.
‎2006 Aug 14 3:57 PM
Hi ,
Use this : data: newline(2) TYPE x VALUE '0D0A'.
or just assign '/' to a constant and use it or you can go for cl_abap_char_utilities=>newline or cl_abap_char_utilities=>cr_lf , if you are using a unicode system environment.
Regards,
Raghav
‎2006 Aug 14 4:36 PM
'0D0A' is only displayed as '0D0A'.
newline and cr_lf are displayed as '##'.
'/' is only displayed as '/'.
Does this mean that I am on a non-unicode system?
Message was edited by: Daniel Humberg
‎2006 Aug 14 4:40 PM
>>Does this mean that I am on a non-unicode system?
You can check it using the menu <i>system--> status</i>
look out for the value yes/no in the field <i>Unicode System</i>
~Suresh
‎2006 Aug 14 4:42 PM
‎2006 Aug 14 4:44 PM
Interesting requirement..
WRITE statement does not interpret OS line break codes.
You've to program to induce line break, try the following example code.
data: lv_string(20),
lv_off type i.
concatenate 'part1'
'~'
'part2'
into lv_string.
search lv_string for '~'.
lv_off = sy-fdpos + 1.
write: at 1(sy-linsz) lv_string0(sy-fdpos), lv_stringlv_off.
Regards
Sridhar
‎2006 Aug 14 10:07 PM
hai,
try this,
class cl_abap_char_utilities definition load.
constants: c_tab type c value
cl_abap_char_utilities=>crlf.
*chech exact method in above class for carriage return and line feed
CONCATENATE 'text1' c_tab 'text2' c_tab 'text3' into gd_result.
write gd_result.
‎2006 Aug 15 7:37 AM
Hi loeiz,
as I said, cl_abap_char_utilities=>cr_lf does not work.
I now found a solution that is similar to Sridhar soluion.
CONCATENATE 'text1' '~~~' 'text2' c_tab 'text3'
INTO lv_string.
SPLIT lv_string AT '~~~' INTO TABLE lt_stringtab .
LOOP AT lt_stringtab INTO lv_string.
WRITE / lv_string.
ENDLOOP.