<?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 column declaration in an Internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-column-declaration-in-an-internal-table/m-p/906508#M56195</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;How can we change the number of columns based on a value in the selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A period will be entered in the selection screen, the internal table should have as many columns as the number of months in that period entered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How will we be able to do that ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Archana.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 May 2005 13:05:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-05-28T13:05:54Z</dc:date>
    <item>
      <title>Dynamic column declaration in an Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-column-declaration-in-an-internal-table/m-p/906508#M56195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;How can we change the number of columns based on a value in the selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A period will be entered in the selection screen, the internal table should have as many columns as the number of months in that period entered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How will we be able to do that ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Archana.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 May 2005 13:05:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-column-declaration-in-an-internal-table/m-p/906508#M56195</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-28T13:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic column declaration in an Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-column-declaration-in-an-internal-table/m-p/906509#M56196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi archana&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check out the class "&amp;lt;b&amp;gt;CL_ALV_TABLE_CREATE&amp;lt;/b&amp;gt;". Try its method called "&amp;lt;b&amp;gt;CREATE_DYNAMIC_TABLE&amp;lt;/b&amp;gt;". It is some easy just prepare a field catalog and call the method to give reference of dynamically created table.&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;*--Serdar &amp;lt;a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d"&amp;gt;[ BC ]&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 May 2005 13:19:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-column-declaration-in-an-internal-table/m-p/906509#M56196</guid>
      <dc:creator>ssimsekler</dc:creator>
      <dc:date>2005-05-28T13:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic column declaration in an Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-column-declaration-in-an-internal-table/m-p/906510#M56197</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;Can have a look at this&lt;/P&gt;&lt;P&gt;Retrieving field names dynamically&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes you may have only a table name and want to retrieve the name of each field of the corresponding table. For example, when you want to use ASSIGN COMPONENT fieldname OF TABLE table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An ABAPer's first reaction is to read the standard ABAP basis tables DD02L, DD03L, etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This way of reading fields is very slow. Use methods from the class CL_ABAP_TYPEDESCR instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: descr_struc_ref TYPE REF TO cl_abap_structdescr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;descr_struc_ref ?= cl_abap_typedescr=&amp;gt;describe_by_name('SFLIGHT' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the result of descr_struct_ref after the execution of this piece of code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABSOLUTE_NAME C 200 TYPE=SFLIGHT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE_KIND C 1 u&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LENGTH I 4 80&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DECIMALS I 4 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KIND C 1 S&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRUCT_KIND C 1 F&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COMPONENTS h 8 Table[14x40]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HAS_INCLUDE C 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table COMPONENTS is filled with :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LENGTH DECIMALS TYPE_KIND NAME&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3 | 0 |C |MANDT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3 | 0 |C |CARRID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4 | 0 |N |CONNID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;8 | 0 |D |FLDATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have the fields name and a lot more information about the table. This class can also handle structure, table type, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that this method is very fast because it uses the database layer directly thanks to SYSTEM CALLs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To have a look at the class, use transaction SE24.&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap" target="test_blank"&gt;https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap&lt;/A&gt; faqs.faq#q-25&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Judith.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 May 2005 03:39:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-column-declaration-in-an-internal-table/m-p/906510#M56197</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-05-30T03:39:17Z</dc:date>
    </item>
  </channel>
</rss>

