Application Development 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: 

Which is the NewLine Character in ABAP ??

arunneerolil
Contributor

Hi All,

Can anyone tell me the new-line character in ABAP.

Ex:

In C or C++ '\n' is the newline character.

ie if i print 'Tom\nJerry' in C\C++ the o/p will be

Tom

Jerry

I am looking for it's equivalent in ABAP.

Thanks in Advance

Chemmanz

1 ACCEPTED SOLUTION

Peter_Inotai
Active Contributor

You can use CL_ABAP_CHAR_UTILITIES=>NEWLINE.

Peter

16 REPLIES 16

Peter_Inotai
Active Contributor

You can use CL_ABAP_CHAR_UTILITIES=>NEWLINE.

Peter

0 Kudos

if you want the hexa decimal value then

data: newline(2) TYPE x VALUE <b>'0D0A'.</b>

Regards

vijay

0 Kudos

One more remark: CL_ABAP_CHAR_UTILITIES=>NEWLINE works fine in Unicode (and non-unicode). I'm not sure about the others.

Peter

former_member188685
Active Contributor
0 Kudos

hi,

it is equal to CL_ABAP_CHAR_UTILITIES=>NEWLINE or

Former Member
0 Kudos

Hi,

You can use '/'(forward slash).

Thanks and Regards,

Bharat Kumar Reddy.V

Former Member

Hi Chemmanz,

the new line character in abap is '/'.

regards,

keerthi.

Former Member

hi,

the new line character is '/' or

CL_ABAP_CHAR_UTILITIES=>NEWLINE

hope this helps,

priya.

Former Member

Hi,

CL_ABAP_CHAR_UTILITIES=>NEWLINE

For Example:

Input: lv_string1 = 'ABC', lv_string2 = 'XYZ'

eg:Concatenate : lv_string1 CL_ABAP_CHAR_UTILITIES=>NEWLINE lv_string2 INTO lv_string.

lv_string will

look like this:

'ABC

XYZ'

rgds,

latheesh

Message was edited by: Latheesh Kaduthara

0 Kudos

hi,

can u please explain in detail about

CL_ABAP_CHAR_UTILITIES=>NEWLINE

regards,

P.Sandeep

Former Member
0 Kudos

/ is the new line character in ABAP

Former Member
0 Kudos

Hi Chemmanz,

U can use NEW-LINE.

This terminates the current list line and moves the cursor to the next list line.

Rgds,

Prakashsingh

Former Member
0 Kudos

Hi Mate,

Use these attributes:

CL_ABAP_CHAR_UTILITIES=>NEWLINE

CL_ABAP_CHAR_UTILITIES=>CR_LF

removed by moderator - don't ask for points!

Edited by: Jan Stallkamp on Mar 4, 2011 3:11 PM

0 Kudos

Hi,

I have tried both,But the problem with NEWLINE is ,it is generating one additional blank line and CR_LF is displaying # and | .Could you please suggest any solution to this.

Thanks!

Regards,

Shweta

0 Kudos

Finally - I managed to Do it.

If you want the string to be in same cell - but alt+enter separted then keep the String in Quotes - "String".

REPLACE ALL OCCURRENCES OF CL_ABAP_CHAR_UTILITIES=>NEWLINE

in p_text

WITH CL_ABAP_CHAR_UTILITIES=>CR_LF.

CONCATENATE '"'

p_text

'"'

INTO p_text.

It worked for me. ALL THE BEST.

0 Kudos

You may use: CONCATENATE .... SEPARATED BY '<B.R>' .

delete '.' from 'B.R'

best regards,

Sergiu Iatco

Edited by: Iatco Sergiu on Jun 25, 2010 4:19 PM

Edited by: Iatco Sergiu on Jun 25, 2010 4:20 PM

0 Kudos

Hi fellows,

I am also facing the similar issue in printing the standard text maintained in SO10. I've tried all the solutions but could not generate the required output. in my case it is still printing "#". Can anyone suggest the way out.

I am reading the text in the internal table and concatenating the lines in to string variable. how shall i handle the format column to generate the new line while printing the string in the smartform text.

Thanks,

Janisar