‎2010 Feb 10 5:24 AM
Hi ,
i need to concatenate 4 fields into a string with space but i can't use separated by space as it creates extra space in between 2 fields .
The statement i am using is
Concatenate str1 str2 ',' str3 into string .
Here i need to have space between str1 and str2 and before str3 . But if i use separated by space it adds space after comma also i tried using the constant SPACE and also ' ' but its not working . Please suggest .
‎2010 Feb 10 5:27 AM
hi,
concatenate str1 str2 into string separated by space.
then concatenate string and ',' into string.
then concatenate str3 and string into string separated by space.
regards,
sakshi
‎2010 Feb 10 5:29 AM
YOu can do something like this.
REPORT zrich_0001.
data: str1 type string.
data: str2 type string.
data: str3 type string.
data: str4 type string.
str1 = 'This'.
str2 = 'That'.
str3 = 'The other'.
Concatenate str1 str2 into str4 separated by space.
concatenate str4 ',' into str4.
Concatenate str4 str3 into str4 separated by space.
write:/ str4.Regards,
Rich Heilman
‎2010 Feb 10 5:31 AM
Try something like this,
data: str1 type string,
str2 type string,
str3 type string.
str1 = 'How'.
str2 = 'are'.
str3 = 'you'.
concatenate str1 str2 into str1 SEPARATED BY space.
CONCATENATE str1 ',' str3 into str1.
write: str1.
Vikranth
‎2010 Feb 10 5:31 AM
Use two concatenate statements.
Here your requirement is not to add a space after the comma. Hence use this:
Concatenate str1 str2 ',' into stringextra separated by space.
Concatenate stringextra str3 into New String.if you need no space before and after comma then use this:
Concatenate str1 str2 into stringextra separated by space.
Concatenate stringextra ',' str3 into New String.Edited by: Kapil Sharma @ Steria on Feb 10, 2010 6:32 AM
‎2010 Feb 10 5:38 AM
Hi,
You can try below option.
Concatenate str1 str2 ',' into str_new separated by space.
Then concatenate this variable into new variable.
Concatenate str_new str3 into string.
This way you will be able to display text like:
str1 str2 ,str3.Thanks,
Archana
‎2010 Feb 10 5:49 AM
Thanks Rich , Using 3 concatenate statement solved the problem.