<?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: CALL TRANSFORMATION - XSLT encoding not settable? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transformation-xslt-encoding-not-settable/m-p/6574538#M1433365</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt; Just to make sure, you are on a unicode system?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just asked one of our admins, apparently unicode is disabled here (WebAS 7.0) - so that's why I can't create UTF encoded XML files?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Strangely enough creating UTF-XMLs using the iXML interface is not a problem at all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Feb 2010 09:35:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-02-11T09:35:18Z</dc:date>
    <item>
      <title>CALL TRANSFORMATION - XSLT encoding not settable?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transformation-xslt-encoding-not-settable/m-p/6574534#M1433361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello fellow ABAPer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem creating an XML file from an simple itab, using XSLT transformation (CALL TRANSFORMATION).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's what I'm doing: I have a simple itab &lt;EM&gt;it_person&lt;/EM&gt; type &lt;EM&gt;tt_person&lt;/EM&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
TYPES: BEGIN OF tt_person,
  id(4) TYPE n,
  firstname(20) TYPE c,
  lastname(20)  TYPE c,
END OF tt_person.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm filling &lt;EM&gt;it_person&lt;/EM&gt; with test-data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
gs_person-id   = '1'.
gs_person-firstname = 'John'.
gs_person-lastname  = 'Smith'.
APPEND wa_person TO it_person.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I'm getting the reference of my itab for the CALL TRANSFORMATION command and I'm finally doing the actual transformation like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL TRANSFORMATION z_test_transformation
    SOURCE (it_source_tab)
    RESULT XML it_xml.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Transformation (XSLT Program) looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://uploading.com/files/775c1d31/trans.txt/" target="test_blank"&gt;http://uploading.com/files/775c1d31/trans.txt/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(sorry, I tried to post the transformation's code here, but that's not working, it screws the whole formating of this posting, that's why I had to upload it)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I'm gui_downloading the XML file it looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;?xml version="1.0" encoding="iso-8859-1"?&amp;gt;
&amp;lt;CUSTOMERS&amp;gt;
  &amp;lt;item&amp;gt;
    &amp;lt;id&amp;gt;1&amp;lt;/id&amp;gt;
    &amp;lt;first_name&amp;gt;John&amp;lt;/first_name&amp;gt;
    &amp;lt;last_name&amp;gt;Smith&amp;lt;/last_name&amp;gt;
  &amp;lt;/item&amp;gt;
&amp;lt;/CUSTOMERS&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So everything is fine, until now: I need a different encoding, the other system's parser is not able to read ISO-8859-1 encoded files. So I need the first line of my XML to look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... and this is where I'm stuck right now, I can't get that to work.&lt;/P&gt;&lt;P&gt;I can change the line in my transformation to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;xsl:output encoding="uft-8" indent="yes" method="xml" version="1.0" standalone="no"/&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the resulting XML file is still ISO-8859-1. The "standalone" tag, that I need as well, doesn't work either.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what am I doing wrong? Is it not possible to create other XMLs than ISO-8859-1 with the XSLT-Transformation?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks alot, any help would be highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 13:03:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-transformation-xslt-encoding-not-settable/m-p/6574534#M1433361</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-10T13:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: CALL TRANSFORMATION - XSLT encoding not settable?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transformation-xslt-encoding-not-settable/m-p/6574535#M1433362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess it_xml is an internal table cotaining chars?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'm using &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;xxml                    TYPE xstring,&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL TRANSFORMATION z_abap_to_xml_root
      PARAMETERS mestyp = c_mestyp nsuri = c_namespace
      SOURCE filename = fname table = it_out
      RESULT XML xxml.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and i'm getting the xml encoding like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Directly after your transformation insert the following call if your report can run interactively:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'DISPLAY_XML_STRING'
      EXPORTING
        xml_string            = xxml
*         TITLE                 =
*         STARTING_X            = 5
*         STARTING_Y            = 5
      EXCEPTIONS
        no_xml_document       = 1
        OTHERS                = 2.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This displays the XML so you can check the encoding to be sure that the data is not tempered elsewhere.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Downloading the XML String even if its xstring should be no problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 13:39:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-transformation-xslt-encoding-not-settable/m-p/6574535#M1433362</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2010-02-10T13:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: CALL TRANSFORMATION - XSLT encoding not settable?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transformation-xslt-encoding-not-settable/m-p/6574536#M1433363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rainer, thanks for taking time to reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess it_xml is an internal table cotaining chars?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, it's defined as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA it_xml TYPE STANDARD TABLE OF char2048.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried what you said:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA xxml TYPE xstring.

CALL TRANSFORMATION z_test_transformation
    SOURCE (it_source_tab)
    RESULT XML xxml.

CALL FUNCTION 'DISPLAY_XML_STRING'
      EXPORTING
        xml_string            = xxml
      EXCEPTIONS
        no_xml_document       = 1
        OTHERS                = 2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately it's still ISO...&lt;/P&gt;&lt;P&gt;I don't think it has something to do with the data-declaration of it_xml, maybe something's wrong with the XSLT or the CALL TRANSFORMATION command? I don't know ... but even if that would have worked, I still have to get:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
standalone="no"
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;into that XML.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another idea? Thanks ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 13:56:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-transformation-xslt-encoding-not-settable/m-p/6574536#M1433363</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-10T13:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: CALL TRANSFORMATION - XSLT encoding not settable?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transformation-xslt-encoding-not-settable/m-p/6574537#M1433364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I never tried an internal table as result, but i noticed that changing xstring to string will change the encoding from UTF-8 to UTF-16, so thats why i suggested this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to make sure, you are on a unicode system?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Feb 2010 14:20:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-transformation-xslt-encoding-not-settable/m-p/6574537#M1433364</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2010-02-10T14:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: CALL TRANSFORMATION - XSLT encoding not settable?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/call-transformation-xslt-encoding-not-settable/m-p/6574538#M1433365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt; Just to make sure, you are on a unicode system?&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just asked one of our admins, apparently unicode is disabled here (WebAS 7.0) - so that's why I can't create UTF encoded XML files?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Strangely enough creating UTF-XMLs using the iXML interface is not a problem at all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2010 09:35:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/call-transformation-xslt-encoding-not-settable/m-p/6574538#M1433365</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-02-11T09:35:18Z</dc:date>
    </item>
  </channel>
</rss>

