<?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 Generating and accessing table attributes at runtime in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/generating-and-accessing-table-attributes-at-runtime/m-p/914400#M57792</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 am trying to access an internal table's attributes using attribute names generated at runtime. For example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------" /&gt;&lt;P&gt;DATA: cnt         TYPE n VALUE 1,&lt;/P&gt;&lt;P&gt;      new_field   TYPE char10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 10 TIMES.&lt;/P&gt;&lt;P&gt;   concatenate 'test' cnt into new_field.&lt;/P&gt;&lt;P&gt;   write \ itab-new_field.&lt;/P&gt;&lt;P&gt;   add 1 to cnt.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But unfortunately, it gives me an error because component itab-new_field doesn't exist. However, component itab-test1, itab-test2, itab-test3 does exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to refer to table components through dynamic variables rather than component names?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roman D.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Feb 2005 17:14:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-02-10T17:14:42Z</dc:date>
    <item>
      <title>Generating and accessing table attributes at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generating-and-accessing-table-attributes-at-runtime/m-p/914400#M57792</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 am trying to access an internal table's attributes using attribute names generated at runtime. For example,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------" /&gt;&lt;P&gt;DATA: cnt         TYPE n VALUE 1,&lt;/P&gt;&lt;P&gt;      new_field   TYPE char10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DO 10 TIMES.&lt;/P&gt;&lt;P&gt;   concatenate 'test' cnt into new_field.&lt;/P&gt;&lt;P&gt;   write \ itab-new_field.&lt;/P&gt;&lt;P&gt;   add 1 to cnt.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But unfortunately, it gives me an error because component itab-new_field doesn't exist. However, component itab-test1, itab-test2, itab-test3 does exist.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to refer to table components through dynamic variables rather than component names?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roman D.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Feb 2005 17:14:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generating-and-accessing-table-attributes-at-runtime/m-p/914400#M57792</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-02-10T17:14:42Z</dc:date>
    </item>
    <item>
      <title>Re: Generating and accessing table attributes at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generating-and-accessing-table-attributes-at-runtime/m-p/914401#M57793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes,  I believe you can do this thru 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>Thu, 10 Feb 2005 17:17:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generating-and-accessing-table-attributes-at-runtime/m-p/914401#M57793</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-02-10T17:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Generating and accessing table attributes at runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generating-and-accessing-table-attributes-at-runtime/m-p/914402#M57794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a short sample. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001 .

data: begin of x occurs 0,
      test1 type c,
      test2 type c,
      test3 type c,
      end of x.


data: cnt type n value 1,
      new_field type char10.

field-symbols: &amp;lt;fs&amp;gt; .

start-of-selection.

  x-test1 = '1'.
  x-test2 = '2'.
  x-test3 = '3'.
  append x.

  x-test1 = '4'.
  x-test2 = '5'.
  x-test3 = '6'.
  append x.


  loop at x.
    do 3 times.
      concatenate 'x-test' cnt into new_field.
      assign (new_field) to &amp;lt;fs&amp;gt;.
      write:/  &amp;lt;fs&amp;gt;.
      add 1 to cnt.
    enddo.
    cnt = 1.
  endloop.

&lt;/CODE&gt;&lt;/PRE&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>Thu, 10 Feb 2005 17:24:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generating-and-accessing-table-attributes-at-runtime/m-p/914402#M57794</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-02-10T17:24:56Z</dc:date>
    </item>
  </channel>
</rss>

