<?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/4482264#M1061202</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;any idea, how I can define an internal table with dynamic fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create an customizing table with one field and the values from this field, should set the internal table.&lt;/P&gt;&lt;P&gt;e.g. Marc-matnr and marc-vkorg stands inside the customizing table,&lt;/P&gt;&lt;P&gt;      internal table should define then with 2 fields like marc-matnr and marc-vkorg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Nicole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Sep 2008 12:49:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-15T12:49:34Z</dc:date>
    <item>
      <title>Dynamic internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4482264#M1061202</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;any idea, how I can define an internal table with dynamic fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create an customizing table with one field and the values from this field, should set the internal table.&lt;/P&gt;&lt;P&gt;e.g. Marc-matnr and marc-vkorg stands inside the customizing table,&lt;/P&gt;&lt;P&gt;      internal table should define then with 2 fields like marc-matnr and marc-vkorg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Nicole&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2008 12:49:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4482264#M1061202</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-15T12:49:34Z</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/4482265#M1061203</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|http://www.sap-img.com/ab030.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2008 12:51:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4482265#M1061203</guid>
      <dc:creator>bpawanchand</dc:creator>
      <dc:date>2008-09-15T12:51:34Z</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/4482266#M1061204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check this sample code:&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;P&gt;  r_dyn_table      TYPE REF TO data,&lt;/P&gt;&lt;P&gt;  r_wa_dyn_table   TYPE REF TO data,&lt;/P&gt;&lt;P&gt;  r_dock_ctnr      TYPE REF TO cl_gui_docking_container,&lt;/P&gt;&lt;P&gt;  r_alv_grid       TYPE REF TO cl_gui_alv_grid,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  t_fieldcat1      TYPE lvc_t_fcat,           "with cell color&lt;/P&gt;&lt;P&gt;  t_fieldcat2      TYPE lvc_t_fcat,           "without cell color&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  wa_fieldcat      LIKE LINE OF t_fieldcat1,&lt;/P&gt;&lt;P&gt;  wa_cellcolors    TYPE LINE OF lvc_t_scol,&lt;/P&gt;&lt;P&gt;  wa_is_layout     TYPE lvc_s_layo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS:&lt;/P&gt;&lt;P&gt;  &amp;lt;t_dyn_table&amp;gt;    TYPE STANDARD TABLE,&lt;/P&gt;&lt;P&gt;  &amp;lt;wa_dyn_table&amp;gt;   TYPE ANY,&lt;/P&gt;&lt;P&gt;  &amp;lt;t_cellcolors&amp;gt;   TYPE lvc_t_scol,&lt;/P&gt;&lt;P&gt;  &amp;lt;w_field&amp;gt;        TYPE ANY.&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Build field catalog based on your criteria.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  wa_fieldcat-fieldname = 'FIELD1'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat-inttype   = 'C'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat-outputlen = '10'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat-coltext   = 'My Field 1'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat-seltext   = wa_fieldcat-coltext.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND wa_fieldcat TO t_fieldcat1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  wa_fieldcat-fieldname = 'FIELD2'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat-inttype   = 'C'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat-outputlen = '10'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat-coltext   = 'My Field 2'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat-seltext   = wa_fieldcat-coltext.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND wa_fieldcat TO t_fieldcat1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Before adding cell color table, save fieldcatalog to pass&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; to ALV call.  The ALV call needs a fieldcatalog without&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; the internal table for cell coloring.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  t_fieldcat2[] = t_fieldcat1[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add cell color table.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; CALENDAR_TYPE is a structure in the dictionary with a&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  field called COLTAB of type LVC_T_SCOL.  You can use&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  any structure and field that has the type LVC_T_SCOL.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  wa_fieldcat-fieldname = 'T_CELLCOLORS'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat-ref_field = 'COLTAB'.&lt;/P&gt;&lt;P&gt;  wa_fieldcat-ref_table = 'CALENDAR_TYPE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND wa_fieldcat TO t_fieldcat1.&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 including the internal table&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; for cell coloring.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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           = t_fieldcat1&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      ep_table                  = r_dyn_table&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 &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno&lt;/P&gt;&lt;P&gt;               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get access to new table using field symbol.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ASSIGN r_dyn_table-&amp;gt;* TO &amp;lt;t_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 work area for new table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CREATE DATA r_wa_dyn_table LIKE LINE OF &amp;lt;t_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;Get access to new work area using field symbol.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ASSIGN r_wa_dyn_table-&amp;gt;* TO &amp;lt;wa_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;Get data into table from somewhere.  Field names are&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; known at this point because field catalog is already&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; built.  Read field names from the field catalog or use&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; COMPONENT &amp;lt;number&amp;gt; in a DO loop to access the fields.  A&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; simpler hard coded approach is used here.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ASSIGN COMPONENT 'FIELD1' OF STRUCTURE &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;w_field&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;w_field&amp;gt; = 'ABC'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ASSIGN COMPONENT 'FIELD2' OF STRUCTURE &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;w_field&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;w_field&amp;gt; = 'XYZ'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;t_dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ASSIGN COMPONENT 'FIELD1' OF STRUCTURE &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;w_field&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;w_field&amp;gt; = 'TUV'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ASSIGN COMPONENT 'FIELD2' OF STRUCTURE &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;w_field&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &amp;lt;w_field&amp;gt; = 'DEF'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;t_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;Color cells based on your criteria.  In this example, a test on&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; FIELD2 is used to decide on color.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT &amp;lt;t_dyn_table&amp;gt; INTO &amp;lt;wa_dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT 'FIELD2' OF STRUCTURE &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;w_field&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Get access to internal table used to color cells.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT 'T_CELLCOLORS'&lt;/P&gt;&lt;P&gt;      OF STRUCTURE &amp;lt;wa_dyn_table&amp;gt; TO &amp;lt;t_cellcolors&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR wa_cellcolors.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    wa_cellcolors-fname = 'FIELD2'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF &amp;lt;w_field&amp;gt; = 'DEF'.&lt;/P&gt;&lt;P&gt;      wa_cellcolors-color-col = '7'.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      wa_cellcolors-color-col = '5'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND wa_cellcolors TO &amp;lt;t_cellcolors&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    MODIFY &amp;lt;t_dyn_table&amp;gt; FROM &amp;lt;wa_dyn_table&amp;gt;.&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; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Display screen.  Define screen 100 as empty, with next screen&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; set to 0 and flow logic of:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   PROCESS BEFORE OUTPUT.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     MODULE initialization.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   PROCESS AFTER INPUT.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL SCREEN 100.&lt;/P&gt;&lt;P&gt;&lt;/P&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; MODULE initialization OUTPUT&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;&lt;/P&gt;&lt;P&gt;MODULE initialization OUTPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set up for ALV display.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF r_dock_ctnr IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CREATE OBJECT r_dock_ctnr&lt;/P&gt;&lt;P&gt;           EXPORTING&lt;/P&gt;&lt;P&gt;              side  = cl_gui_docking_container=&amp;gt;dock_at_left&lt;/P&gt;&lt;P&gt;              ratio = '90'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CREATE OBJECT r_alv_grid&lt;/P&gt;&lt;P&gt;           EXPORTING i_parent = r_dock_ctnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Set ALV controls for cell coloring table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    wa_is_layout-ctab_fname = 'T_CELLCOLORS'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Display.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD r_alv_grid-&amp;gt;set_table_for_first_display&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        is_layout       = wa_is_layout&lt;/P&gt;&lt;P&gt;      CHANGING&lt;/P&gt;&lt;P&gt;        it_outtab       = &amp;lt;t_dyn_table&amp;gt;&lt;/P&gt;&lt;P&gt;        it_fieldcatalog = t_fieldcat2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE.     "grid already prepared&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Refresh display.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL METHOD r_alv_grid-&amp;gt;refresh_table_display&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        i_soft_refresh = ' '&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        finished       = 1&lt;/P&gt;&lt;P&gt;        OTHERS         = 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " initialization  OUTPUT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2008 12:52:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4482266#M1061204</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-15T12:52: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/4482267#M1061205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One approach...&lt;/P&gt;&lt;P&gt;populate the fieldcatalog with the fields which you want(matnr etc..)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using the method cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;&lt;P&gt;create the dynamic table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the sample code , how to work with Dynamic tables.&lt;/P&gt;&lt;P&gt;Also search in the forum you get lot of posts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ztest_dynamic.
 
