<?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 Dynamic data declaration in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-data-declaration/m-p/1787279#M338954</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I posted same thread into "Dictionary section" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a following issue &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt; - I am not sure whether this is possible - so I need your feedback/expertise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a custom table (example ZABC) with several fields in it - one of them being TABNAME . Content of that table ZABC is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MANDT TABNAME FIELDNAME ZCHECK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;800 KNA1                KUNNR&lt;/P&gt;&lt;P&gt;800 KNA1                NAME1         X&lt;/P&gt;&lt;P&gt;800 KNA1                NAME2         X&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;800 KNA1                KUNNR&lt;/P&gt;&lt;P&gt;800 KNVV                BZIRK           X&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;800 KNAS                KUNNR&lt;/P&gt;&lt;P&gt;800 KNAS                STCEG&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no rule how many entries will be in this ZABC table - I guess it will be less than 20 - but this is not business rule. Also do not know how many different "tables" could be specified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fields MANDT and ZCHECK fields are not important at this stage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The challenge I have is to fetch data for only those fields from their specified physical tables (KNA1, KNVV, KNAS) in internal tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case I would need to have 3 internal tables one for KNA1, one for KNAS and one for KNVV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to keep those "internal" table with content throughout the entire program for certain validation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that I should dynamically define those internal tables but I have issues not knowing how many tables will be defined in ZABC table and I personally do not want to declare "&amp;lt;fs_itab&amp;gt; TYPE ANY TABLE" 20 or so times as fs_itab1 - fs_itab20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way I can dynamically create as many internal tables as needed and keep their content throughout program run-time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Goran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Dec 2006 21:56:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-06T21:56:19Z</dc:date>
    <item>
      <title>Dynamic data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-data-declaration/m-p/1787279#M338954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I posted same thread into "Dictionary section" &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a following issue &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt; - I am not sure whether this is possible - so I need your feedback/expertise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a custom table (example ZABC) with several fields in it - one of them being TABNAME . Content of that table ZABC is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MANDT TABNAME FIELDNAME ZCHECK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;800 KNA1                KUNNR&lt;/P&gt;&lt;P&gt;800 KNA1                NAME1         X&lt;/P&gt;&lt;P&gt;800 KNA1                NAME2         X&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;800 KNA1                KUNNR&lt;/P&gt;&lt;P&gt;800 KNVV                BZIRK           X&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;800 KNAS                KUNNR&lt;/P&gt;&lt;P&gt;800 KNAS                STCEG&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no rule how many entries will be in this ZABC table - I guess it will be less than 20 - but this is not business rule. Also do not know how many different "tables" could be specified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fields MANDT and ZCHECK fields are not important at this stage.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The challenge I have is to fetch data for only those fields from their specified physical tables (KNA1, KNVV, KNAS) in internal tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case I would need to have 3 internal tables one for KNA1, one for KNAS and one for KNVV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to keep those "internal" table with content throughout the entire program for certain validation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that I should dynamically define those internal tables but I have issues not knowing how many tables will be defined in ZABC table and I personally do not want to declare "&amp;lt;fs_itab&amp;gt; TYPE ANY TABLE" 20 or so times as fs_itab1 - fs_itab20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way I can dynamically create as many internal tables as needed and keep their content throughout program run-time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Goran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Dec 2006 21:56:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-data-declaration/m-p/1787279#M338954</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-06T21:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-data-declaration/m-p/1787280#M338955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the sample code to create the Itab dynamically..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
***** Creating Internal Table at Run time*******

DATA: LINETYPE  TYPE REF TO CL_ABAP_STRUCTDESCR,
      TABLETYPE TYPE REF TO CL_ABAP_TABLEDESCR,
      KEY       TYPE ABAP_KEYDESCR_TAB.

FIELD-SYMBOLS: &amp;lt;TABLE&amp;gt; TYPE ANY TABLE.

DATA: DREF TYPE REF TO DATA.

* Get Structure of Some Database Table for example

LINETYPE ?=   CL_ABAP_TYPEDESCR=&amp;gt;DESCRIBE_BY_NAME( 'SPFLI' ).

* Specify Key fields if needed

APPEND 'CARRID' TO KEY.
APPEND 'CONNID' TO KEY.

* Generate Internal table Type Object

TABLETYPE = CL_ABAP_TABLEDESCR=&amp;gt;CREATE(
    P_LINE_TYPE  = LINETYPE
    P_TABLE_KIND = CL_ABAP_TABLEDESCR=&amp;gt;TABLEKIND_SORTED
    P_UNIQUE     = ABAP_TRUE
    P_KEY        = KEY ).

* Create a data object of a specific type using a type object

CREATE DATA DREF TYPE HANDLE TABLETYPE.

ASSIGN DREF-&amp;gt;* TO &amp;lt;TABLE&amp;gt;.

SELECT  * FROM SPFLI INTO TABLE &amp;lt;TABLE&amp;gt; WHERE CARRID = 'LH'.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raja T&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 03:01:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-data-declaration/m-p/1787280#M338955</guid>
      <dc:creator>raja_thangamani</dc:creator>
      <dc:date>2006-12-07T03:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-data-declaration/m-p/1787281#M338956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  The best thing would be to create an internal table of type Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: itab type any table.&lt;/P&gt;&lt;P&gt;DATA: it_itab like table of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 03:29:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-data-declaration/m-p/1787281#M338956</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2006-12-07T03:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-data-declaration/m-p/1787282#M338957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All those examples you'all posted are great BUT it does not answer my question nor help me to solve my issue. Maybe I was not clear enough ... or something is wrong with me &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have no problem to get a dynamically defined table and fill its content from ONE physicall table. That is pretty straight forward. The issue I have is that I do not know how many dynamically tables I will have to define and later asign to field symbol. Look at my custom table above and you will understand what I am trying to say.&lt;/P&gt;&lt;P&gt;What makes this issue more complex is that, once data fetch from those physicall SAP tables, I have to keep the content for all those internal tables during the entire program run . Second the most, I do not want to limit the program by defining FS "n" times in data declaration section. That is really important since I have no idea how many tables will be accessed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I follow the logic from your examples, I will end up overwritting the FS content every time I assign new internal table to FS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to solve this issue, I was thinking that whenever I get the data from SAP table into internal table (field symbol) i export the content of internal table / FS to memory and then retrieve them when needed. This sounds like waky /fuzzy process and I am not aware of anything better. I am old fashion ABAP guy who got certified 1995 and have not seen ABAP for at least 5 years.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like that someone either tells me whether I am OK going forard with my "memory" solution or ... in few words gives me hint how to handle multiple dynamicall defined tables AT THE SAME TIME with its content using some OO code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;G &lt;/P&gt;&lt;P&gt;P.S.&lt;/P&gt;&lt;P&gt;I have erroneusly opened the same thread twice. Sorry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 14:23:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-data-declaration/m-p/1787282#M338957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T14:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-data-declaration/m-p/1787283#M338958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this may be a workable solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just define on &amp;lt;fs&amp;gt; type any.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and each time you want an itab, use this as convert the content to xml and store it in a itab , for each new table append the xml to this itab. and later in your program whereever you want you create another dynamic itab based on the xml and conver tthe xml back to itab for processing. (did i confuse you?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Dec 2006 13:04:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-data-declaration/m-p/1787283#M338958</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2006-12-09T13:04:57Z</dc:date>
    </item>
  </channel>
</rss>

