2008 Dec 02 5:22 AM
Good morning,
I need advice please - we have obtained a piece of code from another SAP customer as we urgently had to use a formula to generate some data.
ws_seedno = '123456789ABCDEF123456789ABCDEF12'.
ws_length = STRLEN( ws_seedno ).
ASSIGN ws_seedno(ws_length) TO <fs> TYPE 'X'.
MOVE <fs> TO ws_khex.
The first step is to convert a seed number to hexadecimal - the customer that gave us the code obtains this result out of that code :
3132333435 3637383941 4243444546 3132333435 3637383941 4243444546
3132000000 0000000000 0000000000 0000000000 0000000000 0000000000 00000000
we on the other hand get this result :
0031003200 3300340035 0036003700 3800390041 0042004300 4400450046
0031003200 3300340035 0036003700 3800390041 0042004300 4400450046 00310032
Would someone know why the results differ? We are on different SPs and operating systems but both are ECC6,
Any advice would be greatly appreciated.
Anette
2008 Dec 02 5:29 AM
HI.
Refer this link.
http://www.sapfans.com/forums/viewtopic.php?p=403405&sid=e524cddae19e7ae48a12477e68c6032d#p403405
REgards.
Jay
2008 Dec 02 5:47 AM
Hi
try this function module for conversion of string into xstring then evaluate the results.
CRM_IC_XML_STRING2XSTRING.
Thanks
Vishal Kapoor
2008 Dec 02 8:56 AM
Thank-you Jay and Vishal,
Unfortunately both the suggested solutions delivers the same result as the code I posted
0031003200 3300340035 0036003700 3800390041 0042004300 4400450046
0031003200 3300340035 0036003700 3800390041 0042004300 4400450046 00310032
what is VERY interesting is that the person that supplied us the code is on ECC5, we also have an ECC5 SAP HR installation and this supplies the correct string :
3132333435 3637383941 4243444546 3132333435 3637383941 4243444546
3132000000 0000000000 0000000000 0000000000 0000000000 0000000000 00000000
This does not seem to be an ABAP issue - quite possible a basis?
Anette
2009 Dec 17 8:42 AM
Hi Anette,
I suppose you solved this problem a year ago. But maybe someone watch this post with the same problem . I used the function 'CRM_IC_XML_STRING2XSTRING' and broke through that if a string contais the string ' xml version =" 1.0 "encoding =" utf-8 "? ', the string is turned correctly.
Well, I ckecked the result leaving the string in a xml file and reading it through the function 'GUI_UPLOAD' with filetype = 'BIN' and obtain the same result.
So I didn´t have any problem to use 'CRM_IC_XML_STRING2XSTRING' because I needed to converted a string that contained "xml version =" 1.0 "encoding =" utf-8 "? ' .
I hope someone find it useful