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: 

line gap between string

Former Member
0 Kudos
112

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

Sm1tje
Active Contributor
0 Kudos
71

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

Sm1tje
Active Contributor
0 Kudos
72

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.

Former Member
0 Kudos
71

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.

venkat_o
Active Contributor
0 Kudos
71

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