‎2020 Dec 13 7:27 PM
How can a text be write in reverse? How do I access the characters of a text? I want to do this manually without using a function.
DATA : c(10) 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.
This code works for me but is there a shorter way?
‎2020 Dec 13 8:24 PM
DATA off TYPE syindex.
DO strlen( in_str ) TIMES.
off = sy-index - 1.
out_str = in_str+off(1) && out_str.
ENDDO.
‎2020 Dec 13 8:24 PM
DATA off TYPE syindex.
DO strlen( in_str ) TIMES.
off = sy-index - 1.
out_str = in_str+off(1) && out_str.
ENDDO.
‎2020 Dec 13 9:13 PM
‎2020 Dec 13 9:19 PM
Could you please provide example when it does not work properly?
Also I want to specify the signature of the method
methods REVERSER
importing
!IN_STR type STRING default 'any Text'
exporting
!OUT_STR type STRING .
‎2020 Dec 13 9:42 PM
The output of this code:

The output I want is as follows:
It should also see the gap in between.
‎2020 Dec 13 9:56 PM
The screenshot from debug.

Please pay attention that data types are strings, not char-like.
‎2020 Dec 13 9:01 PM
Without a function means probably without any function at all, so your code is the shortest legible code.