‎2008 May 07 12:33 PM
Hi friends,
I have a problem in concatenation.
I have 2 variables like A and B.
I am concatenating into C .
In between A and B i need 3 space empty like below program
****************************************************************
REPORT YABCDE .
DATA: A(5) TYPE C,
B(5) TYPE C,
C(20) TYPE C.
A = 'ABC'.
B = 'XYZ' .
CONCATENATE A ' ' B INTO C .
WRITE:/ C.
****************************************************************
I need answer like 'ABC XYZ'.(NEED 3 space between ABC and XYZ).
But its coming like ABCXYZ.
Points will be rewarded.
‎2008 May 07 12:35 PM
try this:
concatenate A B into C separated by space.
regards,
madhumitha
‎2008 May 07 12:35 PM
Hi,
Try this:
CONCATENATE A B INTO C SEPARATED BY SPACE.but this will give you only 1 Space in Between ABC and XYZ.
OR
For 3 Spaces, Create another Variable with 3 Spaces and write the Below piece of code:
DATA:
a(10) TYPE c VALUE 'ABC',
b(10) type c VALUE 'XYZ',
c(10) TYPE c,
d(3) TYPE c VALUE ' '.
CONCATENATE A B INTO C SEPARATED BY D.
write:
/ c.Regards,
Sunil.
‎2008 May 07 12:41 PM
This works
DATA: A(5) TYPE C,
B(5) TYPE C,
C(20) TYPE C.
A = 'ABC'.
B = 'XYZ' .
CONCATENATE A '***' B INTO C .
translate c USING '* '.
WRITE:/ C.
‎2008 May 07 12:41 PM
HI,
code like this.
DATA: A(5) TYPE C,
B(5) TYPE C,
C(20) TYPE C.
A = 'ABC'.
B = 'XYZ' .
CONCATENATE A ' ' B INTO C RESPECTING BLANKS.
WRITE:/ C.
rgds,
bharat.
‎2008 May 07 12:42 PM
DATA: A(5) TYPE C,
B(5) TYPE C,
C(20) TYPE C.
A = 'ABC'.
B = 'XYZ' .
C = ' '. " 3 spaces.
CONCATENATE A C B INTO C .
WRITE:/ C.
Reward if helpful.
Thanks,
Imran.
‎2008 May 07 12:44 PM
Hi,
just declare one variable or constant c_space and pass the value space(press ALT key and then press 0160, repeat this 3 times for 3 spaces) then use this variable with your concatenate statement.
Rgds,
Bujji
‎2008 May 07 12:47 PM
Hi ,
Check this sample code.
********************************************************
DATA:
a(3) TYPE c VALUE 'ABC',
b(3) type c VALUE 'XYZ',
c(3) TYPE c VALUE ' ',
d(9) type c.
CONCATENATE A C B INTO d RESPECTING BLANKS.
write: / d.
********************************************************
Hope this is helpful to you. If you need further information, revert back.
Reward all the helpful answers.
Regards
Nagaraj T
‎2008 May 07 12:55 PM
Hi,
Use the below code.
DATA: A(5) TYPE C,
B(5) TYPE C,
C(3) TYPE C,
D(20) type c.
A = 'ABC'.
B = 'XYZ' .
C = ' '.
CONCATENATE A C B INTO D respecting blanks.
WRITE:/ D.
Reward if useful.
Regards,
Anu,