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

Help me

Code for String Reversal in ABAP.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2007 at 10:21 AM

    Hi Vinay,

    Try the function module STRING_REVERSE.

    Works perfectly fine.

    Rgds,

    Aditya

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 02, 2007 at 10:17 AM

    use FM:

    STRING_REVERSE

    Usage:

    CALL FUNCTION 'STRING_REVERSE'

    EXPORTING

    string = name

    lang = sy-langu

    IMPORTING

    rstring = re_name.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 02, 2007 at 10:20 AM

    Use FM 'STRING_REVERSE'

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2007 at 10:20 AM

    Hello,

    USe the FM <b>STRING_REVERSE</b>

    Check the sample code:

    report YXYZ.

    parameter S(10) type C.

    data S1(10) type C.

    <b>call function 'STRING_REVERSE'

    exporting

    STRING = S

    LANG = 'E'

    importing

    RSTRING = S1.</b>

    if S = S1.

    write :/ S, 'is palindrom'.

    else.

    write :/ S, 'is not palindrom'.

    endif.

    Vasanth

    Message was edited by:

    Vasanth M

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 02, 2007 at 10:28 AM

    data: c(5) value 'ABCDE',l type i, i type i value -1.

    data: str(5).

    l = strlen( c ).

    do l times.

    i = i + 1.

    l = l - 1.

    STR + i(1) = C + l(1).

    enddo.

    write: str.

    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.