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: 

concatenate with trailing blanks

Former Member
0 Kudos

hi all.

I have to concatenate 2 fields wherein the first field should be allowed to retain its trailing blanks..

is there any way one can do this..

the problem is knvv-kunnr to be concatenated by knvv-vkorg and knvv-spart. Now kunnr has a length of 10 but in the prgram only 5 spaces filled and the remaining 5 blank spaces are to be retained...please can anybody help me on this ..

thanks a lot..

6 REPLIES 6

Former Member
0 Kudos

Hi try something like this :


data : w_final_field(16)

w_final_field(10)   = knvv-kunnr.
w_final_field+10(4) = knvv-vkorg.
w_final_field+16(2) = knvv-spart.

Hope it helps,

Erwan

Former Member
0 Kudos

hi,

dont concatenate these fields with trailing blanks for those fields before concatenate you need to convert those all fields with conversion exits, and then do cancatenation.

cheers,

Bujji

Former Member
0 Kudos

Hi,

if the trailing blank spaces are fixed, then you can concatenate the spaces also using ' ' 5 times. or else you can use conversion_exit FM before the concatenation.

Regards,

Aswin

Former Member
0 Kudos

Hi arup,

1. we can do like this using OFFSET,

in two steps.

2. just copy paste in new program,

it will give output.

12345@@@@@abcdef

where @ = space.

3.

report abc.

data : kunnr like kna1-kunnr.

data : s(25) type c.

kunnr = '12345'.

concatenate kunnr '' into s.

concatenate 'abc' 'def' into s+10(15).

write 😕 s.

regards,

amit m.

former_member181962
Active Contributor
0 Kudos

Hi Arup,

If you know the number of spaces then you can use

the concatenate statement using the ` character(The key above tab in the keyboard.

concatenate matnr ` ` ...into..v_str.

andreas_mann3
Active Contributor
0 Kudos

Hi,

try that :

1) fm LINEITEM_ALPHAFORMAT : fill with leading zero

2) concatenate your 3 fields

3) move space to your_field(5)

Andreas