‎2006 Aug 23 9:50 AM
Dear SDNers:
Hello!
I face an issue of sending some XML documents from SAP to a non SAP System. This non SAP System stores XML documents in UTF-8 encoding format. When I create an XML document using CALL TRANSFORMATION in ABAP, the XML code generated has encoding as "ISO-...". Could anyone of you please guide me on how to have this changed to UTF-8?
In case of no solution, I would eventually have to pick the XML generated code and replace the "ISO-..." thing with "UTF-8" at runtime within the program. However, I feel that's not a quality method.
So, if anyone of you can suggest/opine of something better, it would be truly appreciated and rewarded.
--
Have a Nice Day!
Vivek.
‎2006 Aug 23 11:49 AM
Hello Vivek
If you are working on 6.40 already perhaps the following classes may be helpful for converting between different encodings:
- <b>CL_ABAP_CONV_IN_CE</b> (<i>Code Page and Endian Conversion (System Format -> External)</i>)
- <b>CL_ABAP_CONV_OUT_CE</b> (<i>Code Page and Endian Conversion (System Format -> External)</i>)
- <b>CL_ABAP_CONV_X2X_CE</b> (<i>Code Page and Endian Conversion Between External Formats</i>)
Regards
Uwe
‎2006 Aug 23 11:49 AM
Hello Vivek
If you are working on 6.40 already perhaps the following classes may be helpful for converting between different encodings:
- <b>CL_ABAP_CONV_IN_CE</b> (<i>Code Page and Endian Conversion (System Format -> External)</i>)
- <b>CL_ABAP_CONV_OUT_CE</b> (<i>Code Page and Endian Conversion (System Format -> External)</i>)
- <b>CL_ABAP_CONV_X2X_CE</b> (<i>Code Page and Endian Conversion Between External Formats</i>)
Regards
Uwe
‎2006 Aug 23 4:42 PM
Hello Uwe:
Currently we are on 6.20. But an upgrade is very near and I should expect these Classes to be handy then. I will explore them individually and post back. However, regarding my issue: the XML code generated by program is something like:
<?xml version="1.0" encoding="iso-8859-1"?>#<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"><asx:values><SOURCE>42</SOURCE>
<?xml version="1.0" encoding="iso-8859-1"?>#<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"><asx:values><SOURCE>42</SOURCE>.......
My need here is to replace the - encoding="iso-8859-1" with "UTF-8". So if you suggest proper methods to do so then it will be a good step for me.
Thanks for the relevant information anyways.
Have a nice day!
‎2006 Aug 23 8:22 PM
Hello Vivek
The classes I mentioned are available on 6.20, too.
When I do XML transformations on our 6.40 unicode system the encoding is utf-8.
To replace the "ISO-..." with "utf-8" is a simple task. However, I do not know if it is necessary to convert the byte stream of the XML string as well. But you could easily find out.
Regards
Uwe