<?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: ALV to XML format in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-to-xml-format/m-p/7561236#M1564376</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howdy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To determine what changes to the variant have been made, you need to get the frontend fieldcatalog of the ALV so that you know which fields are hidden etc (method CL_GUI_ALV_GRID-&amp;gt;GET_FRONTEND_FIELDCATALOG).  You then also have to check which entries have been filtered out (method CL_GUI_ALV_GRID-&amp;gt;GET_FILTERED_ENTRIES).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have the field catalog you will have to do some dynamic programming to build your XML, particularly to skip over the columns that are hidden.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps to get you started.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Jan 2011 04:43:34 GMT</pubDate>
    <dc:creator>alex_cook</dc:creator>
    <dc:date>2011-01-04T04:43:34Z</dc:date>
    <item>
      <title>ALV to XML format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-to-xml-format/m-p/7561235#M1564375</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;My requirement is to download the ALV output into XML based on the variant.&lt;/P&gt;&lt;P&gt;For example: If my ALV displays 3 fields in the output,only those field's information should be displayed in the downloaded XML file.&lt;/P&gt;&lt;P&gt;Your suggestions would be really valuable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 04:38:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-to-xml-format/m-p/7561235#M1564375</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-04T04:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: ALV to XML format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-to-xml-format/m-p/7561236#M1564376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Howdy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To determine what changes to the variant have been made, you need to get the frontend fieldcatalog of the ALV so that you know which fields are hidden etc (method CL_GUI_ALV_GRID-&amp;gt;GET_FRONTEND_FIELDCATALOG).  You then also have to check which entries have been filtered out (method CL_GUI_ALV_GRID-&amp;gt;GET_FILTERED_ENTRIES).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you have the field catalog you will have to do some dynamic programming to build your XML, particularly to skip over the columns that are hidden.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps to get you started.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 04:43:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-to-xml-format/m-p/7561236#M1564376</guid>
      <dc:creator>alex_cook</dc:creator>
      <dc:date>2011-01-04T04:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: ALV to XML format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-to-xml-format/m-p/7561237#M1564377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What kind of dynamic programming? Could you please give me an example?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 05:59:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-to-xml-format/m-p/7561237#M1564377</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-01-04T05:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: ALV to XML format</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alv-to-xml-format/m-p/7561238#M1564378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For example say your ALV output table is gt_output, and the frontend field catalog is gt_fcat:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

FIELD-SYMBOLS: &amp;lt;field&amp;gt; type any.

loop at gt_output assigning &amp;lt;output&amp;gt;.

  loop at gt_fcat assigning &amp;lt;fcat&amp;gt; where tech eq abap_false and no_out eq abap_false. "Ignore hidden entries
      assign component &amp;lt;fcat&amp;gt;-fieldname of structure &amp;lt;output&amp;gt; to &amp;lt;field&amp;gt;.
      "Now write the field to your XML structure.
  endloop.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively you can build the output into an internal table with a key-value pair eg FIELDNAME and VALUE and then use a Simple transformation to convert to XML - personally this might be a better way to go if you know transformations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alex Cook on Jan 4, 2011 4:51 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tidied up code - XML write isn't working&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jan 2011 06:20:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alv-to-xml-format/m-p/7561238#M1564378</guid>
      <dc:creator>alex_cook</dc:creator>
      <dc:date>2011-01-04T06:20:48Z</dc:date>
    </item>
  </channel>
</rss>

