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

line gap between string

Former Member
0 Likes
689

Hi,

I want to concatenate two strings in a single one, and there shoule be gap of two lines between those two strings.

example I want to concatenate string1 and string2 in string3, then after concatenate the string3 should have value as shown below:

string1

string2

I have tried all the attributes of class CL_ABAP_CHAR_UTILITIES but it doesnt helped.

Kindly suggest.

Regards,

Neerup

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
648

Look at the code:

DATA: lv_string1 TYPE string VALUE 'string1',

lv_string2 TYPE string VALUE 'string2',

lv_string3 TYPE string.

CONCATENATE lv_string1

cl_abap_char_utilities=>cr_lf

cl_abap_char_utilities=>cr_lf cl_abap_char_utilities=>cr_lf

lv_string2

INTO lv_string3.

WRITE lv_string3.

When you now download this list (save to local file) and open it in notepad, you will notice that it has three empty lines between the first and the second string.

The code is ok, however, you're requirement might not be clear to me.

3 REPLIES 3
Read only

Sm1tje
Active Contributor
0 Likes
649

Look at the code:

DATA: lv_string1 TYPE string VALUE 'string1',

lv_string2 TYPE string VALUE 'string2',

lv_string3 TYPE string.

CONCATENATE lv_string1

cl_abap_char_utilities=>cr_lf

cl_abap_char_utilities=>cr_lf cl_abap_char_utilities=>cr_lf

lv_string2

INTO lv_string3.

WRITE lv_string3.

When you now download this list (save to local file) and open it in notepad, you will notice that it has three empty lines between the first and the second string.

The code is ok, however, you're requirement might not be clear to me.

Read only

Former Member
0 Likes
648

You want to display it on list.. or you want to download that into file.

You can notice the effects of CL_ABAP_CHAR_UTILITIES when you download that list into file.

Check this thread..

G@urav.

Read only

venkat_o
Active Contributor
0 Likes
648

Neerup Sarkar, Not possible to have lines in string. String always one line It can contain N of characters. Thanks, Venkat.O