2010 Apr 23 7:45 AM
I need to jumble the string. Ex: String has a valur like 'ANSWER'. I need to jumble the characters. something like 'RSNWRE'. some thing like that. The order of the jumbled string can be of any way.
I need to jumble the string. Ex: String has a valur like 'ANSWER'. I need to jumble the characters. something like 'RSNWRE'. some thing like that. The order of the jumbled string can be of any way.
2010 Apr 23 8:01 AM
Hi,
Develop logic yourself using STRLEN and Loops.
regards,
Moon
2010 Apr 23 9:05 AM
Posted the thread thinking like SAP has any standard function module.
2010 Apr 23 9:14 AM
There is no standard FM available by SAP for jumbling text. Infact we can go with simple logic.
2010 Apr 23 9:18 AM
2010 Apr 23 9:27 AM
@ Vikranth : I tried this FM with passing pattern as ANSWER . The result comes out as WANEER
2010 Apr 23 8:09 AM
hi,
check this code
data:
w_char type STRING VALUE 'WELCOME',
w_index type i,
str1 type string,
str2 type string,
w_int type i,
w_off type i.
w_int = strlen( w_char ).
w_off = 0.
do w_int times.
w_index = sy-index - 1.
if w_off eq 0.
concatenate str1 w_char+w_index(1) into str1.
w_off = 1.
else.
concatenate str2 w_char+w_index(1) into str2.
w_off = 0.
endif.
enddo.
shift str1 left circular.
shift str2 right circular.
concatenate str2 str1 into w_char.
write:/ w_char.
Regards and Best wishes.
2010 Apr 23 12:10 PM
2010 Apr 23 12:19 PM
May be you can share the code for future reference.
Cheers,
Suhas
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |