Skip to Content
author's profile photo Former Member
Former Member

Function Module

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 05:49 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 05:41 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 05:42 AM

    data: str1 type string,

    str2 type STring,

    str3 type string.

    str1 = 'aaaaaaaaaa'.

    str2 = 'bbbbbbbbbb'.

    CONCATENATE str1 skip str2 into str3.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 05:46 AM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 30, 2008 at 05:48 AM

    Hi,

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

    use CONCATENATE only.

    regards,

    ravi shankar reddy

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 30, 2008 at 05:59 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.