<?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: declare fields dynmically in the internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616888#M1279631</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;PRE&gt;&lt;CODE&gt;
data: begin of it1 occurs 0,
          fieldname type string,
          ...
         end of it1.

data it_fieldcat TYPE lvc_t_fcat with header line.

data: new_table TYPE REF TO data.
data: new_line  TYPE REF TO data.

field-symbols: &amp;lt;new_tab&amp;gt; type any table,
                       &amp;lt;new_line&amp;gt; type any.

Loop at it1.
     "create fied catalog as you would create one for alv
      it_fieldcat-fieldname = it1-fieldname.  "create field of content of IT1-fieldname
....  
    "either set type explicitly or use reference to some DDIC field
    it_fieldcat-INTTYPE  =  ".....your custom type
    "or
    it_fieldcat-ref_field = "...referenced field in DDIC
    it_fieldcat-ref_table = "...and a table
   
    append it_fieldcat.
endloop.

"create dynamic table
   CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
       EXPORTING
        it_fieldcatalog = it_fieldcat[]
       IMPORTING
        ep_table        = new_table.

"now retrieve table from reference pointing to it
assign new_table-&amp;gt;* to &amp;lt;new_tab&amp;gt;.
create data new_line like line of &amp;lt;new_tab&amp;gt;.
assign new_line&amp;gt;* to &amp;lt;new_line&amp;gt;.

"now &amp;lt;new_tab&amp;gt; is your dynamic table and &amp;lt;new_line&amp;gt; is a workarea to work with that table
"you can i.e. do like

Loop at &amp;lt;new_tab&amp;gt; assigning &amp;lt;new_line&amp;gt;.
   "work here witl &amp;lt;new_line&amp;gt;
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 16 May 2009 06:47:56 GMT</pubDate>
    <dc:creator>MarcinPciak</dc:creator>
    <dc:date>2009-05-16T06:47:56Z</dc:date>
    <item>
      <title>declare fields dynmically in the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616885#M1279628</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 got stuck at one place. I want to declare fields dynmically in the internal table based on the content of another table.&lt;/P&gt;&lt;P&gt;For eg. &lt;/P&gt;&lt;P&gt;internal table1 - it1 contains 5 rows.(No.of rows can change)&lt;/P&gt;&lt;P&gt;then i want to declare 5 cloumns i.e fields in another internal table it2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mohammadi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2009 02:46:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616885#M1279628</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-16T02:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: declare fields dynmically in the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616886#M1279629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;By &lt;STRONG&gt;describe&lt;/STRONG&gt; statement you will get the no of rows of the internal table.&lt;/P&gt;&lt;P&gt;Then according to that no you need to create the internal table using &lt;STRONG&gt;FIELD-SYMBOLS&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : w_line TYPE I.
