<?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: ABAP to XML using XSLT problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-to-xml-using-xslt-problem/m-p/2562318#M584423</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for not being clear.  The first part of the program transform XML to ABAP internal table using my own XSLT which works fine.  The problematic part is the second part where I use CALL TRANSFORMATION ID_INDENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Jamie.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Aug 2007 20:15:27 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-01T20:15:27Z</dc:date>
    <item>
      <title>ABAP to XML using XSLT problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-to-xml-using-xslt-problem/m-p/2562316#M584421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to write a program to transform ABAP internal table to XML using XSLT.  I found some code example on SXSLTDEMO_FLIGHTS report and have tried that.  My problem is every time the transformation occurs, I always get 0 byte (ie, none was return) as XML output.  Below is my code, can you please see what's wrong with it?  Any input is appreciated!!  I just use ID_INDENT as my XSLT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT z_xml_to_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_file LIKE rlgrap-filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONSTANTS:  encoding     type string value 'utf-8',&lt;/P&gt;&lt;P&gt;            line_length TYPE i VALUE 4096.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: line_t(line_length) TYPE x,&lt;/P&gt;&lt;P&gt;       table_t TYPE STANDARD TABLE OF line_t.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: src_tab TYPE table_t,&lt;/P&gt;&lt;P&gt;      xmlstr TYPE string,&lt;/P&gt;&lt;P&gt;      resstream TYPE REF TO if_ixml_ostream,&lt;/P&gt;&lt;P&gt;      g_encoding type ref to if_ixml_encoding,&lt;/P&gt;&lt;P&gt;      g_ixml type ref to if_ixml,&lt;/P&gt;&lt;P&gt;      g_stream_factory type ref to if_ixml_stream_factory,&lt;/P&gt;&lt;P&gt;      restab type table_t,&lt;/P&gt;&lt;P&gt;      ressize type i value 0,&lt;/P&gt;&lt;P&gt;      r_xstring type xstring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF wa_sitelist,&lt;/P&gt;&lt;P&gt;  siteid(5) TYPE c,&lt;/P&gt;&lt;P&gt;  valid(1) TYPE c,&lt;/P&gt;&lt;P&gt;END OF wa_sitelist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: site_list type standard TABLE OF wa_sitelist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: xml_str TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  g_ixml = cl_ixml=&amp;gt;create( ).&lt;/P&gt;&lt;P&gt;  g_stream_factory = g_ixml-&amp;gt;create_stream_factory( ).&lt;/P&gt;&lt;P&gt;  g_encoding = g_ixml-&amp;gt;create_encoding( character_set = encoding&lt;/P&gt;&lt;P&gt;    byte_order = 0 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    filename = 'c:\temp\sites.xml'&lt;/P&gt;&lt;P&gt;    filetype = 'BIN'&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    data_tab = src_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSFORMATION zjc_test&lt;/P&gt;&lt;P&gt;SOURCE XML src_tab&lt;/P&gt;&lt;P&gt;RESULT site_list = site_list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH restab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  resstream =&lt;/P&gt;&lt;P&gt;    g_stream_factory-&amp;gt;create_ostream_itable( table = restab ).&lt;/P&gt;&lt;P&gt;  resstream-&amp;gt;set_encoding( encoding = g_encoding ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSFORMATION ID_INDENT&lt;/P&gt;&lt;P&gt;  SOURCE site_list = site_list&lt;/P&gt;&lt;P&gt;  RESULT XML = resstream.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ressize = resstream-&amp;gt;get_num_written_raw( ).&lt;/P&gt;&lt;P&gt;      perform store_file  using ressize restab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BREAK-POINT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form store_file&lt;/P&gt;&lt;P&gt;  using&lt;/P&gt;&lt;P&gt;        bin_filesize type i&lt;/P&gt;&lt;P&gt;        tab type table.&lt;/P&gt;&lt;P&gt;  data: s type string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  s = 'c:\temp\outxml.xml'.&lt;/P&gt;&lt;P&gt;  if bin_filesize &amp;gt; 0.&lt;/P&gt;&lt;P&gt;    call function 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;      exporting  bin_filesize = bin_filesize&lt;/P&gt;&lt;P&gt;                 filename     = s&lt;/P&gt;&lt;P&gt;                 filetype     = 'BIN'&lt;/P&gt;&lt;P&gt;      tables     data_tab     = tab&lt;/P&gt;&lt;P&gt;      exceptions others       = 1.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    call function 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;      exporting  filename     = s&lt;/P&gt;&lt;P&gt;                 filetype     = 'ASC'&lt;/P&gt;&lt;P&gt;      tables     data_tab     = tab&lt;/P&gt;&lt;P&gt;      exceptions others       = 1.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 20:06:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-to-xml-using-xslt-problem/m-p/2562316#M584421</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T20:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP to XML using XSLT problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-to-xml-using-xslt-problem/m-p/2562317#M584422</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change file type BIN to ASC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'c:tempsites.xml'
