<?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/3886617#M933706</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;I need to create a dynamic internal table. I will have to decide the number of fields during runtime, take the data in internal table and work on it further. Please suggest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jun 2008 06:30:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-03T06:30:24Z</dc:date>
    <item>
      <title>Dynamic Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/3886617#M933706</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;I need to create a dynamic internal table. I will have to decide the number of fields during runtime, take the data in internal table and work on it further. Please suggest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 06:30:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/3886617#M933706</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T06:30:24Z</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/3886618#M933707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priti,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WELCOME TO SDN!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please check this link &lt;STRONG&gt;Dynamic Intertnal table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.saptechnical.com/Tutorials/ABAP/DynamicInternaltable/DynamicInternalTable.htm" target="test_blank"&gt;http://www.saptechnical.com/Tutorials/ABAP/DynamicInternaltable/DynamicInternalTable.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ZCLUST1 .
*
* Example: how to create a dynamic internal table
* 
* The dynamic internal table stucture
DATA: BEGIN OF STRUCT OCCURS 10,
    FILDNAME(8) TYPE C,
    ABPTYPE TYPE C,
    LENGTH TYPE I,
END OF STRUCT.

* The dynamic program source table
DATA: BEGIN OF INCTABL OCCURS 10,
    LINE(72),
END OF INCTABL.

DATA: LNG TYPE I, TYPESRTING(6).

* Sample dynamic internal table stucture
STRUCT-FILDNAME = 'field1'. STRUCT-ABPTYPE = 'c'. STRUCT-LENGTH = '6'.
APPEND STRUCT. CLEAR STRUCT.
STRUCT-FILDNAME = 'field2'. STRUCT-ABPTYPE = 'd'.
APPEND STRUCT. CLEAR STRUCT.
STRUCT-FILDNAME = 'field3'. STRUCT-ABPTYPE = 'i'.
APPEND STRUCT. CLEAR STRUCT.

* Create the dynamic internal table definition in the dyn. program
INCTABL-LINE = 'program zdynpro.'. APPEND INCTABL.
INCTABL-LINE = 'data: begin of dyntab occurs 10,'. APPEND INCTABL.
LOOP AT STRUCT.
  INCTABL-LINE = STRUCT-FILDNAME.
  LNG = STRLEN( STRUCT-FILDNAME ).
  IF NOT STRUCT-LENGTH IS INITIAL .
    TYPESRTING(1) = '('.
    TYPESRTING+1 = STRUCT-LENGTH.
    TYPESRTING+5 = ')'.
    CONDENSE TYPESRTING NO-GAPS.
    INCTABL-LINE+LNG = TYPESRTING.
  ENDIF.
  INCTABL-LINE+15 = 'type '.
  INCTABL-LINE+21 = STRUCT-ABPTYPE.
  INCTABL-LINE+22 = ','.
  APPEND INCTABL.
ENDLOOP.
INCTABL-LINE = 'end of dyntab. '.
APPEND INCTABL.

* Create the code processes the dynamic internal table
INCTABL-LINE = ' '. APPEND INCTABL.
INCTABL-LINE = 'dyntab-field1 = ''aaaaaa''.'. APPEND INCTABL.
INCTABL-LINE = 'dyntab-field1 = ''19970814''.'. APPEND INCTABL.
INCTABL-LINE = 'dyntab-field1 = 1.'. APPEND INCTABL.
INCTABL-LINE = 'append dyntab.'. APPEND INCTABL.
INCTABL-LINE = ' '. APPEND INCTABL.
INCTABL-LINE = 'loop at dyntab.'. APPEND INCTABL.
INCTABL-LINE = 'write: / dyntab.'. APPEND INCTABL.
INCTABL-LINE = 'endloop.'. APPEND INCTABL.

* Create and run the dynamic program
INSERT REPORT 'zdynpro'(001) FROM INCTABL.
SUBMIT ZDYNPRO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;raam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 06:34:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/3886618#M933707</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T06:34:40Z</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/3886619#M933708</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;&lt;STRONG&gt;Internal Tables&lt;/STRONG&gt; are local tables within a program containing a series of lines having same data type. ABAPTM Open SQL allows single field, range of fields, entire database table or view into an internal table.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In technical terms Internal table is a dynamic sequential dataset in which all records have the same data structure and a key.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A static internal table&lt;/STRONG&gt; can be declared in an ABAPTM program initially, when the structure of the internal table is fixed and known to the user.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Dynamic internal table&lt;/STRONG&gt; is an extension to internal table concept, used when the number of fields is not known at the design time or until the compile time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pls go through this program.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report z_dynamic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type-pools : abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;dyn_table&amp;gt; type standard table,&lt;/P&gt;&lt;P&gt;&amp;lt;dyn_wa&amp;gt;,&lt;/P&gt;&lt;P&gt;&amp;lt;dyn_field&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: dy_table type ref to data,&lt;/P&gt;&lt;P&gt;dy_line type ref to data,&lt;/P&gt;&lt;P&gt;xfc type lvc_s_fcat,&lt;/P&gt;&lt;P&gt;ifc type lvc_t_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of block b1 with frame.&lt;/P&gt;&lt;P&gt;parameters: p_table(30) type c default 'T001'.&lt;/P&gt;&lt;P&gt;selection-screen end of block b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform get_structure.&lt;/P&gt;&lt;P&gt;perform create_dynamic_itab.&lt;/P&gt;&lt;P&gt;perform get_data.&lt;/P&gt;&lt;P&gt;perform write_out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form create_dynamic_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;Create dynamic internal table and assign to FS &lt;/P&gt;&lt;P&gt;call method cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;it_fieldcatalog = ifc&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;ep_table = dy_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign dy_table-&amp;gt;* to &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create dynamic work area and assign to FS &lt;/P&gt;&lt;P&gt;create data dy_line like line of &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;assign dy_line-&amp;gt;* to &amp;lt;dyn_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Naresh.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Nov 7, 2008 2:14 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jun 2008 06:36:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/3886619#M933708</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-03T06:36:02Z</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/3886620#M933709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Naresh,,.&lt;/P&gt;&lt;P&gt;i have a doubt is this internal table specific to ALV.&lt;/P&gt;&lt;P&gt;what if we are not using the ALV display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Please do not resurrect old threads, unless adding further helpful information&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Nov 7, 2008 2:14 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2008 11:11:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/3886620#M933709</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-07T11:11:11Z</dc:date>
    </item>
  </channel>
</rss>

