Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Converting xstring to string and back?

Hello, everybody

I have a problem where I have an ID for an element that is made of 32 hexadecimal elements (hence a size 32 xstring). I need to use it in another system which requires a shorter parameter, but of type string. Therefore, I came to the conclusion that converting my xstring to a string I could turn it into a smaller element than making a simple "one-to-one" conversion (for example, converting 'AF543' where each element is a Hexadecimal to 'AF543' where each element is a character).

I looked into the forum and I found the following Function Modules: NLS_STRING_CONVERT_TO_SYS and NLS_STRING_CONVERT_FROM_SYS.

However, when I convert the xstring '00300571B3851DDD9DFFF7A753C08326' to a string, I get '#0#q³##Ý#ÿ÷§SÀ#&' as a result. I realized that the character # repeats itself several times, although there is no repetition of elements in the xstring. Obviously, when I converted this string back to xstring, I got a different result, because the # character was always interpreted as the same number.

Isn't this conversion supposed to be unique? How could I convert my xstring to a unique string and be able to make the conversion the other way around, getting my original xstring back?

Any support will be very appreciated. Thank you in advance.

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question