‎2008 Jun 20 12:51 PM
Hi
I have a requirement, where I need to include space.
Eg, there is a field called 'name',whose content is ' 0123456abcd'.
In the output I have to get '0123 456 abcd'
I use below code
name(15) type c.
concatenate name+0(3)
space
name+4(3)
space
name+4(7)
into output.
But I am not getting required output.
I am geting output as 0123456abccd.
Please tell me how to get it
thanks
Rama.
‎2008 Jun 20 12:54 PM
Add the keyword, RESPECTING BLANKS at the end of the concatenate statement.
Regards,
Lakshmi.
‎2008 Jun 20 12:54 PM
Add the keyword, RESPECTING BLANKS at the end of the concatenate statement.
Regards,
Lakshmi.
‎2008 Jun 20 12:54 PM
hi,
try like this.
concatenate name+0(3)
name+4(3)
name+4(7)
into output
seperated by space.
‎2008 Jun 20 12:54 PM
Hi,
Try this,
concatenate name+0(3)
name+4(3)
name+4(7)
into output separated by space.
reward pts if usefull.
Rerads,
Dhan
‎2008 Jun 20 1:01 PM
‎2008 Jun 20 1:07 PM
data: test(20) value '0123456abcd' .
data:filler TYPE c VALUE cl_abap_char_utilities=>HORIZONTAL_TAB.
data: output(20) .
concatenate test+0(3)
filler
test+4(3)
filler
test+4(7)
into output.
write:/ output .
‎2008 Jun 20 1:11 PM
Hi
go through this code.you wil get the correct output.
data:name(15) type c,
output(15) type c.
name = '0123456abcd'.
concatenate name+0(4)
name+4(3)
name+7(4)
into output
separated by space.
write:/ output.
‎2008 Jun 20 1:35 PM
hi Rama Devi,
your question is interesting one.
The mistake what you did is very simple one.
Just look below report.
REPORT YTESTPGM.
data:
name3(4) TYPE c VALUE 'abcd',
name1(4) type c value '0123',
name2(3) TYPE c VALUE '456',
output(14) type c.
concatenate name1 name2 name3 into output separated by space.
WRITE output.
The output is like this
0123 456 abcd.
Just try like this surely it will give the best to you.
Reward me if its succeed. *