Hi,
can somebody advise me of how to concatenate strings so that trailing space is not ignored? For example I have two variabvles 'ABC ' and 'XYZ ' I need the result to be 'ABC XYZ '. By default trailing spaces are removed, how to retain them?
thanks,
erki
Hi Erki,
see the docu, this is the example from the docu:
Examples DATA: ONE(10) VALUE 'John',
TWO(3) VALUE 'F.',
THREE(10) VALUE 'Kennedy',
NAME(20).
CONCATENATE ONE TWO THREE INTO NAME SEPARATED BY SPACE.
Then, NAME has the value "John F. Kennedy".
Regards,
Dirk
You can also achieve the result you require with a deep data structure. Either group your elements in the order in which they should be concatenated or move the data into the elements into a separate structure. To access the concatenated result, use the higher level data name:
report z_jac_test.
data: begin of concat,
element1(4) value 'ABC ',
element2(4) value 'DEF ',
end of concat.
write: / '[' no-gap, concat no-gap, ']' no-gap.
There is a much easier way.
CONCATENATE `abc ` 'xyz' INTO target.
Using the `` form will keep trailing space characters!
++bcm
Add a comment