filetype = 'ASC'
TABLES
data_tab = src_tab.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 20:12:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-to-xml-using-xslt-problem/m-p/2562317#M584422</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-08-01T20:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP to XML using XSLT problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-to-xml-using-xslt-problem/m-p/2562318#M584423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for not being clear.  The first part of the program transform XML to ABAP internal table using my own XSLT which works fine.  The problematic part is the second part where I use CALL TRANSFORMATION ID_INDENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Jamie.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 20:15:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-to-xml-using-xslt-problem/m-p/2562318#M584423</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T20:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP to XML using XSLT problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-to-xml-using-xslt-problem/m-p/2562319#M584424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this example program , May this one give you some help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
report  z_10                              .
type-pools: abap.

types: begin of t_xmldoc,
         doc(10) type c,
         date    like sy-datum,
         item(5) type c,
         totalprize type i,
       end of t_xmldoc.

types : begin of truxs_xml_line,
            data(256) type c,
        end of truxs_xml_line.

data: source_xml type table of truxs_xml_line.

data: xmldoc_itab   type standard table of t_xmldoc,
      wa_xmldoc     type t_xmldoc,
      result_xml    type abap_trans_resbind_tab,
      wa_result_xml type abap_trans_resbind.

call function 'GUI_UPLOAD'
  exporting
    filename = 'c:test.xml'
    filetype = 'ASC'
  tables
    data_tab = source_xml.

get reference of xmldoc_itab into wa_result_xml-value.
wa_result_xml-name = 'XMLDOC'.
append wa_result_xml to result_xml.

call transformation z_z10
source xml source_xml
result (result_xml).

loop at xmldoc_itab into wa_xmldoc.
  write: / sy-tabix, wa_xmldoc-doc, ' ', wa_xmldoc-date, ' ', wa_xmldoc-item, '  ', wa_xmldoc-totalprize.
endloop.

XLST &amp;lt;&amp;lt;&amp;lt;&amp;lt; program code

&amp;lt;xsl:transform version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&amp;gt;

&amp;lt;xsl:template match="/"&amp;gt;
  &amp;lt;xsl:copy&amp;gt;
    &amp;lt;xsl:apply-templates /&amp;gt;
  &amp;lt;/xsl:copy&amp;gt;
&amp;lt;/xsl:template&amp;gt;

&amp;lt;xsl:template match="xmldoc"&amp;gt;
  &amp;lt;item&amp;gt;
    &amp;lt;DOC&amp;gt;&amp;lt;xsl:value-of select="doc" /&amp;gt;&amp;lt;/DOC&amp;gt;
    &amp;lt;DATE&amp;gt;&amp;lt;xsl:value-of select="date" /&amp;gt;&amp;lt;/DATE&amp;gt;
    &amp;lt;ITEMS&amp;gt;&amp;lt;xsl:value-of select="items" /&amp;gt;&amp;lt;/ITEMS&amp;gt;
    &amp;lt;TOTALPRIZE&amp;gt;&amp;lt;xsl:value-of select="Totalprize" /&amp;gt;&amp;lt;/TOTALPRIZE&amp;gt;
  &amp;lt;/item&amp;gt;
&amp;lt;/xsl:template&amp;gt;

&amp;lt;/xsl:transform&amp;gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 20:16:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-to-xml-using-xslt-problem/m-p/2562319#M584424</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-08-01T20:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP to XML using XSLT problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-to-xml-using-xslt-problem/m-p/2562320#M584425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi aRs,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I looked and tried to executed the program but I got 'XML_FORMAT_ERROR' dump.  I am also confused with the code.  Is this one transform from ABAP internal table to XML?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the XML file that I used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;xmldoc&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;doc&amp;gt;12345&amp;lt;/doc&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;date&amp;gt;08082007&amp;lt;/date&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;item&amp;gt;abcd&amp;lt;/item&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;totalprize&amp;gt;15&amp;lt;/totalprize&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/xmldoc&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advise,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Jamie.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2007 20:47:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-to-xml-using-xslt-problem/m-p/2562320#M584425</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-01T20:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP to XML using XSLT problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-to-xml-using-xslt-problem/m-p/2562321#M584426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check these threads&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://searchsap.techtarget.com/generic/0,295582,sid21_gci1207657,00.html" target="test_blank"&gt;http://searchsap.techtarget.com/generic/0,295582,sid21_gci1207657,00.html&lt;/A&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="3408872"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2007 01:27:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-to-xml-using-xslt-problem/m-p/2562321#M584426</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2007-08-02T01:27:54Z</dc:date>
    </item>
  </channel>
</rss>

