<?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: how to create dynamic internal table....... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187465#M1200590</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;just refer it will definately help you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/dynamic%252binternal%252btable" target="test_blank"&gt;https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/dynamic%252binternal%252btable&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Feb 2009 09:56:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-19T09:56:13Z</dc:date>
    <item>
      <title>how to create dynamic internal table.......</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187464#M1200589</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;      I have one field p_tabname which has got the value KNA1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      I have 5 fields in my program i.e. &lt;STRONG&gt;F1 F1 F3 F4 F5&lt;/STRONG&gt; Their values are KUNNR, LAND1, ORT01, NAME1  &lt;/P&gt;&lt;P&gt;     and  TELF1. The values for the fields p_tabname and F1 F2 F3 F4 F5 come from selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     Now i want to create an internal table with these 5 fields .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     How can i achieve it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     Help will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     Thanks,&lt;/P&gt;&lt;P&gt;     Ibrahim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 09:54:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187464#M1200589</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T09:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to create dynamic internal table.......</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187465#M1200590</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;just refer it will definately help you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/dynamic%252binternal%252btable" target="test_blank"&gt;https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/dynamic%252binternal%252btable&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 09:56:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187465#M1200590</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T09:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to create dynamic internal table.......</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187466#M1200591</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;You can search the previous threads on dynamic internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx,&lt;/P&gt;&lt;P&gt;Pritha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 09:56:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187466#M1200591</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T09:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to create dynamic internal table.......</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187467#M1200592</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;Please check out his code and adapt:&lt;/P&gt;&lt;P&gt;&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;*----&lt;/P&gt;&lt;HR originaltext="--------" /&gt;&lt;P&gt; DATA DECLARATION&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;dyntable&amp;gt; type standard table.&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;dynline&amp;gt;  type any.&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;fld&amp;gt;      type any.&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;&lt;/P&gt;&lt;P&gt;data: i_fieldlist          type lvc_t_fcat,&lt;/P&gt;&lt;P&gt;      wa_fieldlist          type lvc_s_fcat,&lt;/P&gt;&lt;P&gt;      v_iname     like dd02l-tabname,&lt;/P&gt;&lt;P&gt;      fldname(50) type c,&lt;/P&gt;&lt;P&gt;      c(6)        type c,&lt;/P&gt;&lt;P&gt;     i_table_fieldlist like ddfield occurs 0 with header line,&lt;/P&gt;&lt;P&gt;     i_data            type ref to data,&lt;/P&gt;&lt;P&gt;     lv_number_of_recs type i value 10,&lt;/P&gt;&lt;P&gt;     lv_char(6)        type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------" /&gt;&lt;P&gt;SELECTION SCREEN&lt;/P&gt;&lt;P&gt;parameters : p_table(25) type c obligatory default 'MARA',&lt;/P&gt;&lt;P&gt;             num_flds  type n length 6 default 1,&lt;/P&gt;&lt;P&gt;             p_recs    type n length 6 default 10.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="----------------" /&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;  v_iname = p_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------" /&gt;&lt;P&gt;*STEP 1 : Creating the field list .i.e. specifying all fields that&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        will be displayed in the report.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Getting all fields of the specified table in internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call function 'DD_NAMETAB_TO_DDFIELDS'&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      tabname  = v_iname&lt;/P&gt;&lt;P&gt;    tables&lt;/P&gt;&lt;P&gt;      ddfields = i_table_fieldlist.&lt;/P&gt;&lt;P&gt;  "CONSTRUCT FIELD LIST&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Adding all additional fields required&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  loop at i_table_fieldlist.&lt;/P&gt;&lt;P&gt;    wa_fieldlist-fieldname = i_table_fieldlist-fieldname.&lt;/P&gt;&lt;P&gt;    append wa_fieldlist to i_fieldlist.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ADDING CUSTOM FIELDS TO FIELD CATALOG&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;HERE WE ARE ADDING FIELDS OF TYPE C LENGHT 1&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  if  num_flds &amp;gt; 0.&lt;/P&gt;&lt;P&gt;    do num_flds times.&lt;/P&gt;&lt;P&gt;      c = sy-index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      clear wa_fieldlist-fieldname.&lt;/P&gt;&lt;P&gt;      concatenate 'FIELD' c into wa_fieldlist-fieldname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      condense wa_fieldlist-fieldname no-gaps.&lt;/P&gt;&lt;P&gt;      append wa_fieldlist to i_fieldlist.&lt;/P&gt;&lt;P&gt;    enddo.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------" /&gt;&lt;P&gt;*STEP 2 : Generating an empty internal table (i_data) with all fields in our&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        field list table. This table will be filled with data further&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        and used for the report display&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------" /&gt;&lt;P&gt;  assign i_data to &amp;lt;fs_data&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*CREATING INTERNAL TABLE TO DISPLAY ALV DATA&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_fieldlist&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;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    message i023(zxxxfi) with 'Error while creating table'.&lt;/P&gt;&lt;P&gt;    stop.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------" /&gt;&lt;P&gt;*STEP 3 : Creating Dynamic field catalog which will be used to display report&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        NOTE: The field list table created above cannnot be used&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;              as it doesnot have same structure as required in FM&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;              REUSE_ALV_GRID_DISPLAY&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------" /&gt;&lt;P&gt;*CREATING FIELDCATALOG FOR PASSING TO REUSE_ALV_GRID_DISPLAY&lt;/P&gt;&lt;P&gt;  data:i_fieldcat   type slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;       wa_fieldcat  type slis_fieldcat_alv,&lt;/P&gt;&lt;P&gt;       lv_field_num type i,&lt;/P&gt;&lt;P&gt;       lv_var(6)     type c,&lt;/P&gt;&lt;P&gt;       lv_title type lvc_title.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at i_fieldlist into wa_fieldlist.&lt;/P&gt;&lt;P&gt;    move-corresponding wa_fieldlist to wa_fieldcat.&lt;/P&gt;&lt;P&gt;    wa_fieldcat-seltext_s = wa_fieldcat-fieldname.&lt;/P&gt;&lt;P&gt;    wa_fieldcat-seltext_l = wa_fieldcat-fieldname.&lt;/P&gt;&lt;P&gt;    wa_fieldcat-seltext_m = wa_fieldcat-fieldname.&lt;/P&gt;&lt;P&gt;    append wa_fieldcat to i_fieldcat.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  describe table i_fieldcat lines  lv_field_num.&lt;/P&gt;&lt;P&gt;  lv_var = lv_field_num.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------" /&gt;&lt;P&gt;*STEP 4 : SETTING GRID TITLE&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------" /&gt;&lt;P&gt;  concatenate 'TABLE WITH '&lt;/P&gt;&lt;P&gt;               lv_var&lt;/P&gt;&lt;P&gt;               'FIELDS'&lt;/P&gt;&lt;P&gt;          into lv_title&lt;/P&gt;&lt;P&gt;          separated by space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------" /&gt;&lt;P&gt;*STEP 5 : Filling of internal table&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------" /&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; FILLING INTERNAL TABLE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;dyntable&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  field-symbols:&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_line  type ref to data.&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;dyntable&amp;gt;.   " creating a line type of the table just created above&lt;/P&gt;&lt;P&gt;  assign dy_line-&amp;gt;* to &amp;lt;dyn_wa&amp;gt;.                 " creating the work area with reference to the line type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if p_recs is not initial.&lt;/P&gt;&lt;P&gt;    lv_number_of_recs = p_recs.&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;All fields are stored in table i_fieldcat as rows&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;All fields are stored in table &amp;lt;dyntable&amp;gt; as columns&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Hence we have to loop at i_fieldcat to get each field where sy-tabix stores the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  corresponding column number of the field to be filled in the work-area &amp;lt;dyn_wa&amp;gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  then we have to fill each column/field in the work area in the loop&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  do lv_number_of_recs times.&lt;/P&gt;&lt;P&gt;    lv_char = sy-index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at i_fieldcat into wa_fieldcat. " loop at fieldcat to get all fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      assign component  sy-tabix               "accessing corresponding field in the field catalog&lt;/P&gt;&lt;P&gt;         of structure &amp;lt;dyn_wa&amp;gt; to &amp;lt;dyn_field&amp;gt;. "and assigning this field to a field symbol&lt;/P&gt;&lt;P&gt;      if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        &amp;lt;dyn_field&amp;gt; = lv_char.                 " filling value for this field&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    append  &amp;lt;dyn_wa&amp;gt; to &amp;lt;dyntable&amp;gt;.&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------" /&gt;&lt;P&gt;*STEP 6 : Display report&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------------------------" /&gt;&lt;P&gt;  type-pools: slis.&lt;/P&gt;&lt;P&gt;data:wa_layout   type slis_layout_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*wa_layout-window_titlebar = 'Title'. "Overwrites title in title bar&lt;/P&gt;&lt;P&gt;&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;      i_grid_title  = lv_title&lt;/P&gt;&lt;P&gt;      it_fieldcat   = i_fieldcat&lt;/P&gt;&lt;P&gt;      i_default     = ' '&lt;/P&gt;&lt;P&gt;      is_layout    = wa_layout&lt;/P&gt;&lt;P&gt;      i_save        = 'A'&lt;/P&gt;&lt;P&gt;    tables&lt;/P&gt;&lt;P&gt;      t_outtab      = &amp;lt;dyntable&amp;gt;&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      program_error = 1&lt;/P&gt;&lt;P&gt;      others        = 2.&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;    stop.&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;regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 10:00:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187467#M1200592</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2009-02-19T10:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to create dynamic internal table.......</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187468#M1200593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;To create the table dynamically you need to go SHDB ( T code for recording  ) and record the table creation process and create a program from that recording and replace the table name and field vales etc from the parameters value ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pinaki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 10:01:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187468#M1200593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T10:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: how to create dynamic internal table.......</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187469#M1200594</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 this sample:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;PARAMETERS: P_TAB   TYPE DD02L-TABNAME.
