<?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 name in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-name/m-p/1326727#M167265</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you need to reference the actual fields of the internal table, then you can do it like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001 .

types: begin of ttab,
       fld1(10) type c,
       fld2(10) type c,
       fld3(10) type c,
       end of ttab.

data: itab1 type table of ttab with header line.
data: itab2 type table of ttab with header line.

field-symbols: &amp;lt;fs_tab&amp;gt; type table,
               &amp;lt;fs_wa&amp;gt;,
               &amp;lt;fs&amp;gt;.


itab1-fld1 = 'dataa1'.
itab1-fld2 = 'dataa2'.
itab1-fld3 = 'dataa3'.
append itab1.

itab2-fld1 = 'datab1'.
itab2-fld2 = 'datab2'.
itab2-fld3 = 'datab3'.
append itab2.


assign itab1[] to &amp;lt;fs_tab&amp;gt;.
assign itab1 to &amp;lt;fs_wa&amp;gt;.

loop at &amp;lt;fs_tab&amp;gt; into &amp;lt;fs_wa&amp;gt;.
  do.
    assign component sy-index of structure &amp;lt;fs_wa&amp;gt; to &amp;lt;fs&amp;gt;.
    if sy-subrc &amp;lt;&amp;gt; 0.
      exit.
    endif.
    if sy-index = 1.
      write:/ &amp;lt;fs&amp;gt;.
    else.
      write: &amp;lt;fs&amp;gt;.
    endif.
  enddo.
endloop.



assign itab2[] to &amp;lt;fs_tab&amp;gt;.
assign itab2 to &amp;lt;fs_wa&amp;gt;.

loop at &amp;lt;fs_tab&amp;gt; into &amp;lt;fs_wa&amp;gt;.
  do.
    assign component sy-index of structure &amp;lt;fs_wa&amp;gt; to &amp;lt;fs&amp;gt;.
    if sy-subrc &amp;lt;&amp;gt; 0.
      exit.
    endif.
    if sy-index = 1.
      write:/ &amp;lt;fs&amp;gt;.
    else.
      write: &amp;lt;fs&amp;gt;.
    endif.
  enddo.
endloop.

&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Jun 2006 20:30:41 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-06-05T20:30:41Z</dc:date>
    <item>
      <title>Dynamic internal table name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-name/m-p/1326724#M167262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Can anyone tell me how can I use a dynamic table name:&lt;/P&gt;&lt;P&gt;Something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data my_table(20).&lt;/P&gt;&lt;P&gt;my_table = 'MARA'.&lt;/P&gt;&lt;P&gt;loop at (my_table).&lt;/P&gt;&lt;P&gt;stuff...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2006 20:13:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-name/m-p/1326724#M167262</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-05T20:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic internal table name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-name/m-p/1326725#M167263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do this using field symbols.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2006 20:20:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-name/m-p/1326725#M167263</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-05T20:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic internal table name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-name/m-p/1326726#M167264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001 .

data: itab1 type table of string with header line.
data: itab2 type table of string with header line.

field-symbols: &amp;lt;fs_tab&amp;gt; type table,
               &amp;lt;fs_wa&amp;gt;.


itab1 = 'dataa1'.   append itab1.
itab1 = 'dataa2'.   append itab1.
itab1 = 'dataa3'.   append itab1.

itab2 = 'datab1'.   append itab2.
itab2 = 'datab2'.   append itab2.
itab2 = 'datab3'.   append itab2.


assign itab1[] to &amp;lt;fs_tab&amp;gt;.
assign itab1 to &amp;lt;fs_wa&amp;gt;.

loop at &amp;lt;fs_tab&amp;gt; into &amp;lt;fs_wa&amp;gt;.
  write:/ &amp;lt;fs_wa&amp;gt;.
endloop.



assign itab2[] to &amp;lt;fs_tab&amp;gt;.
assign itab2 to &amp;lt;fs_wa&amp;gt;.

loop at &amp;lt;fs_tab&amp;gt; into &amp;lt;fs_wa&amp;gt;.
  write:/ &amp;lt;fs_wa&amp;gt;.
endloop.

&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2006 20:26:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-name/m-p/1326726#M167264</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-05T20:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic internal table name</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-name/m-p/1326727#M167265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you need to reference the actual fields of the internal table, then you can do it like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001 .

types: begin of ttab,
       fld1(10) type c,
       fld2(10) type c,
       fld3(10) type c,
       end of ttab.

data: itab1 type table of ttab with header line.
data: itab2 type table of ttab with header line.

field-symbols: &amp;lt;fs_tab&amp;gt; type table,
               &amp;lt;fs_wa&amp;gt;,
               &amp;lt;fs&amp;gt;.


itab1-fld1 = 'dataa1'.
itab1-fld2 = 'dataa2'.
itab1-fld3 = 'dataa3'.
append itab1.

itab2-fld1 = 'datab1'.
itab2-fld2 = 'datab2'.
itab2-fld3 = 'datab3'.
append itab2.


assign itab1[] to &amp;lt;fs_tab&amp;gt;.
assign itab1 to &amp;lt;fs_wa&amp;gt;.

loop at &amp;lt;fs_tab&amp;gt; into &amp;lt;fs_wa&amp;gt;.
  do.
    assign component sy-index of structure &amp;lt;fs_wa&amp;gt; to &amp;lt;fs&amp;gt;.
    if sy-subrc &amp;lt;&amp;gt; 0.
      exit.
    endif.
    if sy-index = 1.
      write:/ &amp;lt;fs&amp;gt;.
    else.
      write: &amp;lt;fs&amp;gt;.
    endif.
  enddo.
endloop.



assign itab2[] to &amp;lt;fs_tab&amp;gt;.
assign itab2 to &amp;lt;fs_wa&amp;gt;.

loop at &amp;lt;fs_tab&amp;gt; into &amp;lt;fs_wa&amp;gt;.
  do.
    assign component sy-index of structure &amp;lt;fs_wa&amp;gt; to &amp;lt;fs&amp;gt;.
    if sy-subrc &amp;lt;&amp;gt; 0.
      exit.
    endif.
    if sy-index = 1.
      write:/ &amp;lt;fs&amp;gt;.
    else.
      write: &amp;lt;fs&amp;gt;.
    endif.
  enddo.
endloop.

&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jun 2006 20:30:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-internal-table-name/m-p/1326727#M167265</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-06-05T20:30:41Z</dc:date>
    </item>
  </channel>
</rss>

