<?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/5735560#M1300686</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marcin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its working now.&lt;/P&gt;&lt;P&gt;Below is the final section of the code....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;declared the field symbol &amp;lt;comp&amp;gt; as you mentioned&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;t_itab&amp;gt; TYPE ANY TABLE,&lt;/P&gt;&lt;P&gt;               &amp;lt;comp&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;               &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;t_itab&amp;gt; ASSIGNING &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT sy-index OF STRUCTURE &amp;lt;wa&amp;gt; TO &amp;lt;comp&amp;gt;.&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;      WRITE:/ &amp;lt;comp&amp;gt;.&lt;/P&gt;&lt;P&gt;      write:/ sy-uline.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      EXIT.&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;Thank you all for answering and for the inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm regards,&lt;/P&gt;&lt;P&gt;Hari Kiran&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: HARI KIRAN REDDY on Jun 3, 2009 2:36 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Jun 2009 08:51:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-06-03T08:51:19Z</dc:date>
    <item>
      <title>Dynamic Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/5735548#M1300674</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 have written a very simple program for dynamic internal table&lt;/P&gt;&lt;P&gt;creation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My internal table is getting populated.&lt;/P&gt;&lt;P&gt;As I am new to dynamic internal tables,&lt;/P&gt;&lt;P&gt; I dont know how to write out the contents of the dynamic internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Appreciate your inputs and guidance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm regards,&lt;/P&gt;&lt;P&gt;Hari Kiran&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  zdynamic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_table(10) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: w_tabname TYPE w_tabname,&lt;/P&gt;&lt;P&gt;      w_dref TYPE REF TO data,&lt;/P&gt;&lt;P&gt;      dy_wa TYPE REF TO data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;t_itab&amp;gt; TYPE ANY TABLE,&lt;/P&gt;&lt;P&gt;                            &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_tabname = p_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE DATA w_dref TYPE TABLE OF (w_tabname).&lt;/P&gt;&lt;P&gt;ASSIGN w_dref-&amp;gt;* TO &amp;lt;t_itab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE DATA dy_wa LIKE LINE OF &amp;lt;t_itab&amp;gt;.&lt;/P&gt;&lt;P&gt;ASSIGN dy_wa-&amp;gt;* TO &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;populating dynamic Internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM (w_tabname) UP TO 20 ROWS&lt;/P&gt;&lt;P&gt;INTO TABLE &amp;lt;t_itab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;t_itab&amp;gt; ASSIGNING &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;I want to write out the contents of the dynamic internal table using the write statement&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: HARI KIRAN REDDY on Jun 3, 2009 1:29 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 07:58:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/5735548#M1300674</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-03T07:58:56Z</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/5735549#M1300675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai hari if ur gettign data in the work area&lt;/P&gt;&lt;P&gt;then u cna use normal write statement as &lt;/P&gt;&lt;P&gt;write : &amp;lt;wa&amp;gt;-fields1, &amp;lt;wa&amp;gt;-field2.&lt;/P&gt;&lt;P&gt;hopes it soves ru problem&lt;/P&gt;&lt;P&gt;m.a&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 08:02:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/5735549#M1300675</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-03T08:02:12Z</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/5735550#M1300676</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 don't want to write all the field names explicitly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would like to write  out the content in the work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for answering.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm regards,&lt;/P&gt;&lt;P&gt;Hari Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 08:06:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/5735550#M1300676</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-03T08:06:53Z</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/5735551#M1300677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;t_itab&amp;gt; ASSIGNING &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;   Write:/ &amp;lt;wa&amp;gt;-kunnr, &amp;lt;wa&amp;gt;-name1.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 08:07:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/5735551#M1300677</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-03T08:07:46Z</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/5735552#M1300678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai hari if u write &amp;lt;wa&amp;gt;-field1 , it will not write field name but it will write contents of work area&lt;/P&gt;&lt;P&gt;just check it&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;m.a&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 08:09:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/5735552#M1300678</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-03T08:09: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/5735553#M1300679</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 use DD03L table to retrieve fields information of a table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aswarth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 08:13:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/5735553#M1300679</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-03T08:13:37Z</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/5735554#M1300680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hari,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You want to write out the contents of dynamic internal table&lt;/P&gt;&lt;P&gt;WITHOUT HARDCODING the FIELD NAMES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just copy paste this program.&lt;/P&gt;&lt;P&gt;It will have input for TABLE name and will AUTOMATICALLY LIST OUT the contents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


