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: 

Reverse of the String

Former Member
0 Kudos

Hi,

Plz let me know how to write this program.

Accept the string and disply the reverse of the string, Mention it a Palindrome.

9 REPLIES 9

0 Kudos

Hi,

Use the Function Module STRING_REVERSE.

Regards,

Sesh

Former Member
0 Kudos

Hi,

call function 'STRING_REVERSE'

exporting

string = p_input

lang = sy-langu

importing

rstring = output

exceptions

too_small = 1

others = 2.

Reward if useful!

Former Member
0 Kudos

hI,

Is it possible to write the reverse of the string with out calling FM.

Former Member
0 Kudos

sorry

Message was edited by:

SHIBA DUTTA

jaideeps
Advisor
Advisor
0 Kudos

hi,

data :p_input(10) type c value 'ABCD',output(10) type c .

call function 'STRING_REVERSE'

exporting

string = p_input

lang = sy-langu

importing

rstring = output

exceptions

too_small = 1

others = 2.

write output.

ans: DCBA

thnaks

jaideep

*reward points if useful...

Former Member
0 Kudos

do like this



data : wtab like itab.
data : text(20) value 'MALAYALAM',
       len type i,
       pos type i,
       ntext(20),
       vchar.


compute len = strlen( text ).
pos = len - 1.
do len times.
vchar = text+pos(1).
concatenate  ntext vchar into ntext.
pos = pos - 1.
enddo.

if text Cs ntext.
write : / 'Pallindrome'.
endif.

regards

shiba dutta

Former Member

hi,

chk this simple pgm.

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

data : str like c.

l = strlen( c ).

do l times.
i = i + 1.
l = l - 1.
STR+i(1) = C+l(1).
enddo.

write STR.

Rgds

Reshma

pavan_prabhu
Active Participant
0 Kudos

This message was moderated.

pavan_prabhu
Active Participant
0 Kudos

This message was moderated.