<?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: Creating Dynamic internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168879#M1196965</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;  create a dynamic table assigned to field symbol with type any (use create data statement). Then create an internal table which has type declared as "TYPE REF TO DATA" - this is an universal table which can hold any number of records and each record can have different structure. For easy use you can create this table with two columns. First one contains type of the structure and second one contains variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this way it doesn't matter how many tables you have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Karol&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 01 Mar 2009 19:22:22 GMT</pubDate>
    <dc:creator>karol_seman</dc:creator>
    <dc:date>2009-03-01T19:22:22Z</dc:date>
    <item>
      <title>Creating Dynamic internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168870#M1196956</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;My post is not to know how to create Dynamic internal tables but to know how to create dynamic internal tables for which I don't know how many dynamic tables are supposed to be created during run time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Means, I don't know how many internal tables I would need during run time but I know the attributes of the table that is supposed to be created!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please put your thoughts on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Somnath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2009 11:47:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168870#M1196956</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-26T11:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168871#M1196957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I dont think that this is possible but i´m not a 100% sure.&lt;/P&gt;&lt;P&gt;You could declare just that much itabs to be sure they are enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2009 11:51:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168871#M1196957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-26T11:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168872#M1196958</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;&lt;/P&gt;&lt;P&gt;Yes , you can create a Dynamic Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Simple example program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: itab TYPE STANDARD TABLE OF spfli,&lt;/P&gt;&lt;P&gt;              wa LIKE LINE OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: line(72) TYPE c,&lt;/P&gt;&lt;P&gt;            list LIKE TABLE OF line(72).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;*line = ' CITYFROM CITYTO '.&lt;/P&gt;&lt;P&gt;  line = ' AIRPTO '.&lt;/P&gt;&lt;P&gt; APPEND line TO list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT DISTINCT (list)&lt;/P&gt;&lt;P&gt;       INTO CORRESPONDING FIELDS OF TABLE itab&lt;/P&gt;&lt;P&gt;            FROM spfli.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;  LOOP AT itab INTO wa.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    WRITE: / wa-cityfrom, wa-cityto.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; wa-airpto.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Neelima.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2009 11:53:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168872#M1196958</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-26T11:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168873#M1196959</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;Thanks for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I didn't get the correct answer. I think my question was not properly placed.&lt;/P&gt;&lt;P&gt;Anyway I am repeating the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know how many internal tables I would need during run time but I know what would be the structure for those table during run time. Is there any way to dynamically declare those many field-symbols through which can capture those table references created dynamically ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope the question is clear now !&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;Somnath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2009 13:48:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168873#M1196959</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-27T13:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168874#M1196960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i dont think u can have a control on number of field symbols or itabs to be created so its better u anticipate the maximum number and predeclare them in ur code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="16" __jive_macro_name="size"&gt;кu03B1ятu03B9к&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2009 13:54:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168874#M1196960</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-27T13:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168875#M1196961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Should all tables have the same structure? Why not add an additional key field, like a counter, or use deep structures, i.e. an internal table containing internal tables.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2009 13:58:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168875#M1196961</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-02-27T13:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168876#M1196962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wrap your internal table in a local class. Then create in itab of the local class. This will allow you to instance the table at will at runtime. Of course you will need methods to access the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLASS myITABCLASS DEFINITION .

PUBLIC SECTION .

* Define methods for dealing with internal table here

PROTECTED SECTION .

PRIVATE SECTION .

*  Define internal Table here

ENDCLASS .

CLASS myITABCLASS IMPLEMENTATION .

* Implement the methods from above here.

ENDCLASS .

* In program
DATA waClTab TYPE REF TO myITABCLASS .

DATA itCITab TYPE STANDARD TABLE OF REF TO myITABCLASS .

* Now every time you need another table, you use the following
CREATE OBJECT waClTab .

APPEND waClTab TO itClTab .

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will allow you to create as many internal tables as you would like. In addition, if you need multiple structures for your tables, you could create a base class and have your table structures inherit the base class. This would allow for an indefinite number of varied table structures.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Feb 2009 22:52:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168876#M1196962</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-27T22:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168877#M1196963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;copy&amp;amp;paste_removed_by_moderator&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Julius Bussche on Mar 1, 2009 8:07 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Feb 2009 06:40:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168877#M1196963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-28T06:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168878#M1196964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Neelima,&lt;/P&gt;&lt;P&gt;Source of ur answer&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.henrikfrank.dk/abaptips/abap%20language/dynamic%20programming/dynamicopensql.htm" target="test_blank"&gt;http://www.henrikfrank.dk/abaptips/abap%20language/dynamic%20programming/dynamicopensql.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="16" __jive_macro_name="size"&gt;кu03B1ятu03B9к&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Mar 2009 19:05:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168878#M1196964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-01T19:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168879#M1196965</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;  create a dynamic table assigned to field symbol with type any (use create data statement). Then create an internal table which has type declared as "TYPE REF TO DATA" - this is an universal table which can hold any number of records and each record can have different structure. For easy use you can create this table with two columns. First one contains type of the structure and second one contains variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this way it doesn't matter how many tables you have.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Karol&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Mar 2009 19:22:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168879#M1196965</guid>
      <dc:creator>karol_seman</dc:creator>
      <dc:date>2009-03-01T19:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Dynamic internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168880#M1196966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi somnath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you want all the internal tables of the same structure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhumika&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2009 06:01:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-dynamic-internal-tables/m-p/5168880#M1196966</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-02T06:01:45Z</dc:date>
    </item>
  </channel>
</rss>

