<?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 Internal table data download to XML format in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-data-download-to-xml-format/m-p/8214531#M1627665</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have devloped one OOPS ALV report in that our requirement is on "SAVE" button the data of the report has to be downloaded in given XML format.Please check the format provided in Finnish language.The word "Value" specified as value which are coming in the ALV report against fields mentioned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1" ?&amp;gt; &lt;/P&gt;&lt;P&gt; &amp;lt;!u2014Aromi list --&amp;gt; &lt;/P&gt;&lt;P&gt; &amp;lt;!-- Copyright --&amp;gt; &lt;/P&gt;&lt;P&gt; &amp;lt;!-- Edited with Visual Basic 6 --&amp;gt; &lt;/P&gt;&lt;P&gt; &amp;lt;!-- Versio 1.0 --&amp;gt; &lt;/P&gt;&lt;P&gt;    &amp;lt;Tiedot Lahettaja="Value" Yhteyshlo=" Value"     &lt;/P&gt;&lt;P&gt;                Yhteystieto=" Value " Asiakasnumero=""&amp;gt;&lt;/P&gt;&lt;P&gt;       &amp;lt;Raaka-aine Nimi="" Ryhma=" Value "&amp;gt;&lt;/P&gt;&lt;P&gt;          &amp;lt;Tuotemerkki Nimi=" Value " Ean=" Value " &lt;/P&gt;&lt;P&gt;                              Ykspakkauskoko="1" Ykspakkaustyyppi="KPL" almistaja="Value"&amp;gt;&lt;/P&gt;&lt;P&gt;             &amp;lt;Toimittajatiedot Tuotekoodi="10" Sopimustuote="Y" Myyntierakoko="5" &lt;/P&gt;&lt;P&gt;                                Myyntieratyyppi="ME" Myyntierahinta="3,035" Hintapvm="value" &lt;/P&gt;&lt;P&gt;              /&amp;gt; &lt;/P&gt;&lt;P&gt;      &amp;lt;/Tuotemerkki&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;/Raaka-aine&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/Tiedot&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anybody help how to download the report data into above format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Oct 2011 14:48:18 GMT</pubDate>
    <dc:creator>sachin_jadhav8</dc:creator>
    <dc:date>2011-10-24T14:48:18Z</dc:date>
    <item>
      <title>Internal table data download to XML format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-data-download-to-xml-format/m-p/8214531#M1627665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have devloped one OOPS ALV report in that our requirement is on "SAVE" button the data of the report has to be downloaded in given XML format.Please check the format provided in Finnish language.The word "Value" specified as value which are coming in the ALV report against fields mentioned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1" ?&amp;gt; &lt;/P&gt;&lt;P&gt; &amp;lt;!u2014Aromi list --&amp;gt; &lt;/P&gt;&lt;P&gt; &amp;lt;!-- Copyright --&amp;gt; &lt;/P&gt;&lt;P&gt; &amp;lt;!-- Edited with Visual Basic 6 --&amp;gt; &lt;/P&gt;&lt;P&gt; &amp;lt;!-- Versio 1.0 --&amp;gt; &lt;/P&gt;&lt;P&gt;    &amp;lt;Tiedot Lahettaja="Value" Yhteyshlo=" Value"     &lt;/P&gt;&lt;P&gt;                Yhteystieto=" Value " Asiakasnumero=""&amp;gt;&lt;/P&gt;&lt;P&gt;       &amp;lt;Raaka-aine Nimi="" Ryhma=" Value "&amp;gt;&lt;/P&gt;&lt;P&gt;          &amp;lt;Tuotemerkki Nimi=" Value " Ean=" Value " &lt;/P&gt;&lt;P&gt;                              Ykspakkauskoko="1" Ykspakkaustyyppi="KPL" almistaja="Value"&amp;gt;&lt;/P&gt;&lt;P&gt;             &amp;lt;Toimittajatiedot Tuotekoodi="10" Sopimustuote="Y" Myyntierakoko="5" &lt;/P&gt;&lt;P&gt;                                Myyntieratyyppi="ME" Myyntierahinta="3,035" Hintapvm="value" &lt;/P&gt;&lt;P&gt;              /&amp;gt; &lt;/P&gt;&lt;P&gt;      &amp;lt;/Tuotemerkki&amp;gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;/Raaka-aine&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/Tiedot&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anybody help how to download the report data into above format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 14:48:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-data-download-to-xml-format/m-p/8214531#M1627665</guid>
      <dc:creator>sachin_jadhav8</dc:creator>
      <dc:date>2011-10-24T14:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table data download to XML format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-data-download-to-xml-format/m-p/8214532#M1627666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sachin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use any of the following approach to convert internal table data to XML.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Using FM - SAP_CONVERT_TO_XML_FORMAT&lt;/P&gt;&lt;P&gt;2. Using FM's - SDIXML_DATA_TO_DOM &amp;amp; SDIXML_DOM_TO_XML.&lt;/P&gt;&lt;P&gt;3. Using Interface - if_ixml_stream_factory~create_istream_itable.&lt;/P&gt;&lt;P&gt;4. Using Class - CL_XML_DOCUMENT&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA : ITAB TYPE TABLE OF SPFLI,
         L_XML TYPE REF TO CL_XML_DOCUMENT.
 
  SELECT * FROM SPFLI INTO TABLE ITAB.
 
* CREATE THE XML OBJECT
  CREATE OBJECT L_XML.
 
* CONVERT THE DATA TO XML
  CALL METHOD L_XML-&amp;gt;CREATE_WITH_DATA( DATAOBJECT = ITAB[] ).
 
* DATA IS CONVERTED TO XML; DISPLAY THE XML-DOCUMENT
  CALL METHOD L_XML-&amp;gt;DISPLAY.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;5. Using XSLT Transformation  - CALL TRANSFORMATION &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Few links that might help you as well -&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b2dcbdfc-0801-0010-97bd-b3f39420759c?quicklink=index&amp;amp;overridelayout=true]&lt;/P&gt;&lt;P&gt; [http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2657] &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;;&lt;/P&gt;&lt;P&gt; [http://erpgenie.com/abaptips/content/view/31/61/]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Oct 2011 19:03:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-data-download-to-xml-format/m-p/8214532#M1627666</guid>
      <dc:creator>rakeshjain</dc:creator>
      <dc:date>2011-10-24T19:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table data download to XML format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-data-download-to-xml-format/m-p/8214533#M1627667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sachin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see the sample XML has field values embedded as XML element attributes.ie &lt;U&gt;&amp;lt;Raaka-aine Ryhma=" Value "&amp;gt;&lt;/U&gt;. For such specific requirements:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Loop through the table and Use iXML library functions to build the complete XML, element by element. Help - &lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/86/8280ba12d511d5991b00508b6b8b11/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/86/8280ba12d511d5991b00508b6b8b11/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2. You can create an XSLT Transformation that match the specific XML format,  and use CALL TRANSFORMATION to convert internal table to that specific XML format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Few Standard Function modules and class CL_XML_DOCUMENT may help for generic SAP XML conversions, where XML element names will be same as internal table field names. Not, sure if these can be used to generate specific XML formats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Varun&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Varun VS on Oct 25, 2011 7:48 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Oct 2011 05:47:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-data-download-to-xml-format/m-p/8214533#M1627667</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-10-25T05:47:01Z</dc:date>
    </item>
  </channel>
</rss>

