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

Function Module

Former Member
0 Likes
670

Hi,

Can any body tell the Function Module to Concatenate two or More Strings into one String.

Eg: string1 = My

string2 = Name

string3 = is

string4 = Ravi

string5 = string1 + string2 + string3 + string4

i.e string5 = My Name is Ravi

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
643

HI,,

STRING_CONCATENATE Concatenates (links) two strings without multibyte handling

STRING_CONCATENATE_3 Concatenates 3 strings

plzz reward if it is usefull plzz dont forget ot reward....

7 REPLIES 7
Read only

abdulazeez12
Active Contributor
0 Likes
643

Hi Sridhar-

Why is that u require a function module to concatenate the strings???

You can simply use CONCATENATE to do the job.

CONCATENATE string1 string2 string3.. into string_main.

Cheers

Shakir

Read only

Former Member
0 Likes
643

data: str1 type string,

str2 type STring,

str3 type string.

str1 = 'aaaaaaaaaa'.

str2 = 'bbbbbbbbbb'.

CONCATENATE str1 skip str2 into str3.

Read only

Former Member
0 Likes
643

Sridhar,

Try this

DATA: NEWLINE(2) TYPE X VALUE '0D0A'

DATA: V_CHAR(50).

CONCATENATE LINE1 LINE2 INTO V_CHAR SEPARATED BY NEWLINE.

(OR)

DATA: test1 TYPE String,

test2 TYPE String,

test3 TYPE string.

test1 = 'Hallo'.

test2 = 'du da'.

CONCATENATE test1 sy-uline(5) test2 INTO test3 SEPARATED BY space.

WRITE test3.

Don't forget to reward if useful...

Read only

Former Member
0 Likes
643

Hi,

There is no such type of FM to concatenate the string.

use CONCATENATE only.

regards,

ravi shankar reddy

Read only

Former Member
0 Likes
644

HI,,

STRING_CONCATENATE Concatenates (links) two strings without multibyte handling

STRING_CONCATENATE_3 Concatenates 3 strings

plzz reward if it is usefull plzz dont forget ot reward....

Read only

0 Likes
643

Thank You

Read only

Former Member
0 Likes
643

Hi,

with this code you can combine one or more strings,

i tested this code for your requirement.

data : string1 type string,

string2 type string,

string3 type string,

string4 type string,

string5 type string.

string1 = 'My'.

string2 = 'Name'.

string3 = 'is'.

string4 = 'Ravi'.

concatenate string1 string2 string3 string4 into string5.

write : / string5.

Regards,

swami