09-11-2008 3:48 PM
Hi,
I have two strings:
str1 = 'NAME'
str2 = 'ADDRESS'
I want to create a third string:
str3 = 'NAME ADDRESS'
These do not work:
1) str3 = str1 + ' ' + str2
2) concatenate str1 ' ' str2 into str3
3) concatenate str1 ' ' str2 into str3 separated by space
4) str3 = 'NAME&ADDRESS'
replace '&' in str3 with ' '
5) str3 = 'NAME&ADDRESS'
overlay str3 with ' ' only '&'
Any other ideas?
Thx.
Andy
09-11-2008 3:52 PM
Use STRLEN to determine the length of NAME and then put ADDRESS as many spaces over as needed.
Rob
09-11-2008 3:50 PM
Use the respecting blanks addtition:
concatenate ................RESPECTING BLANKS.
09-11-2008 3:52 PM
09-11-2008 3:52 PM
Use STRLEN to determine the length of NAME and then put ADDRESS as many spaces over as needed.
Rob
09-11-2008 3:52 PM
Hi,
i do this and it works:
DATA: STR0 TYPE STRING VALUE 'Vorname'.
DATA: STR1 TYPE STRING VALUE 'Nachname'.
DATA: STR2 TYPE STRING.
*
CONCATENATE STR0 STR1 INTO STR2 SEPARATED BY SPACE.
*
WRITE: / STR0.
WRITE: / STR1.
WRITE: / STR2.
Any problem with my example?.
regards, Dieter
09-11-2008 3:52 PM
hi,
You can Try
Concatenate Var1 space Var2 into var3.
Regards
Sumit Agarwal
09-11-2008 3:53 PM
hi Andrew,
how many spaces do you want? what is not working?
valid examples:
CONCATENATE str1 str2 INTO str3 SEPARATED by space.
==> result will be 1 space between the two words
CONCATENATE str1 ' ' str2 INTO str3 SEPARATED by space RESPECTING BLANKS.
==> result will be 2 spacea between the two words, but this is 6.0 syntax!
+you can also use offset.
hope this helps
ec
09-11-2008 3:54 PM
Hi,
check this...
concatenate str1 ' ' str2 into str3 separated by space
concatenate str1 str2 into str3 separated by space
regards
padma
09-11-2008 3:54 PM
>
> str1 = 'NAME'
> str2 = 'ADDRESS'
> Any other ideas?
>
> Thx.
> Andy
These are not strings, strings are enclosed in ` and not in apostrophes like '.
so use this:
concatenate str1 str2 into str3 in character mode separated by space.
07-28-2016 5:10 PM
My requirement was to add 5 spaces in betwwen 2 strings and i wrote below code and it worked for me,
REPORT ztestttt.
DATA : kunnr TYPE kunnr,
vkorg TYPE vkorg,
text TYPE string.
DATA : lc(5) TYPE c VALUE ' '.
kunnr = 'W8400'.
vkorg = '2500'.
CONCATENATE kunnr vkorg INTO text SEPARATED BY lc.
WRITE : text.