DESCRIBE TABLE &amp;lt;internal_table&amp;gt; LINES w_line.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here w_line will contain the no of rows of the internal table.&lt;/P&gt;&lt;P&gt;Now use the FIELD-SYMBOLS and the &lt;STRONG&gt;method CREATE_DYNAMIC_TABLE&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;of the &lt;STRONG&gt;class CL_ALV_TABLE_CREATE&lt;/STRONG&gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check the link to get the fields of internal table dynamically -&lt;/P&gt;&lt;P&gt;[https://wiki.sdn.sap.com/wiki/display/Snippets/How&lt;EM&gt;to&lt;/EM&gt;create&lt;EM&gt;internal&lt;/EM&gt;table+dynamically]&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>Sat, 16 May 2009 04:22:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616886#M1279629</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-16T04:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: declare fields dynmically in the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616887#M1279630</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 try the below link&lt;/P&gt;&lt;P&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="1827976"&gt;&lt;/A&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nikhil Kayal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2009 06:24:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616887#M1279630</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-16T06:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: declare fields dynmically in the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616888#M1279631</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;PRE&gt;&lt;CODE&gt;
data: begin of it1 occurs 0,
          fieldname type string,
          ...
         end of it1.

data it_fieldcat TYPE lvc_t_fcat with header line.

data: new_table TYPE REF TO data.
data: new_line  TYPE REF TO data.

field-symbols: &amp;lt;new_tab&amp;gt; type any table,
                       &amp;lt;new_line&amp;gt; type any.

Loop at it1.
     "create fied catalog as you would create one for alv
      it_fieldcat-fieldname = it1-fieldname.  "create field of content of IT1-fieldname
....  
    "either set type explicitly or use reference to some DDIC field
    it_fieldcat-INTTYPE  =  ".....your custom type
    "or
    it_fieldcat-ref_field = "...referenced field in DDIC
    it_fieldcat-ref_table = "...and a table
   
    append it_fieldcat.
endloop.

"create dynamic table
   CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
       EXPORTING
        it_fieldcatalog = it_fieldcat[]
       IMPORTING
        ep_table        = new_table.

"now retrieve table from reference pointing to it
assign new_table-&amp;gt;* to &amp;lt;new_tab&amp;gt;.
create data new_line like line of &amp;lt;new_tab&amp;gt;.
assign new_line&amp;gt;* to &amp;lt;new_line&amp;gt;.

"now &amp;lt;new_tab&amp;gt; is your dynamic table and &amp;lt;new_line&amp;gt; is a workarea to work with that table
"you can i.e. do like

Loop at &amp;lt;new_tab&amp;gt; assigning &amp;lt;new_line&amp;gt;.
   "work here witl &amp;lt;new_line&amp;gt;
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2009 06:47:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616888#M1279631</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-05-16T06:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: declare fields dynmically in the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616889#M1279632</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;Using the code provided by you, i was able to create a internal table which is combination of 2 internal table. But now i want to append the data from those internal table to this newly created internal table and pass this internal table to FM- reuse_alv_list_display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 01:43:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616889#M1279632</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-18T01:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: declare fields dynmically in the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616890#M1279633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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 = gt1_fieldcat&lt;/P&gt;&lt;P&gt;    importing&lt;/P&gt;&lt;P&gt;      ep_table        = gt_new_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  assign gt_new_table-&amp;gt;* to &amp;lt;gt_table&amp;gt;.&lt;/P&gt;&lt;P&gt;  create data gs_new_line like line of &amp;lt;gt_table&amp;gt;.&lt;/P&gt;&lt;P&gt;  assign gs_new_line-&amp;gt;* to &amp;lt;gs_line&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this way u can append the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;assign component 'NTNAME' of structure &amp;lt;gs_line&amp;gt; to &amp;lt;gd_field&amp;gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this way u can pass the data to 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;&amp;lt;gt_table&amp;gt; - dyn internal table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  try.&lt;/P&gt;&lt;P&gt;      cl_salv_table=&amp;gt;factory(&lt;/P&gt;&lt;P&gt;              exporting&lt;/P&gt;&lt;P&gt;                list_display = abap_false&lt;/P&gt;&lt;P&gt;              importing&lt;/P&gt;&lt;P&gt;                 r_salv_table = lo_alv&lt;/P&gt;&lt;P&gt;              changing&lt;/P&gt;&lt;P&gt;                 t_table      = &amp;lt;gt_table&amp;gt; ).&lt;/P&gt;&lt;P&gt;    catch cx_salv_msg .&lt;/P&gt;&lt;P&gt;  endtry.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  lo_alv-&amp;gt;display( ).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 04:43:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616890#M1279633</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-18T04:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: declare fields dynmically in the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616891#M1279634</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;Thanks for the reply. But my requirement is as follows--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 internal tables say it1 and it2. &lt;/P&gt;&lt;P&gt;it1 have fields A, B and C.&lt;/P&gt;&lt;P&gt;it2 have fields A, D, E.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created an internal table it3 dynamically which contains the fields of both the internal table.&lt;/P&gt;&lt;P&gt;Now i want to pass the data from it1 and it2 to it3.&lt;/P&gt;&lt;P&gt;and this it3 to FM for display.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 06:06:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616891#M1279634</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-18T06:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: declare fields dynmically in the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616892#M1279635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOOP at it1 and find the corresponding record from it2, next do a MOVE-CORRESPONDING from workare1 and workarea2 to &amp;lt;LINE&amp;gt; and append it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 06:09:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616892#M1279635</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2009-05-18T06:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: declare fields dynmically in the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616893#M1279636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Excatly as Micky said:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at it1.
  read table it2 index sy-tabix.  "read corresponding entry in IT2
  if sy-subrc = 0.
    move-corresponding: it1 to &amp;lt;new_line&amp;gt;,
                                   it2 to &amp;lt;new_line&amp;gt;.
    append &amp;lt;new_line&amp;gt; to &amp;lt;new_tab&amp;gt;.  "now &amp;lt;new_tab&amp;gt; stores entries from both IT1 and IT2  
  endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 07:03:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616893#M1279636</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-05-18T07:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: declare fields dynmically in the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616894#M1279637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;You can check the link I specified in my last post , there it is specified how to&lt;/P&gt;&lt;P&gt;populate dynamically created internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way to append the data to the created (dynamically) table  - -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : W_I TYPE I.

DO 5 TIMES.
  W_I = SY-INDEX - 1.
  DO 5 TIMES.
    ASSIGN COMPONENT SY-INDEX OF STRUCTURE &amp;lt;FS_LINE&amp;gt; TO &amp;lt;FS_FIELD&amp;gt;.
    &amp;lt;FS_FIELD&amp;gt; = SY-INDEX + W_I.
  ENDDO.
  INSERT &amp;lt;FS_LINE&amp;gt; INTO TABLE &amp;lt;FS_TABLE&amp;gt;. " Use to populate the table
ENDDO.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&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>Mon, 18 May 2009 07:25:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616894#M1279637</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-18T07:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: declare fields dynmically in the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616895#M1279638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I did it , this followed contents will resolve the issue ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here it1 table have fld1 , fld2 and fld3 fields and it2 have fld1 , fld4 and fld5.&lt;/P&gt;&lt;P&gt;Now my dynamically create table &amp;lt;FS_TABLE&amp;gt; contains fld1, fld2, fld3, fld4 and fld5.&lt;/P&gt;&lt;P&gt;the structure means the field string is &amp;lt;FS_LINE&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the code -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : BEGIN OF FS1 ,
         FLD1(2),
         FLD2(2),
         FLD3(2),
       END OF FS1,
       IT1 LIKE TABLE OF FS1,
       BEGIN OF FS2 ,
         FLD1(2),
         FLD4(2),
         FLD5(2),
       END OF FS2,
       IT2 LIKE TABLE OF FS2.


FS1-FLD1 = 1.
FS1-FLD2 = 2.
FS1-FLD3 = 3.
APPEND FS1 TO IT1.

FS1-FLD1 = 6.
FS1-FLD2 = 7.
FS1-FLD3 = 8.
APPEND FS1 TO IT1.

FS2-FLD1 = 1.
FS2-FLD4 = 4.
FS2-FLD5 = 5.
APPEND FS2 TO IT2.

FS2-FLD1 = 6.
FS2-FLD4 = 9.
FS2-FLD5 = 10.
APPEND FS2 TO IT2.


LOOP AT IT1 INTO FS1.
  READ TABLE IT2 INTO FS2 with key fld1 = fs1-fld1.
      ASSIGN COMPONENT SY-INDEX OF STRUCTURE &amp;lt;FS_LINE&amp;gt; TO &amp;lt;FS_FIELD&amp;gt;.
      MOVE-CORRESPONDING FS1 TO  &amp;lt;FS_LINE&amp;gt;.
      MOVE-CORRESPONDING FS2 TO  &amp;lt;FS_LINE&amp;gt;.
    INSERT &amp;lt;FS_LINE&amp;gt; INTO TABLE &amp;lt;FS_TABLE&amp;gt;.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To display the contents --&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT &amp;lt;FS_TABLE&amp;gt; INTO &amp;lt;FS_LINE&amp;gt; .
  DO 5 TIMES. "  times because the table have 5 fields (Fld1, Fld2 ....Fld5)
    ASSIGN COMPONENT SY-INDEX OF STRUCTURE &amp;lt;FS_LINE&amp;gt; TO &amp;lt;FS_FIELD&amp;gt;.
    WRITE &amp;lt;FS_FIELD&amp;gt;.
  ENDDO.
  NEW-LINE.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : As because you got how to create the table dynamically, that is why &lt;/P&gt;&lt;P&gt;         I gave the example of populating the table from to internal table.&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>Mon, 18 May 2009 09:19:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616895#M1279638</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-18T09:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: declare fields dynmically in the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616896#M1279639</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;Now i am able to create the dynamic internal table and populate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to display it using FM - reuse_alv_list_display.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For this i am creating fieldcatalog by using FM - reuse_alv_fieldcatalog_merge. In this i am passing i_call back program, i &lt;U&gt;inclname and i&lt;/U&gt;internal table name (dynamically created table)&lt;/P&gt;&lt;P&gt; But my Fieldcatalog is not getting created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 09:44:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616896#M1279639</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-18T09:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: declare fields dynmically in the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616897#M1279640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd like to make a remark here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You obviously not trying to resolve the problem yourself but waiting for excat solution "given you on a plate". Your questions were answered this forum many many times. But apparently you simply can't locate &lt;STRONG&gt;search button&lt;/STRONG&gt; on this site. This is not right! You obviously violate &lt;EM&gt;Rules and Engagements&lt;/EM&gt; which should be obligated here. But these you seem not to read ever.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Moreover, people here are to give you a direction how to use some tools, not to use them for you. &lt;/P&gt;&lt;P&gt;And finally I bit of appreciation (by assinng points) to all people sacrifying their time to resolve some basic question and explain it to a newbie is &lt;STRONG&gt;welcome&lt;/STRONG&gt; . This would not only encourage people to contribute here further, but also is a matter of &lt;STRONG&gt;good behaviour&lt;/STRONG&gt; . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To all people:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;STRONG&gt;Please do not answer here anymore. Reported to moderators.&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 10:09:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616897#M1279640</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-05-18T10:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: declare fields dynmically in the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616898#M1279641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Locked for the reason given by Marcin.  Please read and follow the Rules of Engagement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2009 10:14:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/declare-fields-dynmically-in-the-internal-table/m-p/5616898#M1279641</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-05-18T10:14:40Z</dc:date>
    </item>
  </channel>
</rss>

