‎2006 Sep 04 11:45 AM
hi all,
is it possible to concatenate string with character new line ?
for example, i have one variable : 'lv_string'
if i write the variable to screen with syntax :
write : / lv_string.
the result will be like this :
hello
world
is there any way ?
please help
regards
eddhie
‎2006 Sep 04 11:46 AM
Hi eddhie,
1. Unfortunately
WRITE statement does not work with NEW LINE character.
2. At most it will display this new line character
as #.
3. It will show like this
hello#world.
4. What can be done is that,
the string can be SPLIT at
new line character,
into an internal table.
5. Then we can loop at this internal table,
and use WRITE 😕 itab-fieldname.
regards,
amit m.
‎2006 Sep 04 11:46 AM
Hi eddhie,
1. Unfortunately
WRITE statement does not work with NEW LINE character.
2. At most it will display this new line character
as #.
3. It will show like this
hello#world.
4. What can be done is that,
the string can be SPLIT at
new line character,
into an internal table.
5. Then we can loop at this internal table,
and use WRITE 😕 itab-fieldname.
regards,
amit m.
‎2006 Sep 04 12:03 PM
hi Amit,
thanks for the reply.
yes, i have tried with CL_ABAP_CHAR_UTILITIES class and the result in the screen will be '#'.
the problem is i want to write the variable to a smartforms. at certain condition the text value will be 'A' and at the other condition the text value should be 'B'. i have used the CL_ABAP_CHAR_UTILITIES class to do that but character '#' will appear instead of NEW LINE CHARACTER.
unfortunately, i'm newbie in smartforms and the documentation about smartforms that i got is not much help.
is there any way i can do that in smartforms ?
please help
regards
‎2006 Sep 04 11:46 AM
‎2006 Sep 04 11:49 AM
CLASS CL_ABAP_CHAR_UTILITIES DEFINITION LOAD.
CONSTANTS: C_CR_LF TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
CONCATENATE 'helo'
'world'
INTO V_STR separated by C_CR_LF.this will work only if we download it to either presentation server or application server. then only we can see the line break betwen 'HELO' and 'world'.
if your requirement is just to print,
you can use,
write 😕 'helo'.
write 😕 'world'.
regards
srikanth
Message was edited by: Srikanth Kidambi
Message was edited by: Srikanth Kidambi