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 - Blank line in between

Former Member
0 Likes
1,875

Hi Experts,

I have a field that is of string data type. I am filling the string by concatenating some PO texts . Now I need to induce a new line in between the data based on a condition.

Or in other words i want to start some partof data on next line.

How can i do this?

thanks

Dan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,328

Try concatenating the line feed cl_abap_char_utilities=>CR_LF

in your string.

8 REPLIES 8
Read only

Former Member
0 Likes
1,329

Try concatenating the line feed cl_abap_char_utilities=>CR_LF

in your string.

Read only

Former Member
0 Likes
1,328

Hello Dan,

You can use cl_abap_char_utilities=>CR_LF utility class variable in your logic. We used this in our project.

Thanks,

Greetson

Read only

0 Likes
1,328

Hi,

Thanks .

How do i make use of this class to make the data start from the second (new) line.

Can you please gimme a sample code?

Thanks

Dan

Read only

0 Likes
1,328

To add a new line you can use:


data: text type string.
data: l_newline type c value cl_abap_char_utilities=>newline.

concatenate 'Use new line' l_newline 'here.' into text.

So you have:

Use new line

here.

Read only

0 Likes
1,328

Hi Alvaro Achin,

Its not working:

In output, i am getting Use new line #here.

i need it as :

Use new line

here.

Read only

0 Likes
1,328

Hello Dan,

Try to make use of the FM's:

CONVERT_STRING_TO_TABLE

LXE_COMMON_XSTRING_TO_TABLE

G_BOOL_CONVERT_STRING_TO_TABLE

SWA_STRING_TO_TABLE

SWDP_STRING_TO_TABLE

C14W_STRING_TO_TLINE

We used the FM "C14W_STRING_TO_TLINE" in our projects. This will automatically split line by line and append into an internal table.

Thanks,

Greetson

Read only

0 Likes
1,328

In the debugger and list output it will look like "#" but if you download it to an ASCII file it will have a newline.

I don't think you can add new line in many features of abap (like messages)

Read only

0 Likes
1,328

Dear Experts,

I am doing forms actually. I need to see it in a PDF layout .

thanks

Dan