<?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 Internal Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/6723488#M1455851</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I have the below requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on certain conditions i am building a dynamic fieldcatalog.The number of columns for the Fieldcatalog are determined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex : Number of columns can be 21 or 39 or 51.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my requirement is that i need to fill in these fieldcatalog with the data from my internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i create an Internal table having the exact number of columns.I have to use the RTTS classes like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CL_ABAP_TYPEDESCR&lt;/P&gt;&lt;P&gt;CL_ABAP_STRUCTDESCR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cant use CL_ALV_TABLE_CREATE as it gives a Dump after certain instances.So it doesnt meet my logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Mar 2010 19:43:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-22T19:43:09Z</dc:date>
    <item>
      <title>Dynamic Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/6723488#M1455851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;I have the below requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on certain conditions i am building a dynamic fieldcatalog.The number of columns for the Fieldcatalog are determined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex : Number of columns can be 21 or 39 or 51.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my requirement is that i need to fill in these fieldcatalog with the data from my internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i create an Internal table having the exact number of columns.I have to use the RTTS classes like &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CL_ABAP_TYPEDESCR&lt;/P&gt;&lt;P&gt;CL_ABAP_STRUCTDESCR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cant use CL_ALV_TABLE_CREATE as it gives a Dump after certain instances.So it doesnt meet my logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Mar 2010 19:43:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/6723488#M1455851</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-22T19:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/6723489#M1455852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hopefully you are using a newer release of NetWeaver.  If so, you can do something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPE-POOLS: abap.

DATA:
  lr_structdescr    TYPE REF TO cl_abap_structdescr,
  lr_tabledescr     TYPE REF TO cl_abap_tabledescr,
  lr_datadescr      TYPE REF TO cl_abap_datadescr,
  lt_components     TYPE abap_component_tab,
  ls_component      TYPE LINE OF abap_component_tab,
  lr_wa             TYPE REF TO data,
  lr_tab            TYPE REF TO data.

DATA: lv_index_num(3) TYPE n.
DATA: lv_index_char(3) TYPE c.

FIELD-SYMBOLS: &amp;lt;fs_wa&amp;gt; TYPE ANY.
FIELD-SYMBOLS: &amp;lt;fs_tab&amp;gt; TYPE table.

START-OF-SELECTION.

  DO 20 TIMES.
    lv_index_num = sy-index.
    lv_index_char = lv_index_num.
    CONCATENATE 'value' lv_index_char INTO ls_component-name.
    ls_component-type ?= cl_abap_elemdescr=&amp;gt;get_c( p_length = 10 ).
    INSERT ls_component INTO TABLE lt_components.
  ENDDO.

* get structure descriptor -&amp;gt; lr_STRUCTDESCR
  lr_structdescr ?= cl_abap_structdescr=&amp;gt;create( lt_components ).

* create work area of structure lr_STRUCTDESCR -&amp;gt; lr_WA
  CREATE DATA lr_wa TYPE HANDLE lr_structdescr.
  ASSIGN lr_wa-&amp;gt;* TO &amp;lt;fs_wa&amp;gt;.

  lr_datadescr ?= lr_structdescr.
  lr_tabledescr ?= cl_abap_tabledescr=&amp;gt;create( lr_datadescr ).

* Create dynmaic internal table, &amp;lt;FS_TAB&amp;gt; will be your dynamic internal table
  CREATE DATA lr_tab TYPE HANDLE lr_tabledescr.
  ASSIGN lr_tab-&amp;gt;* TO &amp;lt;fs_tab&amp;gt;.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Mar 2010 19:58:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/6723489#M1455852</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2010-03-22T19:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/6723490#M1455853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Can you help me with the below issue.I referred ur suggestion for building the Dynamic Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Issue is : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a Dynamic ALV using RTTS classes like cl_abap_structdescr,cl_abap_tabledescr and cl_abap_datadescr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The number of columns to be displayed is dynamic and i am able to display the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i need to perform SUBTOTAL on few of the columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In dynamic table how do i assign those columns as Type 'I' so that i can perform DO_SUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the method GET_I of class cl_abap_elemdescr but unable to achive the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Mar 2010 21:39:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/6723490#M1455853</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-25T21:39:28Z</dc:date>
    </item>
  </channel>
</rss>

