<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: XML transformation encoding in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/xml-transformation-encoding/m-p/3775151#M908353</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the solution and want to share with all:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when you use CALL TRANSACTION statement, the XML string is encoded in UTF-16 or UTF-8 dependig by the type of the string itself. I mean:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) this will be UTF-16:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data return_string type STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call transformation my_transform&lt;/P&gt;&lt;P&gt;source ......&lt;/P&gt;&lt;P&gt;result xml return_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) this will be UTF-8:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data return_string type XSTRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call transformation my_transform&lt;/P&gt;&lt;P&gt;source ......&lt;/P&gt;&lt;P&gt;result xml return_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help sameone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 May 2008 08:16:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-07T08:16:49Z</dc:date>
    <item>
      <title>XML transformation encoding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xml-transformation-encoding/m-p/3775150#M908352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using a SIMPLE TRANSFORMATION to generate an XML file that is sent to a legacy system. After the CALL TRANSFORMATION statement, I get the XML string, but it starts with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="utf-16"?&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My legacy system can read only UTF-8, so I need to change the encoding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points wait for the solver&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL TRANSFORMATION zpp_transm_eol_f1a&lt;/P&gt;&lt;P&gt;      SOURCE cin = ls_zf1a-vehicle_id_numb&lt;/P&gt;&lt;P&gt;      RESULT XML gs_f1a_file_xml.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and this is the transformation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;?sap.transform simple?&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;tt:transform xmlns:tt="http://www.sap.com/transformation-templates"&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;tt:root name="CIN"/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;tt:template&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;Assemblies&amp;gt;&lt;/P&gt;&lt;P&gt;    &amp;lt;Assembly&amp;gt;&lt;/P&gt;&lt;P&gt;        &amp;lt;UniqueNumber&amp;gt;&lt;/P&gt;&lt;P&gt;            &amp;lt;tt:value ref="CIN"/&amp;gt;&lt;/P&gt;&lt;P&gt;        &amp;lt;/UniqueNumber&amp;gt;&lt;/P&gt;&lt;P&gt;    &amp;lt;/Assembly&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/Assemblies&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/tt:template&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/tt:transform&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2008 13:21:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xml-transformation-encoding/m-p/3775150#M908352</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-05T13:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: XML transformation encoding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xml-transformation-encoding/m-p/3775151#M908353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found the solution and want to share with all:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when you use CALL TRANSACTION statement, the XML string is encoded in UTF-16 or UTF-8 dependig by the type of the string itself. I mean:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) this will be UTF-16:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data return_string type STRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call transformation my_transform&lt;/P&gt;&lt;P&gt;source ......&lt;/P&gt;&lt;P&gt;result xml return_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) this will be UTF-8:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data return_string type XSTRING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call transformation my_transform&lt;/P&gt;&lt;P&gt;source ......&lt;/P&gt;&lt;P&gt;result xml return_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help sameone.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 May 2008 08:16:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xml-transformation-encoding/m-p/3775151#M908353</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-07T08:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: XML transformation encoding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xml-transformation-encoding/m-p/3775152#M908354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, your reply was really Helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2011 14:19:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xml-transformation-encoding/m-p/3775152#M908354</guid>
      <dc:creator>former_member38750</dc:creator>
      <dc:date>2011-12-22T14:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: XML transformation encoding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/xml-transformation-encoding/m-p/3775153#M908355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for sharing the solution, I actually had this problem before, in my case the middle ware supports UTF-16 so I left it as it is, but I never figured it out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2011 15:26:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/xml-transformation-encoding/m-p/3775153#M908355</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-22T15:26:52Z</dc:date>
    </item>
  </channel>
</rss>

