06-16-2009 4:25 PM
I have a req. of conactenating vaiables with diffrent space values.
E.g. Var1, Var2 ,Var3............Var n need to be seperated by diffrent space values.
Like Var1 Var2 Var3.. .. Varn
or Var1 Var2 Var3.. ... Varn
or Var1 Var2 Var3.. ... Varn etc.
The spaces are not unique but having diffrent lengths.
The Concatenate option with diffrent spaces doesn't work. I have checked it.
Any Ideas.
06-17-2009 8:00 AM
data: lstr type string,
c_5(5) value space,
c_10(10) value space.
CONCATENATE 'This' c_5 'Will' into lstr RESPECTING BLANKS.
CONCATENATE lstr c_5 'Work' c_10 '- Try.' into lstr RESPECTING BLANKS.
write:/ lstr.
Regards
Raghu
06-16-2009 4:29 PM
Hi,
Try with the below options.
1. Include the spaces in the symbol ~. i.e. ~ ~. Now I have included two spaces in the tild symbol.
2. Declare the variables of those many characters with default space.
Regards,
Santhosh.
06-16-2009 4:55 PM
concatenate the values separated by characters that do not appear otherwise in the data, e.g. '§'.
Then TRANSLATE the result USING '§ '.
Thomas
06-17-2009 8:00 AM
data: lstr type string,
c_5(5) value space,
c_10(10) value space.
CONCATENATE 'This' c_5 'Will' into lstr RESPECTING BLANKS.
CONCATENATE lstr c_5 'Work' c_10 '- Try.' into lstr RESPECTING BLANKS.
write:/ lstr.
Regards
Raghu
06-17-2009 8:10 AM
In that case, check this example, here you can use spaces length dynamically..
DATA : l_space(255) TYPE c VALUE space.
DATA : varn TYPE i.
DATA : var3(200) TYPE c.
varn = '6'. "Any dynamic value
CONCATENATE 'VAR1' 'VAR2' 'VAR3' INTO var3
SEPARATED BY l_space+0(varn).
WRITE var3.
06-17-2009 8:17 AM
Hi,
Check the below code.
data: v_space1(1),
v_space2(2),
v_space3(3).
data: v_text1(10),
v_text2(10),
v_text3(10).
concatenate 'Hello' v_space1 '1' into v_text1
respecting blanks.
concatenate 'Hello' v_space2 '2' into v_text2
respecting blanks.
concatenate 'Hello' v_space3 '3' into v_text3
respecting blanks.
write:/ v_text1.
write:/ v_text2.
write:/ v_text3.
Regards,
Kumar Bandanadham