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

String TEmplate - new line

Former Member
0 Likes
3,052

Hi

I am tring to put a new line into a string template

data: lv_text type string.

lv_text = | Bond, James Bond \n | && | How do you do? |.

write: lv_text.

But apparently 'write' does not support this kind of new line.

Any idea how to to smuggle the new line into string template

so it works with 'write'?

Thank you

regards

Yuval

7 REPLIES 7
Read only

deependra_shekhawat3
Contributor
0 Likes
2,192

Hi Yuval,

Try with CL_ABAP_CHAR_UTILITIES=>NEWLINE.

e.g.

concatenate 'Bond, James Bond' CL_ABAP_CHAR_UTILITIES=>NEWLINE

                 'How do you do? ' into lv_text.

Thanks

Deependra

Read only

0 Likes
2,192

I don't thing so that CL_ABAP_CHAR_UTILITIES=>NEWLINE will work with "Write"..

Read only

0 Likes
2,192

Hi

The point is you do not need concatenate any

more once you switch to string templates

rgds

yuval

Read only

Former Member
0 Likes
2,192

Hi

Try to use '/' to skip line or

CL_ABAP_CHAR_UTILITIES=>NEWLINE

Read only

Tomas_Buryanek
Product and Topic Expert
Product and Topic Expert
0 Likes
2,192

I guess you will need some programming for WRITE "list" output.

SPLIT AT ' \n' .. => WRITE

-- Tomas --
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
2,192

\n is the RegEx character for line-feed(LF).

The ABAP list processor cannot identify this character & displays the replacement character # instead. But if you view the variable(in debug mode) in HTML view you can see the line break.

BR,

Suhas

Read only

Former Member
0 Likes
2,192

Hi

Apparently it does not work in report.

It does however work in screen and in

web dynpro.

Thank you

regards

Yuval