PARAMETERS: FIELD1  TYPE LVC_FNAME,
            FIELD2  TYPE LVC_FNAME,
            FIELD3  TYPE LVC_FNAME,
            FIELD4  TYPE LVC_FNAME,
            FIELD5  TYPE LVC_FNAME.

DATA: T_CATALOG TYPE  LVC_T_FCAT.

DATA: MY_TABLE TYPE REF TO DATA,
      MY_LINE  TYPE REF TO DATA.

FIELD-SYMBOLS: &amp;lt;DYN_TABLE&amp;gt; TYPE TABLE,
               &amp;lt;WA&amp;gt; TYPE ANY.

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
     EXPORTING
          I_STRUCTURE_NAME       = P_TAB
     CHANGING
          CT_FIELDCAT            = T_CATALOG
     EXCEPTIONS
          INCONSISTENT_INTERFACE = 1
          PROGRAM_ERROR          = 2
          OTHERS                 = 3.

IF SY-SUBRC &amp;lt;&amp;gt; 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

LOOP AT T_CATALOG TRANSPORTING NO FIELDS
                  WHERE FIELDNAME &amp;lt;&amp;gt; FIELD1 AND
                        FIELDNAME &amp;lt;&amp;gt; FIELD2 AND
                        FIELDNAME &amp;lt;&amp;gt; FIELD3 AND
                        FIELDNAME &amp;lt;&amp;gt; FIELD4 AND
                        FIELDNAME &amp;lt;&amp;gt; FIELD5.
  DELETE T_CATALOG.
