<?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: reg internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677613#M885686</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 Table&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           An internal table is a temporary table stored in RAM on the application server. It is created and filled by a program during execution and is discarded when the program ends. Like a database table, an internal table consists of one or more rows with an identical structure, but unlike a database table, it cannot hold data after the program ends. Use it as temporary storage for manipulating data or as a temporary private buffer.&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;STRONG&gt;Definition of an Internal Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;An internal table consists of a body and an optional header line .  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The body holds the rows of the internal table. All rows within it have the same structure. The term "internal table" itself usually refers to the body of the internal table.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The header line is a field string with the same structure as a row of the body, but it can only hold a single row. It is a buffer used to hold each record before it is added or each record as it is retrieved from the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To define an internal table body, use occurs n on the definition of any field string except tables. occurs creates the body of the internal table. The memory for the body is not allocated until the first row is added to it. Without occurs, you only have a field string. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To define an internal table with a header line, you must include either begin of or with header line in the definition. A header line is automatically created if begin of appears in the definition. If you use like instead of begin of, the internal table will not have a header line unless you add with header line after the occurs clause. This is illustrated in lines 2 through 10 of Listing 11.1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only time you would create an internal table without a header line is in the case of a nested internal table. A nested internal table cannot have a header line. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Listing 11.1  Basic Ways of Defining Internal Tables with and Without a Header Line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 1 report ztx1101.&lt;/P&gt;&lt;P&gt; 2 data: begin of it1 occurs 10,          "has a header line&lt;/P&gt;&lt;P&gt; 3         f1,&lt;/P&gt;&lt;P&gt; 4         f2,&lt;/P&gt;&lt;P&gt; 5         f3,&lt;/P&gt;&lt;P&gt; 6         end of it1.&lt;/P&gt;&lt;P&gt; 7&lt;/P&gt;&lt;P&gt; 8 data it2 like ztxlfa1 occurs 100.      "doesn't have a header line&lt;/P&gt;&lt;P&gt; 9&lt;/P&gt;&lt;P&gt;10 data it3 like ztxlfa1 occurs 100 with header line. "it does now&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reward if useful&lt;/STRONG&gt;&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; Shankar GJ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Shankar GJ on Apr 11, 2008 7:16 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Apr 2008 05:16:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-11T05:16:06Z</dc:date>
    <item>
      <title>reg internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677608#M885681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i want to know the concept of dynamic internal tables.&lt;/P&gt;&lt;P&gt;please explain me step by step in detail with good example.&lt;/P&gt;&lt;P&gt;help ful me alot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 05:03:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677608#M885681</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T05:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: reg internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677609#M885682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dynamic internal table 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;Check this Web blog of Dynamic Internal Table&lt;/P&gt;&lt;P&gt;/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap&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;P&gt;&lt;A href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/dynamic" target="test_blank"&gt;https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/dynamic&lt;/A&gt;&lt;EM&gt;Internal&lt;/EM&gt;Table&amp;amp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 05:06:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677609#M885682</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T05:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: reg internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677610#M885683</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;/P&gt;&lt;P&gt;  For explanation check the blog&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the link&lt;/P&gt;&lt;P&gt;[http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also check the blog&lt;/P&gt;&lt;P&gt;[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2071] &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and ex:&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;&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;&lt;/P&gt;&lt;P&gt;Pls. reward if useful....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 05:10:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677610#M885683</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T05:10:20Z</dc:date>
    </item>
    <item>
      <title>Re: reg internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677611#M885684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dynamic internal tables are the internal tables created at run time not like the normal tables which are created  before you start data extraction..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dynamic internal tables can be created using CL_ALV_TABLE_CREATE class and method CREATE_DYNAMIC_TABLE.&lt;/P&gt;&lt;P&gt;Just fill the field catalog(IT_FIELDCATALOG) in the parameter of method (like you do in normal ALV reports) and it creates a pointer to dynamic data table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code.&lt;/P&gt;&lt;P&gt;report ytest.&lt;/P&gt;&lt;P&gt;data: lt_fieldcatalog type lvc_t_fcat.&lt;/P&gt;&lt;P&gt;data: ls_fieldcatalog type lvc_s_fcat.&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;fs_data&amp;gt; type ref to data.&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;fs_1&amp;gt;.&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;fs_2&amp;gt; type any table.&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;fs_3&amp;gt; type ypoll.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lt_data type ref to data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign lt_data to &amp;lt;fs_data&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-fieldname = 'MANDT'.&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-tabname = 'LT_TAB'.&lt;/P&gt;&lt;P&gt;append ls_fieldcatalog to lt_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-fieldname = 'POLLID'.&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-tabname = 'LT_TAB'.&lt;/P&gt;&lt;P&gt;append ls_fieldcatalog to lt_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-fieldname = 'TEAM'.&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-tabname = 'LT_TAB'.&lt;/P&gt;&lt;P&gt;append ls_fieldcatalog to lt_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-fieldname = 'INITIATOR'.&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-tabname = 'LT_TAB'.&lt;/P&gt;&lt;P&gt;append ls_fieldcatalog to lt_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-fieldname = 'DESCRIPTION'.&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-tabname = 'LT_TAB'.&lt;/P&gt;&lt;P&gt;append ls_fieldcatalog to lt_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-fieldname = 'APPROVED'.&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-tabname = 'LT_TAB'.&lt;/P&gt;&lt;P&gt;append ls_fieldcatalog to lt_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-fieldname = 'INITIATED_DATE'.&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-tabname = 'LT_TAB'.&lt;/P&gt;&lt;P&gt;append ls_fieldcatalog to lt_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-fieldname = 'END_DATE'.&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-tabname = 'LT_TAB'.&lt;/P&gt;&lt;P&gt;append ls_fieldcatalog to lt_fieldcatalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-fieldname = 'WINNER'.&lt;/P&gt;&lt;P&gt;ls_fieldcatalog-tabname = 'LT_TAB'.&lt;/P&gt;&lt;P&gt;append ls_fieldcatalog to lt_fieldcatalog.&lt;/P&gt;&lt;P&gt;&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;exporting&lt;/P&gt;&lt;P&gt;it_fieldcatalog = lt_fieldcatalog&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;ep_table = &amp;lt;fs_data&amp;gt;&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;generate_subpool_dir_full = 1&lt;/P&gt;&lt;P&gt;others = 2&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;if sy-subrc 0.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign &amp;lt;fs_data&amp;gt;-&amp;gt;* to &amp;lt;fs_1&amp;gt;.&lt;/P&gt;&lt;P&gt;assign &amp;lt;fs_1&amp;gt; to &amp;lt;fs_2&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at &amp;lt;fs_2&amp;gt; assigning &amp;lt;fs_3&amp;gt;.&lt;/P&gt;&lt;P&gt;write: &amp;lt;fs_3&amp;gt;-pollid.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;one more example&lt;/STRONG&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;  type-pools : abap. &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;  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;  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;  start-of-selection. &lt;/P&gt;&lt;P&gt;    perform get_structure. &lt;/P&gt;&lt;P&gt;  perform create_dynamic_itab.      *********&lt;STRONG&gt;Creates a dyanamic internal table&lt;/STRONG&gt;********* &lt;/P&gt;&lt;P&gt;  perform get_data. &lt;/P&gt;&lt;P&gt;  perform write_out. &lt;/P&gt;&lt;P&gt;  form get_structure. &lt;/P&gt;&lt;P&gt;  data : idetails type abap_compdescr_tab, &lt;/P&gt;&lt;P&gt;       xdetails type abap_compdescr. &lt;/P&gt;&lt;P&gt;  data : ref_table_des type ref to cl_abap_structdescr. &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the structure of the table. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ref_table_des ?=  &lt;/P&gt;&lt;P&gt;      cl_abap_typedescr=&amp;gt;describe_by_name( p_table ). &lt;/P&gt;&lt;P&gt;  idetails[] = ref_table_des-&amp;gt;components[]. &lt;/P&gt;&lt;P&gt;    loop at idetails into xdetails. &lt;/P&gt;&lt;P&gt;    clear xfc. &lt;/P&gt;&lt;P&gt;    xfc-fieldname = xdetails-name . &lt;/P&gt;&lt;P&gt;    xfc-datatype = xdetails-type_kind. &lt;/P&gt;&lt;P&gt;    xfc-inttype = xdetails-type_kind. &lt;/P&gt;&lt;P&gt;    xfc-intlen = xdetails-length. &lt;/P&gt;&lt;P&gt;    xfc-decimals = xdetails-decimals. &lt;/P&gt;&lt;P&gt;    append xfc to ifc. &lt;/P&gt;&lt;P&gt;  endloop. &lt;/P&gt;&lt;P&gt;  endform. &lt;/P&gt;&lt;P&gt;  form create_dynamic_itab. &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create dynamic internal table and assign to FS &lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;    assign dy_table-&amp;gt;* to &amp;lt;dyn_table&amp;gt;. &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create dynamic work area and assign to FS &lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;  endform. &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;  form get_data. &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Select Data from table. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  select * into table &amp;lt;dyn_table&amp;gt; &lt;/P&gt;&lt;P&gt;             from (p_table). &lt;/P&gt;&lt;P&gt;  endform. &lt;/P&gt;&lt;P&gt;   Write out data from table. &lt;/P&gt;&lt;P&gt;  loop at &amp;lt;dyn_table&amp;gt; into &amp;lt;dyn_wa&amp;gt;. &lt;/P&gt;&lt;P&gt;    do. &lt;/P&gt;&lt;P&gt;      assign component  sy-index   &lt;/P&gt;&lt;P&gt;         of structure &amp;lt;dyn_wa&amp;gt; to &amp;lt;dyn_field&amp;gt;. &lt;/P&gt;&lt;P&gt;      if sy-subrc &amp;lt;&amp;gt; 0. &lt;/P&gt;&lt;P&gt;        exit. &lt;/P&gt;&lt;P&gt;      endif. &lt;/P&gt;&lt;P&gt;      if sy-index = 1. &lt;/P&gt;&lt;P&gt;        write:/ &amp;lt;dyn_field&amp;gt;. &lt;/P&gt;&lt;P&gt;      else. &lt;/P&gt;&lt;P&gt;        write: &amp;lt;dyn_field&amp;gt;. &lt;/P&gt;&lt;P&gt;      endif. &lt;/P&gt;&lt;P&gt;    enddo. &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;HR originaltext="-------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZCLUST1 . &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Example: how to create a dynamic internal table &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The dynamic internal table stucture &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: BEGIN OF STRUCT OCCURS 10, &lt;/P&gt;&lt;P&gt;    FILDNAME(8) TYPE C, &lt;/P&gt;&lt;P&gt;    ABPTYPE TYPE C, &lt;/P&gt;&lt;P&gt;    LENGTH TYPE I, &lt;/P&gt;&lt;P&gt;END OF STRUCT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The dynamic program source table &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;DATA: BEGIN OF INCTABL OCCURS 10, &lt;/P&gt;&lt;P&gt;    LINE(72), &lt;/P&gt;&lt;P&gt;END OF INCTABL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: LNG TYPE I, TYPESRTING(6). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Sample dynamic internal table stucture &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;STRUCT-FILDNAME = 'field1'. STRUCT-ABPTYPE = 'c'. STRUCT-LENGTH = '6'. &lt;/P&gt;&lt;P&gt;APPEND STRUCT. CLEAR STRUCT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRUCT-FILDNAME = 'field2'. STRUCT-ABPTYPE = 'd'. &lt;/P&gt;&lt;P&gt;APPEND STRUCT. CLEAR STRUCT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STRUCT-FILDNAME = 'field3'. STRUCT-ABPTYPE = 'i'. &lt;/P&gt;&lt;P&gt;APPEND STRUCT. CLEAR STRUCT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create the dynamic internal table definition in the dyn. program &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INCTABL-LINE = 'program zdynpro.'. APPEND INCTABL. &lt;/P&gt;&lt;P&gt;INCTABL-LINE = 'data: begin of dyntab occurs 10,'. APPEND INCTABL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT STRUCT. &lt;/P&gt;&lt;P&gt;  INCTABL-LINE = STRUCT-FILDNAME. &lt;/P&gt;&lt;P&gt;  LNG = STRLEN( STRUCT-FILDNAME ). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF NOT STRUCT-LENGTH IS INITIAL . &lt;/P&gt;&lt;P&gt;      TYPESRTING(1) = '('. &lt;/P&gt;&lt;P&gt;      TYPESRTING+1 = STRUCT-LENGTH. &lt;/P&gt;&lt;P&gt;      TYPESRTING+5 = ')'. &lt;/P&gt;&lt;P&gt;      CONDENSE TYPESRTING NO-GAPS. &lt;/P&gt;&lt;P&gt;      INCTABL-LINE+LNG = TYPESRTING. &lt;/P&gt;&lt;P&gt;  ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  INCTABL-LINE+15 = 'type '. &lt;/P&gt;&lt;P&gt;  INCTABL-LINE+21 = STRUCT-ABPTYPE. &lt;/P&gt;&lt;P&gt;  INCTABL-LINE+22 = ','. &lt;/P&gt;&lt;P&gt;  APPEND INCTABL. &lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;INCTABL-LINE = 'end of dyntab. '. &lt;/P&gt;&lt;P&gt;APPEND INCTABL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create the code processes the dynamic internal table &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INCTABL-LINE = ' '. APPEND INCTABL. &lt;/P&gt;&lt;P&gt;INCTABL-LINE = 'dyntab-field1 = ''aaaaaa''.'. APPEND INCTABL. &lt;/P&gt;&lt;P&gt;INCTABL-LINE = 'dyntab-field1 = ''19970814''.'. APPEND INCTABL. &lt;/P&gt;&lt;P&gt;INCTABL-LINE = 'dyntab-field1 = 1.'. APPEND INCTABL. &lt;/P&gt;&lt;P&gt;INCTABL-LINE = 'append dyntab.'. APPEND INCTABL. &lt;/P&gt;&lt;P&gt;INCTABL-LINE = ' '. APPEND INCTABL. &lt;/P&gt;&lt;P&gt;INCTABL-LINE = 'loop at dyntab.'. APPEND INCTABL. &lt;/P&gt;&lt;P&gt;INCTABL-LINE = 'write: / dyntab.'. APPEND INCTABL. &lt;/P&gt;&lt;P&gt;INCTABL-LINE = 'endloop.'. APPEND INCTABL. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create and run the dynamic program &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;INSERT REPORT 'zdynpro'(001) FROM INCTABL. &lt;/P&gt;&lt;P&gt;SUBMIT ZDYNPRO. &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;HR originaltext="-------------------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or Just try out this simpler dynamic internal tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: itab TYPE STANDARD TABLE OF spfli, &lt;/P&gt;&lt;P&gt;              wa LIKE LINE OF itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: line(72) TYPE c, &lt;/P&gt;&lt;P&gt;            list LIKE TABLE OF line(72). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION. &lt;/P&gt;&lt;P&gt;*line = ' CITYFROM CITYTO '. &lt;/P&gt;&lt;P&gt;  line = ' AIRPTO '. &lt;/P&gt;&lt;P&gt; APPEND line TO list. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT DISTINCT (list) &lt;/P&gt;&lt;P&gt;       INTO CORRESPONDING FIELDS OF TABLE itab &lt;/P&gt;&lt;P&gt;            FROM spfli. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc EQ 0. &lt;/P&gt;&lt;P&gt;  LOOP AT itab INTO wa. &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    WRITE: / wa-cityfrom, wa-cityto. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;       WRITE &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; wa-airpto. &lt;/P&gt;&lt;P&gt;  ENDLOOP. &lt;/P&gt;&lt;P&gt;ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also have a look at below weblog:&lt;/P&gt;&lt;P&gt;/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It gives you info abt how to create dynamic internal table.&lt;/P&gt;&lt;P&gt;see this program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 05:12:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677611#M885684</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T05:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: reg internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677612#M885685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4972543"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4817594"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 05:12:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677612#M885685</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T05:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: reg internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677613#M885686</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 Table&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           An internal table is a temporary table stored in RAM on the application server. It is created and filled by a program during execution and is discarded when the program ends. Like a database table, an internal table consists of one or more rows with an identical structure, but unlike a database table, it cannot hold data after the program ends. Use it as temporary storage for manipulating data or as a temporary private buffer.&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;STRONG&gt;Definition of an Internal Table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;An internal table consists of a body and an optional header line .  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The body holds the rows of the internal table. All rows within it have the same structure. The term "internal table" itself usually refers to the body of the internal table.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The header line is a field string with the same structure as a row of the body, but it can only hold a single row. It is a buffer used to hold each record before it is added or each record as it is retrieved from the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To define an internal table body, use occurs n on the definition of any field string except tables. occurs creates the body of the internal table. The memory for the body is not allocated until the first row is added to it. Without occurs, you only have a field string. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To define an internal table with a header line, you must include either begin of or with header line in the definition. A header line is automatically created if begin of appears in the definition. If you use like instead of begin of, the internal table will not have a header line unless you add with header line after the occurs clause. This is illustrated in lines 2 through 10 of Listing 11.1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only time you would create an internal table without a header line is in the case of a nested internal table. A nested internal table cannot have a header line. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Listing 11.1  Basic Ways of Defining Internal Tables with and Without a Header Line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 1 report ztx1101.&lt;/P&gt;&lt;P&gt; 2 data: begin of it1 occurs 10,          "has a header line&lt;/P&gt;&lt;P&gt; 3         f1,&lt;/P&gt;&lt;P&gt; 4         f2,&lt;/P&gt;&lt;P&gt; 5         f3,&lt;/P&gt;&lt;P&gt; 6         end of it1.&lt;/P&gt;&lt;P&gt; 7&lt;/P&gt;&lt;P&gt; 8 data it2 like ztxlfa1 occurs 100.      "doesn't have a header line&lt;/P&gt;&lt;P&gt; 9&lt;/P&gt;&lt;P&gt;10 data it3 like ztxlfa1 occurs 100 with header line. "it does now&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reward if useful&lt;/STRONG&gt;&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; Shankar GJ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Shankar GJ on Apr 11, 2008 7:16 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 05:16:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677613#M885686</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T05:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: reg internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677614#M885687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;iam unable to understand the above declaration&lt;/P&gt;&lt;P&gt;dy_table type ref to data(here data seems....)&lt;/P&gt;&lt;P&gt;that means wt it is referring.pls tell me iam new to oop&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Apr 2008 06:47:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-tables/m-p/3677614#M885687</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-11T06:47:07Z</dc:date>
    </item>
  </channel>
</rss>

