<?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 Internal Table with different names at runtime in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-internal-table-with-different-names-at-runtime/m-p/3779713#M909449</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks for the reply.&lt;/P&gt;&lt;P&gt;But, here Internal Table will be created with the same name at each time or with different names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And can I decide the NAME of Internal Table (&amp;amp; not Transperent Table), as I explaied in my query?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Prasad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Apr 2008 05:45:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-25T05:45:40Z</dc:date>
    <item>
      <title>Creating Internal Table with different names at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-internal-table-with-different-names-at-runtime/m-p/3779711#M909447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anyone help me in the below topic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create Internal Table at runtime with different Names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Name of the Internal Table should be decided at runtime. Type of all Internal Tables is same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex. In loop, I want to create the as many Internal Tables as much times the loop will be executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TAB1&lt;/P&gt;&lt;P&gt;TAB2&lt;/P&gt;&lt;P&gt;TAB3&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;TABn&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e.Name of the Internal Table will be concatenation of 'TAB' &amp;amp; &amp;lt;Loop Index&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help ASAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Prasad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 05:16:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-internal-table-with-different-names-at-runtime/m-p/3779711#M909447</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T05:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Internal Table with different names at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-internal-table-with-different-names-at-runtime/m-p/3779712#M909448</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;check the code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: d_ref TYPE REF TO data,&lt;/P&gt;&lt;P&gt;          d_ref2 TYPE REF TO data,&lt;/P&gt;&lt;P&gt;          i_alv_cat TYPE TABLE OF lvc_s_fcat,&lt;/P&gt;&lt;P&gt;          ls_alv_cat LIKE LINE OF i_alv_cat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: tabname LIKE dcobjdef-name ,&lt;/P&gt;&lt;P&gt;             fieldname LIKE dcobjdef-name,&lt;/P&gt;&lt;P&gt;             desc LIKE dntab-fieldtext.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETER: p_tablen TYPE tabname. -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&amp;gt; Input table field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab OCCURS 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INCLUDE STRUCTURE dntab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: END OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS : &amp;lt;f_fs&amp;gt; TYPE table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;f_fs1&amp;gt; TYPE table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;f_fs2&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;f_fs3&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;f_fs4&amp;gt; type any,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;f_field&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'NAMETAB_GET' -&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt;&amp;gt; Fetches the fields &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;langu = sy-langu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tabname = p_tablen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nametab = itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no_texts_found = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_alv_cat-fieldname = itab-fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_alv_cat-ref_table = p_tablen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_alv_cat-ref_field = itab-fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_alv_cat-seltext = itab-fieldtext.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_alv_cat-reptext = itab-fieldtext.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND ls_alv_cat TO i_alv_cat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;internal table build &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it_fieldcatalog = i_alv_cat&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ep_table = d_ref.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN d_ref-&amp;gt;* TO &amp;lt;f_fs&amp;gt;. -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;&amp;gt; Dynamic table creation with fields of the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: l_field TYPE fieldname,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_field1 type fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM (p_tablen) INTO CORRESPONDING FIELDS OF TABLE &amp;lt;f_fs&amp;gt;.&lt;/P&gt;&lt;P&gt;Fetching of the data from the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;f_fs&amp;gt; ASSIGNING &amp;lt;f_fs2&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here u can check the validations and process&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT 2 OF STRUCTURE &amp;lt;f_fs2&amp;gt; TO &amp;lt;f_fs3&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT 3 OF STRUCTURE &amp;lt;f_fs2&amp;gt; TO &amp;lt;f_fs4&amp;gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE &amp;lt;f_fs3&amp;gt; TO l_field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE &amp;lt;f_fs4&amp;gt; TO l_field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE:/1 l_field(20),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;22 l_field1(10).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP. &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;Kannaiah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 05:32:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-internal-table-with-different-names-at-runtime/m-p/3779712#M909448</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T05:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Internal Table with different names at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-internal-table-with-different-names-at-runtime/m-p/3779713#M909449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks for the reply.&lt;/P&gt;&lt;P&gt;But, here Internal Table will be created with the same name at each time or with different names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And can I decide the NAME of Internal Table (&amp;amp; not Transperent Table), as I explaied in my query?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Prasad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 05:45:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-internal-table-with-different-names-at-runtime/m-p/3779713#M909449</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T05:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Internal Table with different names at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-internal-table-with-different-names-at-runtime/m-p/3779714#M909450</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here the structure of the internal table will be created dynamically, it will create internal table header based on the name what you have given inthe input.&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;Kannaiah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 05:49:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-internal-table-with-different-names-at-runtime/m-p/3779714#M909450</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T05:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Creating Internal Table with different names at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/creating-internal-table-with-different-names-at-runtime/m-p/3779715#M909451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, my table type is same for all tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, it will not work my my requirement as Internal tables will be created with same name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;Prasad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2008 05:54:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/creating-internal-table-with-different-names-at-runtime/m-p/3779715#M909451</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-25T05:54:14Z</dc:date>
    </item>
  </channel>
</rss>

