<?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: 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/2123478#M445364</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi manik&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dynamic tables can be created by&lt;/P&gt;&lt;P&gt;function module BCALV_TABLE_CREATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another method is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the help of Class cl_alv_table_create &lt;/P&gt;&lt;P&gt;and the method create_dynamic_table , you can create Dynamic Internal Tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also go thro these blogs these mite help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table:///people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap:///people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap&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;navjot&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward for helpfull answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Apr 2007 09:43:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-02T09:43:31Z</dc:date>
    <item>
      <title>Dynamic Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/2123474#M445360</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 want to generate internal tables depending upon the no. of lines in the internal table . For example if there are 5 rows in an internal table itab, then I want to generate 5 internal tables of name like itab1, itab2 itab3 itab4 itab5. Is there any way to do this??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls Suggest.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 09:34:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/2123474#M445360</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-02T09:34:27Z</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/2123475#M445361</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;Check this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA path LIKE ibipparms-path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: i_excel LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: i_fcat type LVC_T_FCAT,&lt;/P&gt;&lt;P&gt;wa_fcat type lvc_s_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: fname(10),&lt;/P&gt;&lt;P&gt;I_PTABLE TYPE REF TO DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-001.&lt;/P&gt;&lt;P&gt;PARAMETERS p_path LIKE rlgrap-filename OBLIGATORY.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK b.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fs_final&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;&amp;lt;I_TABLE&amp;gt; type table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'F4_FILENAME'&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;file_name = path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;p_path = path.&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;filename = p_path&lt;/P&gt;&lt;P&gt;i_begin_col = 1&lt;/P&gt;&lt;P&gt;i_begin_row = 1&lt;/P&gt;&lt;P&gt;i_end_col = 256&lt;/P&gt;&lt;P&gt;i_end_row = 65536&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;intern = i_excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_excel where row = '1'.&lt;/P&gt;&lt;P&gt;wa_fcat-ROW_POS = i_excel-row.&lt;/P&gt;&lt;P&gt;wa_fcat-col_pos = i_excel-col.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;concatenate 'COL_' i_excel-col into fname.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;wa_fcat-FIELDNAME = I_EXCEL-VALUE.&lt;/P&gt;&lt;P&gt;append wa_fcat to i_fcat.&lt;/P&gt;&lt;P&gt;endloop.&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 = I_FCAT&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;EP_TABLE = I_PTABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assign i_ptable-&amp;gt;* to &amp;lt;i_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform zf_assign.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT I_FCAT INTO WA_FCAT .&lt;/P&gt;&lt;P&gt;WRITE: WA_FCAT-FIELDNAME(10).&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;I_TABLE&amp;gt; assigning &amp;lt;fs_final&amp;gt;.&lt;/P&gt;&lt;P&gt;WRITE:/ &amp;lt;fs_final&amp;gt;.&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;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form zf_assign&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt; p1 text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;lt;-- p2 text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form zf_assign .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;ls_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN LOCAL COPY OF INITIAL LINE OF &amp;lt;I_TABLE&amp;gt; TO &amp;lt;LS_TABLE&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT i_excel WHERE ROW &amp;lt;&amp;gt; 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT i_excel-col OF STRUCTURE &amp;lt;LS_TABLE&amp;gt; TO &amp;lt;fs_final&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;lt;fs_final&amp;gt; = i_excel-value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT END OF row.&lt;/P&gt;&lt;P&gt;APPEND &amp;lt;LS_TABLE&amp;gt; TO &amp;lt;i_table&amp;gt;.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unassign &amp;lt;ls_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform. " zf_assign&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 09:38:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/2123475#M445361</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-02T09:38:04Z</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/2123476#M445362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can create dynamic table using field symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and by calling floowing method:&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&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 09:38:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/2123476#M445362</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-02T09:38:15Z</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/2123477#M445363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOL &amp;lt;fs_table&amp;gt; TYPE TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create dynamic table (according to fieldcatalog)&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 = lt_fieldcatalog&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      ep_table        = lr_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ASSIGN lr_table-&amp;gt;* TO &amp;lt;fs_table&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 09:39:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/2123477#M445363</guid>
      <dc:creator>pavel_parshenkov2</dc:creator>
      <dc:date>2007-04-02T09:39:05Z</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/2123478#M445364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi manik&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dynamic tables can be created by&lt;/P&gt;&lt;P&gt;function module BCALV_TABLE_CREATE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another method is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With the help of Class cl_alv_table_create &lt;/P&gt;&lt;P&gt;and the method create_dynamic_table , you can create Dynamic Internal Tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also go thro these blogs these mite help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table:///people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="/people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap:///people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap&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;navjot&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward for helpfull answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 09:43:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/2123478#M445364</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-02T09:43:31Z</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/2123479#M445365</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;Thanks for all ur replies but my requirement is different.&lt;/P&gt;&lt;P&gt;I want to generate internal table dynamically but the here dynamic is the number of internal tables to be generated not the structure of the internal table. The structure is same but I have to generate as many internal table as there are rows in the other internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Manik Dhakate&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 09:45:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/2123479#M445365</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-02T09:45:04Z</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/2123480#M445366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;manik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Find the totla number of rows in Internal table by using Syntax&lt;/P&gt;&lt;P&gt;" Describe table xxxx lines v_line"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use do loop v_line times where the columns and name of the table getting assigned in below coding.&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;&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;&lt;/P&gt;&lt;P&gt;Pls. reward if useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 09:45:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/2123480#M445366</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-02T09:45:58Z</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/2123481#M445367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use describe table to find number of lines in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then create dynamic internal tables .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use do n times. " n is num of lines in ur master itab&lt;/P&gt;&lt;P&gt;create dynamic internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 09:47:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/2123481#M445367</guid>
      <dc:creator>Azeemquadri</dc:creator>
      <dc:date>2007-04-02T09:47:07Z</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/2123482#M445368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Azeem,&lt;/P&gt;&lt;P&gt;Thanks for ur reply I tried the way u said but it is giving some error.&lt;/P&gt;&lt;P&gt;I Am posting the code which I tried, &lt;/P&gt;&lt;P&gt; LOOP AT it_matmaster.&lt;/P&gt;&lt;P&gt;  int = sy-tabix.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;DATA: begin of it_data + int occurs 0.&lt;/P&gt;&lt;P&gt;       include structure STPOX.&lt;/P&gt;&lt;P&gt;DATA: end of it_data+int.    &lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz Suggest.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 09:51:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/2123482#M445368</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-02T09:51:13Z</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/2123483#M445369</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;for this u have to use the function module "rss_template_instantiate".&lt;/P&gt;&lt;P&gt;then only it is ppossible to generate the program dynamically according to ur requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2007 10:10:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/2123483#M445369</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-02T10:10:25Z</dc:date>
    </item>
  </channel>
</rss>

