cancel
Showing results for 
Search instead for 
Did you mean: 

Transformation encoding ABAP <-> XML

Former Member
0 Kudos

Dear all!

We're transforming an ABAP-Structure via "Call transformation id" into XML on a non-unicode system. Then the file is given to a unicode system and there we're trying to "unpack" the XML again with "Call transformation id". Now there occurs an error because of the encoding. The XML string inlcudes the encoding = iso-8859-1.

How can I deserialize the XML on an unicode system? How can the "encoding" be manipulated (please do not offer tips to parse the string and to replace the characters... )? What encoding should be used?

Thanks and kind regards,

Klaus

Accepted Solutions (1)

Accepted Solutions (1)

former_member181962
Active Contributor
0 Kudos

Hi Claus,

Check the following piece of documentation:

"Addition 3

... OPTIONS a1 = e1 a2 = e2 ...

Effect

You can use this addition to specify the values e1, e2 ... for addtional control options a1, a2 ... of the transformation. The values e1, e2 ... must be of the type c or string.

For a1, a2 ..., you can specify the following values:

XML_HEADER to control the output of the XML headers in case of a transformation to XML and the storage in a data object of the type c, string or in an internal table.

Possible values Meaning

no: No output of an XML header

without_encoding: Output of an XML header without specification of encodings

full: Default setting, output of an XML header with specification of encodings "

Regards,

Ravi

Answers (2)

Answers (2)

Former Member
0 Kudos

Hey Guys!

You're great!! Fast, competent -> successful!

Thanks and kind regards,

Klaus

BTW: I've looked at the source system for the key word documentation of "Call transformation" (SAP R/3 Enterprise 6.20). This documentation doesn't tell anything about the option "OPTIONS"! But wrote a short test programm -> it works also in this release....

athavanraja
Active Contributor
0 Kudos

Glad you found us helpful and thanks for sharing the info on WAS6.20

Regards

Raja

athavanraja
Active Contributor
0 Kudos

option one.

with call transformation you can pass an option "without_encoding" which will not produce the encoding attribute in the xml file.

option two .

use method SET_ENCODING of CL_XML_DOCUMENT to set the desired encoding.

Regards

Raja

athavanraja
Active Contributor
0 Kudos

alternatively, if you are using custom XSLT program you can add the following line of code in your XSLT program to generated desired encoding.

<xsl:output encoding="utf-8" indent="yes" method="xml"/>

Regards

Raja