‎2007 Jun 06 1:42 PM
Hi,
I want to have string value as multiline i.e. if I print it output should be in multiline.
Example:
write anystring
output:
hi
how
are you
possible method would be to concatenate function with separater as newline character. I have very limited knowledge of abap hence need your help
regards,
Gourav
‎2007 Jun 06 1:45 PM
Hi
Split the string into 3 different strings of your length and display them in individual lines and display.
SPLIT STR INTO STR1 STR2 STR3.
OR DO OFFSETTING OF THE STRING into 3 strings and display
Reward points for useful Answers
Regards
Anji
‎2007 Jun 06 1:45 PM
Hi
Split the string into 3 different strings of your length and display them in individual lines and display.
SPLIT STR INTO STR1 STR2 STR3.
OR DO OFFSETTING OF THE STRING into 3 strings and display
Reward points for useful Answers
Regards
Anji
‎2007 Jun 06 1:48 PM
Hi Anji,
The question is not related to printing it is about getting multiline string. I am not going to print this string but it will be use for passing value somewhere else.
Is there any newline character in ABAP??/
regards,
Gourav
‎2007 Jun 06 1:50 PM
for new line
CL_ABAP_CHAR_UTILITIES=>NEWLINE
if its with carriage return
CL_ABAP_CHAR_UTILITIES=>CR_LF
you can use split string at CL_ABAP_CHAR_UTILITIES=>CR_LF into ......
‎2007 Jun 06 1:48 PM
Hello,
Do like this.
DATA: LV_CHAR(132) VALUE
'I want to have string value as multiline'.
DATA: BEGIN OF ITAB OCCURS 0,
FIELD1(20),
END OF ITAB.
SPLIT LV_CHAR AT SPACE INTO TABLE ITAB.
LOOP AT ITAB.
WRITE:/ ITAB-FIELD1.
ENDLOOP.
Vasanth
‎2007 Jun 06 1:48 PM
data: stringtab type standard table of string .
data: wa_string type string .
split <sorucestring> at <separator> into table stringtab .
loop at stringtab into wa_string .
write:/ wa_string .
endloop .
‎2007 Jun 06 1:50 PM
Hi,
The following code could help:
Data: begin of itab occurs 0,
text(100),
end of itab.
data: c_string type string value 'Hi How are you'.
Split c_string at space into itab.
loop at itab.
write:/ itab-text.
endloop.
Thanks and regards,
S. Chandra Mouli.
‎2007 Jun 06 2:16 PM
Thanks to all, My question is solved and points are rewarded....
‎2007 Jun 06 2:20 PM
Hi Gourav,
something like this?
data:
lv_multiple_lines type string.
concatenate
'line1'
'line2'
'line3'
'line4'
'line5'
into lv_multiple_lines
separated by CL_ABAP_CHAR_UTILITIES=>NEWLINE
Regards,
Clemens
‎2007 Jun 06 2:22 PM