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

Working With String

Former Member
0 Likes
577

Dear All,

I need to use a line break in between two string. i need to append all the data from various variables into a string with a line break. How will i do that.

Eg., Char A(100) contains data as 'This is for the concatenate String 1'.

Char B(100) Contains data as 'This is for the concatenate string 2'.

I need to move all the data to a string S.

Similarly i will get some 5 or 6 variables and i need to move the content to String variable S.

Please help me to solve this issue.

Thanks

Ram M

1 ACCEPTED SOLUTION
Read only

former_member209217
Active Contributor
0 Likes
545

Use this for line break CL_ABAP_CHAR_UTILITIES=>NEWLINE

5 REPLIES 5
Read only

former_member209217
Active Contributor
0 Likes
546

Use this for line break CL_ABAP_CHAR_UTILITIES=>NEWLINE

Read only

0 Likes
545

Hi Lakshmanan,

Thanks for your quick reply.

I am sorry if you could sent me the snippet which will help me to solve this issue.

Thanks

Ram M

Read only

0 Likes
545

concatenate a b into c separated by cl_abap_char_utilities=>newline.

Read only

Former Member
0 Likes
545

Hi,

DATA: CRLF TYPE C VALUE cl_abap_char_utilities=>NEWLINE.

Concatenate A B into C separated by CRLF.

It will be printed as A

...............................B. (Remove the dots )

Regards,

Vimal.

Read only

Former Member
0 Likes
545

Hi,

Try this code

CONSTANTS seperator TYPE C VALUE cl_abap_char_utilities=>new_line.

Concatenate chara charb INTO s SEPARATED BY seperator.

Regards

Milan