Question:
How do you concatenate strings without ignoring trailing spaces. Example:
S1 = 'A '. " A and 9 spaces
S2 = 'B'.
S3 = ''.
CONCATENATE S1 S2 TO S3.
* this make S3 =
AB
I want
A B
?????
Thanks
Answer:
CONCATENATE .... SEPARATED BY SPACE ????
_________________
Only sheep and Tuly Idiots need a leader
Answer:
CONCATENATE .... SEPARATED BY SPACE ????
For some reason my first post didn't post correctly.
S1 should equal "A ".
The output should equal "A B".
CONCATENATED BY SPACE doesn't do this.
Answer:
CONCATENATE .... SEPARATED BY SPACE ????
For some reason my first post didn't post correctly.
S1 should equal "A ".
The output should equal "A B".
CONCATENATED BY SPACE doesn't do this.
This forum must be programmed in ABAP, because my posts are not showing the trailing spaces. I give up. At times like this, I hate ABAP.
Answer:
Aha sorry missing all of the trailing explains a lot. Are your variables completely filled with space or do you want them partially filled with spaces??
_________________
Only sheep and Tuly Idiots need a leader
Answer:
Try:
S3 = S1.
dum = STRLEN( S3 ).
S3+dum = S2.
Or think something like it.
_________________
Brief History of the Tuly Idiots
Bad advices, wrong answers, bigotism
sapfans GD
Ad by Viiiiiic
Answer:
Why not use a structure ?
This contains and example.
_________________
Regards
R
Abap KC
SFMDR
Answer:
You could also remove the spaces and put them back later,
e.g.
translate S1 using ' ~'. " (space/tilde) gives 'A~~~~~~~~~'.
concatenate S1 S2 into S3. " gives A~~~~~~~~~B'.
translate S3 using '~ '. " (tilde/space) gives 'A<9 spaces>B'.
Answer:
Thanks for all the replys. I ended up using a dummy character and then replacing it after the concatenation.