ENDLOOP.

DESCRIBE TABLE T_CATALOG LINES SY-TABIX.
IF SY-TABIX &amp;gt; 1.

  CALL METHOD CL_ALV_TABLE_CREATE=&amp;gt;CREATE_DYNAMIC_TABLE
  EXPORTING
    IT_FIELDCATALOG = T_CATALOG
  IMPORTING
    EP_TABLE = MY_TABLE
  EXCEPTIONS
    GENERATE_SUBPOOL_DIR_FULL = 1
    OTHERS = 2.

  IF SY-SUBRC &amp;lt;&amp;gt; 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  ASSIGN MY_TABLE-&amp;gt;* TO &amp;lt;DYN_TABLE&amp;gt;.
* Create a workarea
  CREATE DATA MY_LINE LIKE LINE OF &amp;lt;DYN_TABLE&amp;gt;.
  ASSIGN MY_LINE-&amp;gt;* TO &amp;lt;WA&amp;gt;.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 10:09:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187469#M1200594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T10:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to create dynamic internal table.......</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187470#M1200595</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;TABLES: mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: s_matnr FOR mara-matnr,&lt;/P&gt;&lt;P&gt;                             s_mtart FOR mara-mtart.&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab OCCURS 0,&lt;/P&gt;&lt;P&gt;            matnr LIKE mara-matnr,&lt;/P&gt;&lt;P&gt;            mtart LIKE mara-mtart,&lt;/P&gt;&lt;P&gt;            END OF itab,&lt;/P&gt;&lt;P&gt;            wa LIKE itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN OUTPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear itab.&lt;/P&gt;&lt;P&gt;  wa-matnr = s_matnr-low.&lt;/P&gt;&lt;P&gt;  wa-mtart = s_mtart-low.&lt;/P&gt;&lt;P&gt;  APPEND wa TO itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ve used only 2 select-options.&lt;/P&gt;&lt;P&gt;u use according to ur requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 10:12:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187470#M1200595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T10:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to create dynamic internal table.......</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187471#M1200596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;have a look&lt;/P&gt;&lt;P&gt;[Link1|http://www.sap-img.com/ab030.htm]&lt;/P&gt;&lt;P&gt;[link2|https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/dynamic%252binternal%252btable]&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shashi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Feb 2009 10:14:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187471#M1200596</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-19T10:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to create dynamic internal table.......</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187472#M1200597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey max,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       I dont have five fields on screen. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameters : p_tname(10) type c.&lt;/P&gt;&lt;P&gt;parameters : p_fname type rlgrap-filname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the second parameter, the user will give the field names as KUNNR,LAND1,NAME1,ORT01,TELF1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then i am splitting this p_fname into five fields separated by ',' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now i am getting the five values in five fields f1 to f5. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now how to create internal table with these 5 fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not able to proceed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the use of the function module LVC_FIELDCATALOG_MERGE for creating Internal Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Help will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ibrahim&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Feb 2009 09:34:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187472#M1200597</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-20T09:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to create dynamic internal table.......</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187473#M1200598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : wa_fcat TYPE lvc_s_fcat,&lt;/P&gt;&lt;P&gt;         it_fcat TYPE lvc_t_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATa: c_f1 type c value 'F1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fs_table&amp;gt; TYPE table,&lt;/P&gt;&lt;P&gt;               &amp;lt;fs_any&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;               &amp;lt;fs_wa&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : it_tab TYPE REF TO data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*creating the structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  wa_fcat-fieldname = 'F1'.&lt;/P&gt;&lt;P&gt;  wa_fcat-tabname = 'IT_TAB'.&lt;/P&gt;&lt;P&gt;  wa_fcat-reptext = 'F1'.&lt;/P&gt;&lt;P&gt;  wa_fcat-outputlen = 35.&lt;/P&gt;&lt;P&gt;  APPEND wa_fcat TO it_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  wa_fcat-fieldname = 'F2'.&lt;/P&gt;&lt;P&gt;  wa_fcat-tabname = 'IT_TAB'.&lt;/P&gt;&lt;P&gt;  wa_fcat-reptext = 'F2'.&lt;/P&gt;&lt;P&gt;  wa_fcat-outputlen = 35.&lt;/P&gt;&lt;P&gt;  APPEND wa_fcat TO it_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  wa_fcat-fieldname = 'F3'.&lt;/P&gt;&lt;P&gt;  wa_fcat-tabname = 'IT_TAB'.&lt;/P&gt;&lt;P&gt;  wa_fcat-reptext = 'F3'.&lt;/P&gt;&lt;P&gt;  wa_fcat-outputlen = 35.&lt;/P&gt;&lt;P&gt;  APPEND wa_fcat TO it_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like this upto F5.&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      i_style_table             =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      it_fieldcatalog            = it_fcat&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      i_length_in_byte          =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      ep_table                   = it_tab&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      e_style_fname             =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ASSIGN it_tab-&amp;gt;* TO &amp;lt;fs_table&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CREATE DATA wa_line LIKE LINE OF &amp;lt;fs_table&amp;gt;.&lt;/P&gt;&lt;P&gt;  ASSIGN wa_line-&amp;gt;* TO &amp;lt;fs_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it into wa. "table in which ur getting values&lt;/P&gt;&lt;P&gt;   ASSIGN COMPONENT c_f1 OF STRUCTURE &amp;lt;fs_wa&amp;gt; TO &amp;lt;fs_any&amp;gt;.&lt;/P&gt;&lt;P&gt;  &amp;lt;fs_any&amp;gt; = wa-f1.&lt;/P&gt;&lt;P&gt;    UNASSIGN &amp;lt;fs_any&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like thsi assign f2 to f5....&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;Append the Values Into The Table(Field Symbol).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    APPEND &amp;lt;fs_wa&amp;gt; TO &amp;lt;fs_table&amp;gt;.&lt;/P&gt;&lt;P&gt;  CLEAR: &amp;lt;fs_wa&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;P&gt;Hope u will get the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Anagha Deshmukh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Feb 2009 11:04:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-create-dynamic-internal-table/m-p/5187473#M1200598</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-20T11:04:32Z</dc:date>
    </item>
  </channel>
</rss>

