Application Development 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: 

Function Module

Former Member
0 Kudos

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

Former Member
0 Kudos

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

abdulazeez12
Active Contributor
0 Kudos

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

Former Member
0 Kudos

data: str1 type string,

str2 type STring,

str3 type string.

str1 = 'aaaaaaaaaa'.

str2 = 'bbbbbbbbbb'.

CONCATENATE str1 skip str2 into str3.

Former Member
0 Kudos

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...

ravishankar_reddy2
Active Participant
0 Kudos

Hi,

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

use CONCATENATE only.

regards,

ravi shankar reddy

Former Member
0 Kudos

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....

0 Kudos

Thank You

Former Member
0 Kudos

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