on 03-05-2008 10:12 AM
Hi all!!
Iam looking for SAP STANDARD Function that gets a string and changes its words order.
thanks!
Hi Yulia,
Try the function module STRING_REVERSE,
Description
Returns a string in reverse order
Functionality
The function module returns the character string entered in reverse sequence. Leading blanks are taken into account, trailing blanks are not.
All exceptions are generated with RAISE and must be handled in the calling program.
Examples
' abc ' becomes 'cba ' . (If the actual parameter assigned to the formal parameter RSTRING is longer than 4 characters as shown in 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.
Parameters
RSTRING
at the end, however, are not taken into account.
STRING
LANG
Exceptions
TOO_SMALL
the calling program.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you elaborate the requirement with an example.
Regards
Vinayak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.