‎2007 Mar 06 10:57 AM
Hi,
I want to concatenate two fields into a target field. Both are of type character.
Now my Question is I want to concatenate these two fields without loosing trailing spaces.
for example ,first field is of length 20 and the sencond field is of lenth 15 characters.
Data : s1(20) type c,
s2(15) type c.
data : s3(40) type c.
S1 = 'sdn'.
S2 = 'network'.
concatenate s1 s3 into s3.
s3 should contain the contents like 'sdn network '.
after 'sdn' there are 17 spaces (20-3) and after 'network' there are 8 spaces(15-7).
Can u pls anyone suggest me on the same.
I tried using conversion exits, but for character type of fields , there will be no effect.
Regards,
Sujatha.
‎2007 Mar 06 10:59 AM
Hi Sujatha,
do like this
concatenate field1
` `
field2
` `
into v_target.
The Quotes you see are not normal ones. they are escape characters (The key above the TAB key n the keyborad.
Regards,
Ravi
‎2007 Mar 06 10:59 AM
Hi Sujatha,
do like this
concatenate field1
` `
field2
` `
into v_target.
The Quotes you see are not normal ones. they are escape characters (The key above the TAB key n the keyborad.
Regards,
Ravi
‎2007 Mar 06 11:00 AM
try this way
Data : s1(20) type c,
s2(15) type c.
data : s3(40) type c.
S1 = 'sdn'.
S2 = 'network'.
concatenate s10(20) s20(15) into s3.
‎2007 Mar 06 11:01 AM
‎2007 Mar 06 11:01 AM
Hi,
You can use ..
Condense field NO-GAPS.
Reward if you find this useful..
‎2007 Mar 06 11:01 AM
If you know the exact lengths , try this
report y_test1.
data : s1(20) type c,
s2(15) type c.
data : s3(40) type c.
S1 = 'sdn'.
S2 = 'network'.
s3+0(20) = s1.
s3+20(15) = s2.
write : s3.
‎2007 Mar 06 11:02 AM
Hello,
try like this
Data : s1(20) type c,
s2(15) type c.
data : s3(40) type c.
S1 = 'sdn'.
S2 = 'network'.
concatenate s1 ` ` s2 ` ` into s3.
write: s3
Vasanth
‎2007 Mar 06 11:02 AM
we have 'separated by' option for this..
concatenate s1 s2 into s3 separated by space.
reward if it helps u...
‎2007 Mar 06 11:10 AM
Hi Sujatha.
i thnk this will work..
<u><b>Syntax</b></u>
CONCATENATE {dobj1 dobj2 ...}|{LINES OF itab}
INTO result
[IN {BYTE|CHARACTER} MODE]
[SEPARATED BY sep]
<b> [RESPECTING BLANKS].</b>
for ur example
DATA : s1(20) TYPE c,
s2(15) TYPE c.
DATA : s3(40) TYPE c.
s1 = 'sdn'.
s2 = 'network'.
CONCATENATE s1 s2 INTO s3 RESPECTING BLANKS.
WRITE s3.
Regards
Srinivas
*Reward all Useful answers
‎2007 Mar 06 11:10 AM
Hi,
Concatenate VAR1 VAR2 INTO VAR3 SEPARATED BY SPACE.
Regards,
Irfan