DATA(unusual) = 'á Ă é Ä Ö Ü ä ö ü ß'.
DATA(pretty) = VALUE string( ).
CALL FUNCTION 'SCP_REPLACE_STRANGE_CHARS'
EXPORTING
intext = unusual
IMPORTING
outtext = pretty.
WRITE / unusual.
WRITE / pretty. "a A e Ae Oe Ue ae oe ue ss
DATA(unusual) = 'á Ă é Ä Ö Ü ä ö ü ß'.
DATA(pretty) = VALUE string( ).
CALL FUNCTION 'SCP_REPLACE_STRANGE_CHARS'
EXPORTING
intext = unusual
IMPORTING
outtext = pretty.
WRITE / unusual.
WRITE / pretty. "a A e Ae Oe Ue ae oe ue ss
This method itself has some “unusual” characteristics, e.g. it converts uppercase text to lowercase and replaces spaces with dashes (-).
May I suggests that you use, instead, the FM SCP_REPLACE_STRANGE_CHARS? It has a more “standard” substitution method (for example, it respects the string’s case).
Check SAP program RSCP0155 for this function’s behavior.
Regards,
Luis
Hi Luis,
thanks for your feedback! Seems like in my case, where I just had a single word without spaces, I did not notice this misbehavior.
Just tested the function module and the result looks indeed much better. Thanks for your suggestion.
The only letter which is not correct replaced per default is “ā”.
á Ă ā é Ä Ö Ü ä ö ü ß
a-a-e-ae-oe-ue-ae-oe-ue-ss
á Ă ā é Ä Ö Ü ä ö ü ß
a A . e Ae Oe Ue ae oe ue ss
best regards
Nico