DATA: t_fcat TYPE lvc_t_fcat,
      itab   type ref to data,
      wa     type ref to data.
data: it_vbap type vbap_t,
      wa_vbap type vbap.
 
field-symbols: &amp;lt;final&amp;gt; type standard table,
               &amp;lt;fs_wa&amp;gt; type any,
               &amp;lt;fs&amp;gt; type any.
 
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
 EXPORTING
   I_STRUCTURE_NAME             = 'VBAP'
  CHANGING
    ct_fieldcat                  = t_fcat
 EXCEPTIONS
   INCONSISTENT_INTERFACE       = 1
   PROGRAM_ERROR                = 2
          .
CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
EXPORTING
it_fieldcatalog = t_fcat
IMPORTING
ep_table = itab.
 
ASSIGN itab-&amp;gt;* TO &amp;lt;final&amp;gt;.
 
create data wa like line of &amp;lt;final&amp;gt;.
assign wa-&amp;gt;* to &amp;lt;fs_wa&amp;gt;.
 
select * from vbap
into table it_vbap
up to 2 rows.
 
loop at it_vbap into wa_vbap.
 
assign component 'NETPR' of structure &amp;lt;fs_wa&amp;gt; to &amp;lt;fs&amp;gt;.
if sy-subrc eq 0.
  &amp;lt;fs&amp;gt; = wa_vbap-netpr.
  write:/ &amp;lt;fs&amp;gt;.
