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 in two lines

Former Member
0 Likes
1,349

Hi Friends,

I have a two lines of a text. I have stored them in two seperate text elements. If i contenate them it will come in a single line. But i want them a two seperate lines.

Can anybody give me tha logic for this...

Regards

Satish Kumar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,303

Hi,

use below logic

write:/ text-001.

write:/ text-002.

or

write text-001.

new-line.

write text-002.

Regards

amole

9 REPLIES 9
Read only

Former Member
0 Likes
1,303

Hi,

Concatinate menas, the text will come one after other, so do not concatinate 2 texts,

Wrtite like:-

Write: TEXT1,/,text2

Regards

Sudheer

Read only

Former Member
0 Likes
1,303

you can concatenate them with using the separator as line feed.

<b>CONCATENATE STR1 STR2 INTO STR

SEPARATED BY CL_ABAP_CHAR_UTILITIES=>CR_LF.</b>

Read only

Former Member
0 Likes
1,303

if you want to display them in 2 lines using WRITE then do,

WRITE 😕 TEXT-001,

TEXT-002.

and if you are sending/downloading the contents,then use

DATA : V_CR TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.

CONCATENATE TEXT-001

TEXT-002

INTO V_TEXT SEPARATED BY V_CR.

(_CR Is line feed character in this case)

regards

srikanth

Message was edited by: Srikanth Kidambi

Read only

Former Member
0 Likes
1,303

Data: begin of i_data occurs 0,

text type char50,

end of i_data.

i_data-text = text-001.

append i_data.

i_data-text = text-002.

append i_data.

Prakash.

Read only

Former Member
0 Likes
1,303

Hi Satish,

Display them in two lines by the WRITE statement.

Regards,

Ram Mohan

Read only

Former Member
0 Likes
1,304

Hi,

use below logic

write:/ text-001.

write:/ text-002.

or

write text-001.

new-line.

write text-002.

Regards

amole

Read only

anversha_s
Active Contributor
0 Likes
1,303

hi satish,

try this.

DATA : sep TYPE C value CL_ABAP_CHAR_UTILITIES=>CR_LF.

CONCATENATE string1

string2

INTO string_res SEPARATED BY sep.

write string_res.

Other wise use 2 separate write statements

rgds

anver

if helped mark points.

Read only

Former Member
0 Likes
1,303

You can write the two text elements in two consecutive lines like this.

write : text-001.

write 😕 text-002.

If you want to skip one line in between, use skip statement in between write statements.

Read only

Former Member
0 Likes
1,303

This message was moderated.