FIELD-SYMBOLS: &amp;lt;dyntable&amp;gt; TYPE ANY TABLE.
FIELD-SYMBOLS: &amp;lt;dynline&amp;gt; TYPE ANY.
FIELD-SYMBOLS: &amp;lt;fld&amp;gt; TYPE ANY.

  loop at &amp;lt;dyntable&amp;gt; ASSIGNING &amp;lt;dynline&amp;gt;.
    sy-subrc = 0.
    write :/ .
    WHILE SY-SUBRC = 0.
      ASSIGN COMPONENT SY-INDEX OF STRUCTURE &amp;lt;DYNLINE&amp;gt; TO &amp;lt;FLD&amp;gt;.
      WRITE : &amp;lt;FLD&amp;gt;.
    ENDWHILE.
  endloop.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit Mittal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Amit Mittal on Jun 3, 2009 2:03 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 08:13:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/5735554#M1300680</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-03T08:13: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/5735555#M1300681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Afzal tried it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Getting the message--- The data object "WA" has no structure  and therefore&lt;/P&gt;&lt;P&gt;no component  called "FIELD1".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 08:14:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/5735555#M1300681</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-03T08:14: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/5735556#M1300682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
field-symbols &amp;lt;comp&amp;gt; type any.

LOOP AT &amp;lt;t_itab&amp;gt; ASSIGNING &amp;lt;wa&amp;gt;.
  write: /.  "first new line at each new entry in table
  do.
    assing component sy-index of structure &amp;lt;wa&amp;gt; to &amp;lt;comp&amp;gt;.
    if sy-subrc = 0.
       write: &amp;lt;comp&amp;gt;.  "write component by component
    else.
      exit.
    endif.
  enddo.
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;P&gt;&lt;/P&gt;&lt;P&gt;PS:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Getting the message--- The data object "WA" has no structure and therefore&lt;/P&gt;&lt;P&gt;no component called "FIELD1".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is because statically you defined WA as type &lt;EM&gt;any&lt;/EM&gt; , so system doesn't recognize WA components. It is known only during runtime, but you are addressing it statically with&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;wa&amp;gt;-field1. "not seen by system during sytax check

"you could address components by name dynamically with
assign coponent 'FIELD1' of structure &amp;lt;WA&amp;gt; to &amp;lt;comp&amp;gt;.  "now during runtime system is intructed to address component FIELD1, but this is dynamically known, not statically
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Marcin Pciak on Jun 3, 2009 10:19 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 08:18:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/5735556#M1300682</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-06-03T08:18:30Z</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/5735557#M1300683</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 make use of this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;t_itab&amp;gt; ASSIGNING &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Here is the new cod.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;do.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;assign component  sy-index&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;         &lt;STRONG&gt;of structure &amp;lt;t_itab&amp;gt; to &amp;lt;wa&amp;gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;exit.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;endif.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;if sy-index = 1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;write:/ &amp;lt;wa&amp;gt;.&lt;/STRONG&gt;  " This is your first field content.&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;else.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;write: &amp;lt;wa&amp;gt;.&lt;/STRONG&gt;   " This is the next field contents.&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;endif.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;enddo.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regards,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Smart Varghese&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 08:21:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/5735557#M1300683</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-03T08:21:29Z</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/5735558#M1300684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  zdynamic.

PARAMETERS: p_table(10) TYPE c.


DATA: w_tabname TYPE w_tabname,
      w_dref TYPE REF TO data,
      dy_wa TYPE REF TO data.

FIELD-SYMBOLS: &amp;lt;t_itab&amp;gt; TYPE ANY TABLE,
                            &amp;lt;wa&amp;gt;.