endif.
 
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2008 12:53:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4482267#M1061205</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-15T12:53:39Z</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/4482268#M1061206</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;   Try the below coding..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES : begin of ls_itab,&lt;/P&gt;&lt;P&gt;              matnr type matnr,&lt;/P&gt;&lt;P&gt;             vkorg type vkorg,&lt;/P&gt;&lt;P&gt;             end of ls_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : lt_itab type table of ls_itab, &lt;/P&gt;&lt;P&gt;           wa_itab like line of ls_itab.&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;Saran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2008 12:54:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4482268#M1061206</guid>
      <dc:creator>saranwin</dc:creator>
      <dc:date>2008-09-15T12:54: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/4482269#M1061207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; HI,&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt;    Try the below coding..&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; TYPES : begin of ls_itab,&lt;/P&gt;&lt;P&gt;&amp;gt;               matnr type matnr,&lt;/P&gt;&lt;P&gt;&amp;gt;              vkorg type vkorg,&lt;/P&gt;&lt;P&gt;&amp;gt;              end of ls_itab.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; DATA : lt_itab type table of ls_itab, &lt;/P&gt;&lt;P&gt;&amp;gt;            wa_itab like line of ls_itab.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; Regards,&lt;/P&gt;&lt;P&gt;&amp;gt; Saran&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Great.&lt;/P&gt;&lt;P&gt;Than how can i generate internal table statically?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Sep 2008 12:57:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4482269#M1061207</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-15T12:57:18Z</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/4482270#M1061208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nicole&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may want to have a look at [Creating Flat and Complex Internal Tables Dynamically using RTTI |https://wiki.sdn.sap.com/wiki/display/Snippets/Creating&lt;EM&gt;Flat&lt;/EM&gt;and&lt;EM&gt;Complex&lt;/EM&gt;Internal&lt;EM&gt;Tables&lt;/EM&gt;Dynamically&lt;EM&gt;using&lt;/EM&gt;RTTI]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RTTI requires at least SAP release &amp;gt;= 6.20.&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;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2008 07:49:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4482270#M1061208</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-09-16T07:49:47Z</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/4482271#M1061209</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;   Just runn this code and follow the comments provided.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type-pools: slis.&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;&lt;/P&gt;&lt;P&gt;data: alv_fldcat type slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;it_fldcat type lvc_t_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of block b1 with frame title text-001.&lt;/P&gt;&lt;P&gt;parameters: p_flds(5) type c.&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;&lt;/P&gt;&lt;P&gt;*build the dynamic internal table&lt;/P&gt;&lt;P&gt;perform build_dyn_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*write 5 records to the alv grid&lt;/P&gt;&lt;P&gt;do 5 times.&lt;/P&gt;&lt;P&gt;perform build_report.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*call the alv grid.&lt;/P&gt;&lt;P&gt;perform call_alv.&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;P&gt;*Build_dyn_itab&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;form build_dyn_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: new_table type ref to data,&lt;/P&gt;&lt;P&gt;new_line type ref to data,&lt;/P&gt;&lt;P&gt;wa_it_fldcat type lvc_s_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Create fields .&lt;/P&gt;&lt;P&gt;clear wa_it_fldcat.&lt;/P&gt;&lt;P&gt;wa_it_fldcat-fieldname = 'name1'.&lt;/P&gt;&lt;P&gt;wa_it_fldcat-datatype = 'mara-matnr'.&lt;/P&gt;&lt;P&gt;wa_it_fldcat-intlen = 5.&lt;/P&gt;&lt;P&gt;append wa_it_fldcat to it_fldcat .&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;*clear wa_it_fldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_it_fldcat-fieldname = sy-index.&lt;/P&gt;&lt;P&gt;wa_it_fldcat-datatype = 'CHAR'.&lt;/P&gt;&lt;P&gt;wa_it_fldcat-intlen = 5.&lt;/P&gt;&lt;P&gt;append wa_it_fldcat to it_fldcat .&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do p_flds times.&lt;/P&gt;&lt;P&gt;clear wa_it_fldcat.&lt;/P&gt;&lt;P&gt;wa_it_fldcat-fieldname = sy-index.&lt;/P&gt;&lt;P&gt;wa_it_fldcat-datatype = 'CHAR'.&lt;/P&gt;&lt;P&gt;wa_it_fldcat-intlen = 6.&lt;/P&gt;&lt;P&gt;append wa_it_fldcat to it_fldcat .&lt;/P&gt;&lt;P&gt;enddo.&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 = it_fldcat&lt;/P&gt;&lt;P&gt;importing&lt;/P&gt;&lt;P&gt;ep_table = new_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign new_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 new_line like line of &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;assign new_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;*Form build_report&lt;/P&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form build_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: fieldname(20) type c.&lt;/P&gt;&lt;P&gt;data: fieldvalue(5) type c.&lt;/P&gt;&lt;P&gt;data: index(3) type c.&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do p_flds times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;index = sy-index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Set up fieldvalue&lt;/P&gt;&lt;P&gt;concatenate 'FLD' index into&lt;/P&gt;&lt;P&gt;fieldvalue.&lt;/P&gt;&lt;P&gt;condense fieldvalue no-gaps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign component index of structure &amp;lt;dyn_wa&amp;gt; to &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;lt;fs1&amp;gt; = fieldvalue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Append to the dynamic internal table&lt;/P&gt;&lt;P&gt;append &amp;lt;dyn_wa&amp;gt; to &amp;lt;dyn_table&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;*CALL_ALV&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;form call_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: wa_cat like line of alv_fldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do p_flds times.&lt;/P&gt;&lt;P&gt;clear wa_cat.&lt;/P&gt;&lt;P&gt;wa_cat-fieldname = sy-index.&lt;/P&gt;&lt;P&gt;wa_cat-seltext_s = sy-index.&lt;/P&gt;&lt;P&gt;wa_cat-outputlen = '6'.&lt;/P&gt;&lt;P&gt;append wa_cat to alv_fldcat.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Call ABAP List Viewer (ALV)&lt;/P&gt;&lt;P&gt;call function 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;P&gt;it_fieldcat = alv_fldcat&lt;/P&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;t_outtab = &amp;lt;dyn_table&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;Hope this helps you,&lt;/P&gt;&lt;P&gt;Murthy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Sep 2008 08:11:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/4482271#M1061209</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-16T08:11:10Z</dc:date>
    </item>
  </channel>
</rss>

