01-26-2010 3:46 PM
Hi Experts,
I am working ona UPgrade to ECC6.0 project.
The issue I am facing is the program has UNICODE type incompatibitlity while oving data from String to internal table with only field of Raw type.
Basically I am looking for a way to convert either a String or character to RAW data format.
Is there any FM. PLease help.
Rgds
Kishore
01-26-2010 4:01 PM
01-27-2010 9:22 AM
No This function module could not resolve my issue. Let me know if there is any other way.
Rgds
Kishore
01-26-2010 5:28 PM
01-27-2010 9:21 AM
No this did not work.Let me know of there is any other way.
Rgds
Kishore
01-27-2010 9:23 AM
Hi,
Use CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = <string>
IMPORTING
buffer = <xstring>
EXCEPTIONS
failed = 1
OTHERS = 2.
Thanks,
Shailaja Ainala.
01-26-2010 9:40 PM
An easy solution found by Dirk Boller () is to use:
data l_string type string.
data l_xstring type xstring.
DATA l_buffer TYPE xstring.
l_string = 'ABCD'.
EXPORT my_data = l_string TO DATA BUFFER l_buffer.
IMPORT my_data TO l_xstring FROM DATA BUFFER l_buffer IN CHAR-TO-HEX MODE.
FREE l_buffer.
* l_xstring will contain hex 4100420043004400 if your system is UTF-16LE
01-27-2010 9:20 AM
Hi,
I see that the solution you have given is converting the character value to hexadecimal value.
Here the requirement for me is to convert data from of a character or string type to RAW data format.
PLease check and assist.
Rgds
Kishore
01-27-2010 11:00 AM
Should I do everything?
Add the following lines after the block above. Of course, the raw field (abap X type) must be long enough.
DATA rawfield TYPE x LENGTH 10.
rawfield = l_xstring.
01-27-2010 11:09 AM
Hello Sandra,
I generally use the table INDX for this : IMPORT / EXPORT to DATABASE. I think this is the easiest solution
BR,
Suhas