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

Concatenation

Former Member
0 Likes
1,129

Friends,

I just wanted to concatenate 2 fields by a tab.

Below is the code for the same.

concatenate lv_data CL_ABAP_CHAR_UTILITIES=>horizontal_tab

lv_data1 into lv_final.

My Problem :

The values are separated by # and not by space!!

How to resolve it.

Regards,

Usha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,086

Hi Raja,

Can you explain me where can we use these class attributes?

Usha

8 REPLIES 8
Read only

Former Member
0 Likes
1,086

Hope in debug mode it will look like # & not in output or in excel.

regards

gv

Read only

0 Likes
1,086

as Venkat said, in the debug mode it will show as # but in the file it will be a tab.

Regards

Raja

Read only

Former Member
0 Likes
1,086

Given below is my code & output - I don't know the actual cause of the wrong output.

data : lv_data(15) type c value 'Test with Tab',

lv_data1(15) type c value 'Working Good!',

lv_final type string.

concatenate lv_data CL_ABAP_CHAR_UTILITIES=>horizontal_tab

lv_data1 into lv_final .

write 😕 lv_final.

Output

Test with Tab#Working Good!

Read only

0 Likes
1,086

you cannot use CL_ABAP_CHAR_UTILITIES=>horizontal_tab in ABAP lists. if you want a tab in ABAP list you have to simulate the same using position (WRITE: /10 ).

Regards

Raja

Read only

Former Member
0 Likes
1,086

Try with 'SEPARATED BY space' addition to get space between the strings to concatenate.

regards,

suresh

Read only

0 Likes
1,086

Create an extra variable(constant) which is empty and has the desired length and concatenate this with the first variable before concatenating the second.

Read only

Former Member
0 Likes
1,087

Hi Raja,

Can you explain me where can we use these class attributes?

Usha

Read only

0 Likes
1,086

for example if you want to download your internal table to a local pc as <b>text tab delimited file</b> then you can use this.

this and the others like cr_lf, etc are primarly used when you want to dump data from SAP into filesystems.

Regards

Raja