Fonction SAP STRING_REVERSE - Returns a string in reverse order

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
LANG 0
STRING 0 Character string to be reversed

Paramètre Reférence Type Long. Description
RSTRING 0 Reverse character string

Exception Description
TOO_SMALL Output field too short


Functionality
The function module returns the character string entered inreverse sequence. Leading blanks are taken into account,trailing blanks are not.
All exceptions are generated with RAISE and must be handled in thecalling program.
Examples
' abc ' becomes 'cba ' . (If the actual parameter assigned tothe formal parameter RSTRING is longer than 4 characters as shownin this example, the remaining places are padded with blanks.)
Sample call:
DATA: REVERSESTRING(10).
CALL FUNCTION 'STRING_REVERSE'
EXPORTING STRING = ' abcdef '
IMPORTING RSTRING = REVERSESTRING
EXCEPTIONS TOO_SMALL = 1.
IF SY-SUBRC = 0.
* The reverse string is in RSTRING
ELSE.
* RSTRING zu kurz
ENDIF.at the end, however, are not taken into account.