<?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: Simple transformation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990964#M74201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this will help you.......  In the ABAP code, it is setting the value UTF-8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="462874"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Sep 2005 14:48:50 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2005-09-06T14:48:50Z</dc:date>
    <item>
      <title>Simple transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990963#M74200</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;When I use a simple transformation (with CALL TRANSFORMATION) to create xml-string from ABAP structure I get an xml-string which starts with &amp;lt;?xml version="1.0" encoding="utf-16"?&amp;gt;.&lt;/P&gt;&lt;P&gt;I wonder if it is possible to get the encoding in UTF-8?&lt;/P&gt;&lt;P&gt;The result of the transformation is saved in a table with string type variable.&lt;/P&gt;&lt;P&gt;Do I have to add something to my transformation source?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fred.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2005 14:39:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990963#M74200</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-06T14:39:49Z</dc:date>
    </item>
    <item>
      <title>Re: Simple transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990964#M74201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe this will help you.......  In the ABAP code, it is setting the value UTF-8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="462874"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2005 14:48:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990964#M74201</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-09-06T14:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Simple transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990965#M74202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think the sample provided will work in this case.  He is setting the HTTP Response to UTF-8, but not generating the XML itself that way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to generate XML thorugh a transforamtion in UTF-8 you have to set the encoding on the output stream factory.  I assume you are getting UTF-16 by default because you have a Unicode system.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;constants:
* encoding for download of XML files
    encoding     type string value 'UTF-8'.

  data: resstream type ref to if_ixml_ostream,
         ressize type i value 0.

****Create an instance of the Ixml Processor
  g_ixml = cl_ixml=&amp;gt;create( ).

****Create the Stream Factory
  g_stream_factory = g_ixml-&amp;gt;create_stream_factory( ).

****Create an Endcoding and Byte Order
  g_encoding = g_ixml-&amp;gt;create_encoding( character_set = encoding
    byte_order = 0 ).

****Create the output stream with a pointer to our binary string
  resstream =
      g_stream_factory-&amp;gt;create_ostream_xstring( r_xstring ).

****Set the Encoding into a stream
  resstream-&amp;gt;set_encoding( encoding = g_encoding ).

****Call Transformation using the simple XSLT id_indent
  call transformation id_indent
    source     itab = &amp;lt;tab&amp;gt;
    result xml resstream.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2005 14:56:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990965#M74202</guid>
      <dc:creator>thomas_jung</dc:creator>
      <dc:date>2005-09-06T14:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Simple transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990966#M74203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, I use the CALL TRANSFORMATION a little difference with yours, but it can achieve your target.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:  g_ixml type ref to if_ixml.
data:  g_stream_factory type ref to IF_IXML_STREAM_FACTORY.
data:  resstream type ref to if_ixml_ostream.
data:  g_encoding type ref to if_ixml_encoding.

  g_ixml = cl_ixml=&amp;gt;create( ).
  g_stream_factory = g_ixml-&amp;gt;CREATE_STREAM_FACTORY( ).
  g_encoding = g_ixml-&amp;gt;create_encoding( character_set = 'utf-8'
    byte_order = 0 ).

  resstream = g_stream_factory-&amp;gt;CREATE_OSTREAM_ITABLE( table = restab ).
  call method resstream-&amp;gt;set_encoding
    exporting encoding = g_encoding.

  call transformation XXXX
    source  itab  =  XXXX
    result xml resstream.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Sep 2005 15:06:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990966#M74203</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-06T15:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Simple transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990967#M74204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the answers, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now need to write the resstream to an xml-file on an external file server how do I use the resstream in your examples in &lt;/P&gt;&lt;P&gt;(for example) fm 'GUI_DOWNLOAD'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2005 09:51:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990967#M74204</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-07T09:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Simple transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990968#M74205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the answers, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but how do I use the resstream in your examples in for example fm 'GUI_DOWNLOAD' to write the resstream to an xml-file on an external file server&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2005 09:51:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990968#M74205</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-07T09:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Simple transformation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990969#M74206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Choose the format of the RESSTEAM object that you want.  You could go to the Binary String and then convert that Binary String to a Internal Table of Bytes (using function module SCMS_XSTRING_TO_BINARY) or perhaps try the CREATE_OSTREAM_ITABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either way you end up with an internal table of bytes that can be downloaded using the GUI_DOWNLOAD or CL_GUI_FRONTEND_SERVICES.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Sep 2005 10:02:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/simple-transformation/m-p/990969#M74206</guid>
      <dc:creator>thomas_jung</dc:creator>
      <dc:date>2005-09-07T10:02:21Z</dc:date>
    </item>
  </channel>
</rss>

