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: 

Concatenation

Former Member
0 Kudos
224

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

Former Member
0 Kudos
181

Hi Raja,

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

Usha

8 REPLIES 8

Former Member
0 Kudos
181

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

regards

gv

0 Kudos
181

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

Regards

Raja

Former Member
0 Kudos
181

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!

0 Kudos
181

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

Former Member
0 Kudos
181

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

regards,

suresh

0 Kudos
181

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

Former Member
0 Kudos
182

Hi Raja,

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

Usha

0 Kudos
181

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