<?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: program with 2 dynamic i_tabs (cl_alv_table_create=&amp;gt;create_dynamic_table) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379802#M1544003</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nobody?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Oct 2010 11:43:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-10-19T11:43:15Z</dc:date>
    <item>
      <title>program with 2 dynamic i_tabs (cl_alv_table_create=&gt;create_dynamic_table)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379797#M1543998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Expers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a ABAP with dynamic internal table using cl_alv_table_create=&amp;gt;create_dynamic_table more or less according to this example here:&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="4378198"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I need a second dynamic internal table in the same program. So in a first try I just process the same code a second time (copy+paste) with new variables and new fieldsymbols. But when the program runs and the method is called a second time there is this error: "LT_GENTAB-xyz has laready been declared 7 xyz". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe I must free/initialize/delete/undeclare LT_GENTAB before calling the method a second time. Can anybody tell me how to do that? Or is there any other advice on how to create 2 internal tables dynamically in the same program (if possible using the same approach)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Oct 2010 11:41:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379797#M1543998</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-13T11:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: program with 2 dynamic i_tabs (cl_alv_table_create=&gt;create_dynamic_table)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379798#M1543999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Richard ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you didn't refresh the table LT_GENTAB before your copy code&lt;/P&gt;&lt;P&gt;calling method second time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Than field XYZ appended into  that table again,&lt;/P&gt;&lt;P&gt;a table can not contain two field with same name so you get this error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use REFRESH LT_GENTAB.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Oct 2010 11:59:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379798#M1543999</guid>
      <dc:creator>bbalci</dc:creator>
      <dc:date>2010-10-13T11:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: program with 2 dynamic i_tabs (cl_alv_table_create=&gt;create_dynamic_table)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379799#M1544000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LT_GENTAB is declared and used somewhere in the SAP standard method. Not in my ABAP. I can not access (or REFRESH) this table in my ABAP. Or if there is a way, could you please let me know how?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Oct 2010 12:14:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379799#M1544000</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-13T12:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: program with 2 dynamic i_tabs (cl_alv_table_create=&gt;create_dynamic_table)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379800#M1544001</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;Here is the sample code from the link in your message :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filling a table for field declarations :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at it_details into wa_details.
  clear wa_it_fldcat.
  wa_it_fldcat-fieldname = wa_details-name .
  wa_it_fldcat-datatype = wa_details-type_kind.
  wa_it_fldcat-inttype = wa_details-type_kind.
  wa_it_fldcat-intlen = wa_details-length.
  wa_it_fldcat-decimals = wa_details-decimals.
  append wa_it_fldcat to it_fldcat .
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Call the method for dynamic creation :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;call method cl_alv_table_create=&amp;gt;create_dynamic_table
             exporting
                it_fieldcatalog = it_fldcat
             importing
                ep_table        = new_table&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I meant you didn't refresh table it_fldcat as you fields declaration table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did u refresh this table before your second copy code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Oct 2010 12:26:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379800#M1544001</guid>
      <dc:creator>bbalci</dc:creator>
      <dc:date>2010-10-13T12:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: program with 2 dynamic i_tabs (cl_alv_table_create=&gt;create_dynamic_table)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379801#M1544002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your feedback.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get your point. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I acctually used new variables, new fieldsymboles and also new fieldcat for the second run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume there must be a method or something like that to "un-declare" the itab LT_GENTAB before I create a second dynamic table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Oct 2010 14:38:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379801#M1544002</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-13T14:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: program with 2 dynamic i_tabs (cl_alv_table_create=&gt;create_dynamic_table)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379802#M1544003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nobody?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 11:43:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379802#M1544003</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-19T11:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: program with 2 dynamic i_tabs (cl_alv_table_create=&gt;create_dynamic_table)</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379803#M1544004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't think you have to reinitialize anything. All you need is somethig like&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: new_table type ref to data,
          new_table2 type ref to data.

"fill field catalog here

"create a table first time
call method cl_alv_table_create=&amp;gt;create_dynamic_table
             exporting
                it_fieldcatalog = it_fldcat
             importing
                ep_table        = new_table

assign new_table-&amp;gt;* to &amp;lt;tab1&amp;gt;.

"create similar second table 
call method cl_alv_table_create=&amp;gt;create_dynamic_table
             exporting
                it_fieldcatalog = it_fldcat
             importing
                ep_table        = new_table2

assign new_table2-&amp;gt;* to &amp;lt;tab2&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You could use same data reference variable &lt;EM&gt;new_table&lt;/EM&gt; in both cases but in this case you would loose the connection to your first table after executing this method for the second time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Oct 2010 12:19:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/program-with-2-dynamic-i-tabs-cl-alv-table-create-gt-create-dynamic-table/m-p/7379803#M1544004</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-10-19T12:19:44Z</dc:date>
    </item>
  </channel>
</rss>

