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: 

I want to Concatenate u0091au0092 , 15 spaces, 'bu0092 , 14 spaces , u0091cu0092 into d

Former Member
0 Kudos

hello all,

I want to Concatenate ‘a’ , 15 spaces, 'b’ , 14 spaces , ‘c’ into d.

that concatenate statement is in loop and that 15,14 spaces are flexible .

Please help me .How can I do this.

3 REPLIES 3

Former Member
0 Kudos

Same like i gave in another thread.

Constants: gc_space1(14) type c value '              ',
                 gc_space2(15) type c value '               '.
 
Data: d(50) type c.
 
Concatenate 'a' gc_space2 'b' gc_space1 'c' into d.
 
write d.

Regards,

Satish

kesavadas_thekkillath
Active Contributor
0 Kudos

data:sp1(15),result(50).

concatenate 'A' 'B' 'C' into result separated by sp1.

write result.

im not aware how to merge with flexible space count.

Former Member
0 Kudos

Hi Megha,

try this code.. it's working..


DATA : str1 TYPE string,

        d TYPE string.

DATA : len1 TYPE i,
       len2 TYPE i.
DATA : str TYPE char40 VALUE '                                '.

len1 = 15. "As you said 15 & 14 are variables here you can assign any value
len2 = 14.



CONCATENATE 'a' 'b' INTO str1 SEPARATED BY str+0(len1).
CONCATENATE  str1 'c' INTO  d SEPARATED BY str+0(len2).
WRITE 😕 d.