w_tabname = p_table.

CREATE DATA w_dref TYPE TABLE OF (w_tabname).
ASSIGN w_dref-&amp;gt;* TO &amp;lt;t_itab&amp;gt;.

CREATE DATA dy_wa LIKE LINE OF &amp;lt;t_itab&amp;gt;.
ASSIGN dy_wa-&amp;gt;* TO &amp;lt;wa&amp;gt;.

SELECT *
FROM (w_tabname) UP TO 20 ROWS
INTO TABLE &amp;lt;t_itab&amp;gt;.

LOOP AT &amp;lt;t_itab&amp;gt; ASSIGNING &amp;lt;wa&amp;gt;.
* I want to write out the contents of the dynamic internal table using the write statement
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to get the components of your internal table. therefore you need two variables in addition and two field-symbols in addition:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    desc_struc           type ref to cl_abap_structdescr,
    desc_fields          type ddfields.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    &amp;lt;p_component&amp;gt;        type dfies,
    &amp;lt;p_field&amp;gt;                  type any,
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you need to read all the componets of your line type:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  desc_struc ?= cl_abap_structdescr=&amp;gt;describe_by_data( &amp;lt;wa&amp;gt; ).
  desc_fields = desc_struc-&amp;gt;get_ddic_field_list( ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now you can loop through your table in an outer loop and loop through the componets in an inner loop:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT &amp;lt;t_itab&amp;gt; ASSIGNING &amp;lt;wa&amp;gt;.

    loop at desc_struc-&amp;gt;components assigning &amp;lt;p_component&amp;gt;.
        assign component &amp;lt;p_component&amp;gt;-name of structure &amp;lt;p_data&amp;gt; to &amp;lt;p_field&amp;gt;.
        write &amp;lt;p_field&amp;gt;.
  endloop.
ENDLOOP.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to refine the write statement to your need. But this will write out all (unknown) components of all lines.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 08:31:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/5735558#M1300684</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2009-06-03T08:31: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/5735559#M1300685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Gets all of the global data types.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'GET_GLOBAL_SYMBOLS'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      program   = sy-repid&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      fieldlist = fieldsym.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;gets all of the components of a structure&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CALL FUNCTION 'GET_COMPONENT_LIST'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      program    = sy-repid&lt;/P&gt;&lt;P&gt;      fieldname  = lv_tab_name&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      components = fieldlist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT &amp;lt;table&amp;gt; INTO &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;    LOOP AT fieldlist.             - - - - - - &amp;gt; All the fields of that structure &amp;lt;wa&amp;gt;&lt;/P&gt;&lt;P&gt;      fieldname = fieldlist-compname .&lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT  fieldname  OF STRUCTURE &amp;lt;wa&amp;gt; TO &amp;lt;wa_1&amp;gt;.&lt;/P&gt;&lt;P&gt;       write &amp;lt;wa_1&amp;gt;.&lt;/P&gt;&lt;P&gt;     ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 08:34:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/5735559#M1300685</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-03T08:34:51Z</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/5735560#M1300686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Marcin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its working now.&lt;/P&gt;&lt;P&gt;Below is the final section of the code....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;declared the field symbol &amp;lt;comp&amp;gt; as you mentioned&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;t_itab&amp;gt; TYPE ANY TABLE,&lt;/P&gt;&lt;P&gt;               &amp;lt;comp&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;               &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;t_itab&amp;gt; ASSIGNING &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT sy-index OF STRUCTURE &amp;lt;wa&amp;gt; TO &amp;lt;comp&amp;gt;.&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;      WRITE:/ &amp;lt;comp&amp;gt;.&lt;/P&gt;&lt;P&gt;      write:/ sy-uline.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      EXIT.&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;Thank you all for answering and for the inputs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Warm regards,&lt;/P&gt;&lt;P&gt;Hari Kiran&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: HARI KIRAN REDDY on Jun 3, 2009 2:36 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 08:51:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table/m-p/5735560#M1300686</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-03T08:51:19Z</dc:date>
    </item>
  </channel>
</rss>

