Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Merge two strings.

Former Member
0 Likes
1,143

Hi

I am new in ABAP Programming. and want to merage two strings, and put the result in third one.

second thing from where i can get help of different string functions.

Thanks

Ajay

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
960

Hi

i think you are talking about concatination of strings plz try this program.

DATA t1(70) TYPE c.

DATA t2(70) TYPE c.

DATA t3(140) TYPE c.

t1 = 'ABAP Programming'.

t2 = 'is a Fun'.

CONCATENATE t1 t2 INTO t3 SEPARATED BY space.

WRITE t3.

you can find the help from ABAP Key word Documentation. just place you cursor on concatenate and press F1.

Regards

Rai

5 REPLIES 5
Read only

Former Member
0 Likes
960

Hi Ajay,

use the concatenate statement.

concatenate string1 string2 into string3.

Siggi

Read only

Former Member
0 Likes
960

hi,

use the following statement :

Concatenate string1 string2 into string3

separated by space. " optional

you can check out the different type of string operations:

http://help.sap.com/saphelp_46c/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm

Regards,

Jagath

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
960

Hi Ajay,

Try this code.

data : s1 type string,

s2 type string,

s3 type string.

s1 = 'ABC'.

s2 = 'DEF'.

concatenate s1 s2 into s3.

write s3.

You can get help in ABAP Documentation itself.

Check this also.

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm

Hope this helps.

Read only

Former Member
0 Likes
960

Hi,

You can use concatenate statement to merge two strings.

ex. data: str1(10) value 'Testing',

str2(15) value 'Strings'

str3(30).

concatenate str1 str2 into str3.

Regarding your 2nd question,you can find very good documentation on String functions in SAP help.

If this resolves your question, then you can close the loop with reward points.

Rgds,

Read only

Former Member
0 Likes
961

Hi

i think you are talking about concatination of strings plz try this program.

DATA t1(70) TYPE c.

DATA t2(70) TYPE c.

DATA t3(140) TYPE c.

t1 = 'ABAP Programming'.

t2 = 'is a Fun'.

CONCATENATE t1 t2 INTO t3 SEPARATED BY space.

WRITE t3.

you can find the help from ABAP Key word Documentation. just place you cursor on concatenate and press F1.

Regards

Rai