<?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: Unable to create Dynamic internal Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734301#M1111038</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What will be he code in FILL_IT ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Nov 2008 18:25:57 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2008-11-12T18:25:57Z</dc:date>
    <item>
      <title>Unable to create Dynamic internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734298#M1111035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code i have written to create dynamic internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA : idetails TYPE abap_compdescr_tab,
       xdetails TYPE abap_compdescr.
  DATA : ref_table_des TYPE REF TO cl_abap_structdescr.
  UNASSIGN: &amp;lt;dyn_table&amp;gt;, &amp;lt;dyn_wa&amp;gt;, &amp;lt;dyn_field&amp;gt;.
* Get the structure of the table.
  ref_table_des ?=
      cl_abap_typedescr=&amp;gt;describe_by_name( table-low ).
  idetails[] = ref_table_des-&amp;gt;components[].
  w_out-rec = table-low.
  APPEND w_out TO i_out.
  CLEAR w_out.
  LOOP AT idetails INTO xdetails.
    CLEAR xfc.
    xfc-fieldname = xdetails-name.
    CONCATENATE w_out xdetails-name INTO w_out
                    SEPARATED BY ','.
    xfc-datatype = xdetails-type_kind.
    xfc-inttype = xdetails-type_kind.
    xfc-intlen = xdetails-length.
    xfc-decimals = xdetails-decimals.
    APPEND xfc TO ifc.
  ENDLOOP.
  APPEND w_out TO i_out.
* Create dynamic internal table and assign to FS
  CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
    EXPORTING
      it_fieldcatalog = ifc
    IMPORTING
      ep_table        = dy_table.
  ASSIGN dy_table-&amp;gt;* TO &amp;lt;dyn_table&amp;gt;.
* create dynamic work area and assign to fs
  CREATE DATA dy_line LIKE LINE OF &amp;lt;dyn_table&amp;gt;.
  ASSIGN dy_line-&amp;gt;* TO &amp;lt;dyn_wa&amp;gt;.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the 1st internal table is created successfully&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when it is executing the class cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;&lt;P&gt;for creating the 2nd internal table, it errors out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error message&lt;/P&gt;&lt;P&gt; "LT_GENTAB-MANDT" has already been declared. 9 MANDT(000006)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know how to solve this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2008 15:01:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734298#M1111035</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-12T15:01:02Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to create Dynamic internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734299#M1111036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please  change the code this way and try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 LOOP AT idetails INTO xdetails.
    CLEAR xfc.
    xfc-fieldname = xdetails-name.
    CONCATENATE w_out xdetails-name INTO w_out
                    SEPARATED BY ','.
    xfc-datatype = xdetails-type_kind.
    xfc-inttype = xdetails-type_kind.
    xfc-intlen = xdetails-length.
    xfc-decimals = xdetails-decimals.
    read table ifc with key fieldname = xfc-fieldname. "&amp;lt;
    if sy-subrc ne 0.                                  "&amp;lt;
    APPEND xfc TO ifc.                                 "&amp;lt;  
    endif.
  ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2008 15:08:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734299#M1111036</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-11-12T15:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to create Dynamic internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734300#M1111037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;but now it goes to short dump on the select query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  LOOP AT table.
    PERFORM create_dynamic_itab.
    SELECT * INTO TABLE &amp;lt;dyn_table&amp;gt;
                FROM (table-low).
    PERFORM fill_it.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Short Dump Description&lt;/P&gt;&lt;P&gt;Short text&lt;/P&gt;&lt;P&gt;    The types of operands "dbtab" and "itab" cannot be converted into one another.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Error analysis&lt;/P&gt;&lt;P&gt;    In a Unicode system, the type of the operand "dbtab" must be convertible&lt;/P&gt;&lt;P&gt;    into that of the operand "itab" for the statement "SELECT * FROM dbtab INTO&lt;/P&gt;&lt;P&gt;     TABLE itab". Regardless of the&lt;/P&gt;&lt;P&gt;    length of a Unicode character, both operands must have the same&lt;/P&gt;&lt;P&gt;    structure layout.&lt;/P&gt;&lt;P&gt;    In this case, this condition has not been met.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i checked the fields, they are same&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i change the select statement clause to &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
into corresponding fields
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is going to dump in  PERFORM fill_it. statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2008 17:48:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734300#M1111037</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-12T17:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to create Dynamic internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734301#M1111038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What will be he code in FILL_IT ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Nov 2008 18:25:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734301#M1111038</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-11-12T18:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to create Dynamic internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734302#M1111039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM fill_it.
*   Write out data from table.
  LOOP AT &amp;lt;dyn_table&amp;gt; INTO &amp;lt;dyn_wa&amp;gt;.
    CLEAR w_out.
    DO.
      ASSIGN COMPONENT  sy-index
         OF STRUCTURE &amp;lt;dyn_wa&amp;gt; TO &amp;lt;dyn_field&amp;gt;.
      IF sy-subrc &amp;lt;&amp;gt; 0.
        APPEND w_out TO i_out.
        EXIT.
      ELSE.
        CONCATENATE w_out &amp;lt;dyn_field&amp;gt;
                INTO w_out SEPARATED BY ','.
      ENDIF.
    ENDDO.
  ENDLOOP.
ENDFORM.                    "fill_it
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2008 09:36:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734302#M1111039</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-13T09:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to create Dynamic internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734303#M1111040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sairam,&lt;/P&gt;&lt;P&gt; What do u mean by 2nd internal table creation.&lt;/P&gt;&lt;P&gt;Will it happen in the same ABAP session or a different session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The errors is with respect to duplication of fields. When u declare two fields with same name in an internal table , it will throw an error message. The same thing is happening when u r creating an internal table dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Satya Priya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2008 10:39:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734303#M1111040</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-13T10:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to create Dynamic internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734304#M1111041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try clearing the field catalog table ifc. U can check the fields of this fieldcatalog table in debugging mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Satya Priya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Nov 2008 10:44:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/unable-to-create-dynamic-internal-table/m-p/4734304#M1111041</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-13T10:44:25Z</dc:date>
    </item>
  </channel>
</rss>

