<?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: Dynamic ALV construct with dynamic table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-alv-construct-with-dynamic-table/m-p/5348622#M1231697</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry, I accidentally pressed publish, my full post below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Marcin.Podkowinski on Mar 12, 2009 4:46 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Mar 2009 15:37:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-12T15:37:46Z</dc:date>
    <item>
      <title>Dynamic ALV construct with dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-alv-construct-with-dynamic-table/m-p/5348621#M1231696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to display a dynamic alv with the result of a first alv grid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I explain with an exemple :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my first alv contains these rows :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pers. nbr. / data1 /... / Wage Type / ... / amount /&lt;/STRONG&gt;  - &amp;gt; (fieldcat header)&lt;/P&gt;&lt;P&gt;01........... /........../..../  101            /      / 1u20AC        /&lt;/P&gt;&lt;P&gt;01........... /........../..../  560            /      / 2u20AC        /&lt;/P&gt;&lt;P&gt;01........... /........../..../  1000          /      / 3u20AC        /&lt;/P&gt;&lt;P&gt;01........... /........../..../  1001          /      / 4u20AC        /&lt;/P&gt;&lt;P&gt;02........... /........../..../  101            /      / 5u20AC        /&lt;/P&gt;&lt;P&gt;02........... /........../..../  560            /      / 6u20AC        /&lt;/P&gt;&lt;P&gt;02........... /........../..../  1000          /      / 7u20AC        /&lt;/P&gt;&lt;P&gt;02........... /........../..../  1001          /      / 8u20AC        /&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An i want this result : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pers. nbr. / data1 / data2 / ... /101 /560/1000/1001&lt;/STRONG&gt;  - &amp;gt; (fieldcat header)&lt;/P&gt;&lt;P&gt;01            /          /          /     / 1u20AC  / 2u20AC /3u20AC   / 4u20AC&lt;/P&gt;&lt;P&gt;02            /          /          /     / 5u20AC  / 6u20AC /7u20AC   / 8u20AC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for the moment with help of fields symbols and "cl_alv_table_create=&amp;gt;create_dynamic_table" fonction, i've got only this result :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pers. nbr. / data1 / data2 / ... /101 /560/1000/1001&lt;/STRONG&gt;  - &amp;gt; (fieldcat header)&lt;/P&gt;&lt;P&gt;01            /          /          /     /    ? /  ?  / ?   / ? &lt;/P&gt;&lt;P&gt;02            /          /          /     /   ?  / ?   / ?   / ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i don't know how to put the corresponding values on the correponding column because my table is dynamic and i don't know the fiels number or name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is my code :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
* creation of dynamic internal table
  ASSIGN lt_data TO &amp;lt;fs_data&amp;gt;.
  CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
    EXPORTING
      it_fieldcatalog           = lv_fieldcat3
    IMPORTING
      ep_table                  = &amp;lt;fs_data&amp;gt;
    EXCEPTIONS
      generate_subpool_dir_full = 1
      OTHERS                    = 2.
  IF sy-subrc &amp;lt;&amp;gt; 0.
  ENDIF.

* So  now points to our dynamic internal table.
  ASSIGN &amp;lt;fs_data&amp;gt;-&amp;gt;* TO &amp;lt;fs_1&amp;gt;.
* Next step is to create a work area for our dynamic internal table.
  CREATE DATA new_line LIKE LINE OF &amp;lt;fs_1&amp;gt;.
