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: 

Help me

Former Member
0 Kudos
100

Code for String Reversal in ABAP.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
72

Hi Vinay,

Try the function module STRING_REVERSE.

Works perfectly fine.

Rgds,

Aditya

5 REPLIES 5

former_member181962
Active Contributor
0 Kudos
72

use FM:

STRING_REVERSE

Usage:

CALL FUNCTION 'STRING_REVERSE'

EXPORTING

string = name

lang = sy-langu

IMPORTING

rstring = re_name.

alex_m
Active Contributor
0 Kudos
72

Use FM 'STRING_REVERSE'

Former Member
0 Kudos
72

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

Former Member
0 Kudos
73

Hi Vinay,

Try the function module STRING_REVERSE.

Works perfectly fine.

Rgds,

Aditya

Former Member
0 Kudos
72

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.