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

Help me

Former Member
0 Likes
719

Code for String Reversal in ABAP.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
691

Hi Vinay,

Try the function module STRING_REVERSE.

Works perfectly fine.

Rgds,

Aditya

5 REPLIES 5
Read only

Former Member
0 Likes
691

use FM:

STRING_REVERSE

Usage:

CALL FUNCTION 'STRING_REVERSE'

EXPORTING

string = name

lang = sy-langu

IMPORTING

rstring = re_name.

Read only

alex_m
Active Contributor
0 Likes
691

Use FM 'STRING_REVERSE'

Read only

Former Member
0 Likes
691

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

Read only

Former Member
0 Likes
692

Hi Vinay,

Try the function module STRING_REVERSE.

Works perfectly fine.

Rgds,

Aditya

Read only

Former Member
0 Likes
691

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.