* A field-symbol to access that work area
  ASSIGN new_line-&amp;gt;*  TO &amp;lt;fs_2&amp;gt;.


 LOOP AT lt_datatable +(my first table)+ ASSIGNING &amp;lt;ls_data4&amp;gt;.
    ASSIGN COMPONENT column
    OF STRUCTURE &amp;lt;ls_data4&amp;gt; TO &amp;lt;fs_2&amp;gt;+[where ????]+.
    AT NEW pernr.
      MOVE-CORRESPONDING &amp;lt;ls_data4&amp;gt; TO &amp;lt;fs_2&amp;gt;.
      APPEND &amp;lt;fs_2&amp;gt; TO &amp;lt;fs_1&amp;gt;.
    ENDAT.
 ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope i'm understanding with my poor english !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ronando on Mar 12, 2009 4:06 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ronando on Mar 12, 2009 4:30 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2009 15:05:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-alv-construct-with-dynamic-table/m-p/5348621#M1231696</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-12T15:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic ALV construct with dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-alv-construct-with-dynamic-table/m-p/5348622#M1231697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry, I accidentally pressed publish, my full post below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Marcin.Podkowinski on Mar 12, 2009 4:46 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2009 15:37:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-alv-construct-with-dynamic-table/m-p/5348622#M1231697</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-12T15:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic ALV construct with dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-alv-construct-with-dynamic-table/m-p/5348623#M1231698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this link :http://help-abap.blogspot.com/2008/09/dynamic-internal-table-creation.html&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kuntal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2009 15:45:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-alv-construct-with-dynamic-table/m-p/5348623#M1231698</guid>
      <dc:creator>former_member376453</dc:creator>
      <dc:date>2009-03-12T15:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic ALV construct with dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-alv-construct-with-dynamic-table/m-p/5348624#M1231699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't know the names of your columns? hmm you do, because before you created dynamic table you had to create field catalog, so the structure and column names of newly (dynamically) created table will be the same like defined in the field catalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The last loop also does not look good, in my opinion should be something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT lt_datatable +(my first table)+ ASSIGNING &amp;lt;ls_data4&amp;gt;.
    AT NEW pernr.
      APPEND initial line to &amp;lt;fs_1&amp;gt; assigning &amp;lt;fs_2&amp;gt;.
      &amp;lt;fs_2&amp;gt;-pernr = &amp;lt;ls_data4&amp;gt;-pernr.
      ....
    ENDAT.
    ASSIGN COMPONENT &amp;lt;ls_data4&amp;gt;-wage_type OF STRUCTURE &amp;lt;fs_2&amp;gt; TO &amp;lt;fs_5&amp;gt;.
    &amp;lt;fs_5&amp;gt; = &amp;lt;ls_data4&amp;gt;-amount.
 ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also keep in mind that number of calls of method cl_alv_table_create=&amp;gt;create_dynamic_table is limited to 36 (?) calls within one program session because it uses dynamic subroutine pool behind so you will have short dump if you will execute that 37 times.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2009 15:45:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-alv-construct-with-dynamic-table/m-p/5348624#M1231699</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-12T15:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic ALV construct with dynamic table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-alv-construct-with-dynamic-table/m-p/5348625#M1231700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank your for reactivity,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OK Now it's work !!! &lt;/P&gt;&lt;P&gt;i don't really understand why &amp;lt;fs5&amp;gt; it's needed but it's OK.&lt;/P&gt;&lt;P&gt;Here is the final code :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT lt_datatable ASSIGNING &amp;lt;ls_data4&amp;gt;.
     AT NEW pernr.
      APPEND INITIAL LINE TO &amp;lt;fs_1&amp;gt; ASSIGNING &amp;lt;fs_2&amp;gt;.
      MOVE-CORRESPONDING &amp;lt;ls_data4&amp;gt; TO &amp;lt;fs_2&amp;gt;.
    ENDAT.
    REPLACE '/' WITH '' INTO &amp;lt;ls_data4&amp;gt;-LGART.
    ASSIGN COMPONENT &amp;lt;ls_data4&amp;gt;-LGART OF STRUCTURE &amp;lt;fs_2&amp;gt; TO &amp;lt;fs_5&amp;gt;.
    &amp;lt;fs_5&amp;gt; = &amp;lt;ls_data4&amp;gt;-BETRG.
 ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks you very much !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: ronando on Mar 12, 2009 6:23 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2009 16:18:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-alv-construct-with-dynamic-table/m-p/5348625#M1231700</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-12T16:18:38Z</dc:date>
    </item>
  </channel>
</rss>

