2007 Jun 06 2:52 PM
can anybody help me this program.
RAMAIAH
this can be printed in reverse order :HAIAMAR
plz help me.
can anybody help me this program.
RAMAIAH
this can be printed in reverse order :HAIAMAR
plz help me.
2007 Jun 06 3:25 PM
hi,
u follow this logic to printing string inn reverse.
declarations
data: c1,
c2,
c3,
c4,
c5,
c6,
c7,
string value 'RAMAIAH',
string1.
c1 = string+6(1). " here i use string offset and length functionality
c2 = string+5(1).
c3 = string+4(1).
c4 = string+3(1).
c5 = string+2(1).
c6 = string+1(1).
c7= string(1).
CONCATENATE c1 c2 c3 c4 c5 c6 c7 <b>into</b> string1.
write:/ 'reverse o fstring is', string1.
regards,
sudheer
2007 Jun 07 5:56 AM
Hi,
Use the FM STRING_REVERSE.
CALL FUNCTION 'STRING_REVERSE'
EXPORTING
string = v_name1
lang = sy-langu
IMPORTING
rstring = v_name2
EXCEPTIONS
too_small = 1
OTHERS = 2.Hope this helps.
Regards,
Richa
2007 Jun 07 5:58 AM
hi,
just execute this program.
data : c(5) value 'RAMAIAH'.
data : 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.
Rgds
Anversha
2007 Jun 07 6:47 AM
hi,
Use the FM STRING_REVERSE.
data : v_string1(20) type C.
data : v_string2(20) type C.
initialization.
v_string1 = 'RAMA'.
CALL FUNCTION 'STRING_REVERSE'
EXPORTING
string = v_string1
lang = sy-langu
IMPORTING
rstring = v_string2
EXCEPTIONS
too_small = 1
OTHERS = 2.
write 😕 v_string1,v_string2.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |