<?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: Class reference internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-reference-internal-table/m-p/6320189#M1394348</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What Uwe 'means' is this (actually it is not really 'means'): table_line is used in generic programming. It is not really the name of an internal table line, but more a generic name for 'all' internal tables. So as you can see in the example from Uwe is the generic name 'table_line'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 07 Nov 2009 19:26:03 GMT</pubDate>
    <dc:creator>Sm1tje</dc:creator>
    <dc:date>2009-11-07T19:26:03Z</dc:date>
    <item>
      <title>Class reference internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-reference-internal-table/m-p/6320186#M1394345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have an internal table filled with class references and i need to acces the one field of a structure of every class.&lt;/P&gt;&lt;P&gt;I am now trying something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop ref_table assigning &amp;lt;l_wrk_ref_but0id&amp;gt;.

      IF &amp;lt;l_wrk_ref_but0id&amp;gt;-&amp;gt;m_str_but0id-type = /gkv/cd40_cl_const=&amp;gt;con_pkkv.

      ENDIF.

endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need the field "type" in the structure "m_str_but0id" of every class (reference) in the table. The error that i'm getting is: "Field m_str_but0id unknown".&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ioan Constantin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2009 11:49:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-reference-internal-table/m-p/6320186#M1394345</guid>
      <dc:creator>former_member205645</dc:creator>
      <dc:date>2009-11-06T11:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Class reference internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-reference-internal-table/m-p/6320187#M1394346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ioan &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to access the field dynamically as well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA:
   ld_structure  TYPE &amp;lt;name of structure&amp;gt;,
   ld_attribute    TYPE tabname,
   ld_field          TYPE fieldname.

FIELD-SYMBOLS:
  &amp;lt;ls_struct&amp;gt;     TYPE any,
  &amp;lt;ld_fld&amp;gt;           TYPE any.

ld_attribute = 'M_STR_BUT0ID'.
ld_field       = 'TYPE'.  
loop ref_table assigning &amp;lt;l_wrk_ref_but0id&amp;gt;.

     ASSIGN &amp;lt;l_wrk_ref&amp;gt;but0id&amp;gt;-&amp;gt;(ld_attribute) TO &amp;lt;ls_struct&amp;gt;.
     ASSIGN COMPONENT (ld_field) OF STRUCTURE &amp;lt;ls_struct&amp;gt; TO &amp;lt;ld_fld&amp;gt;.

"      IF &amp;lt;l_wrk_ref_but0id&amp;gt;-&amp;gt;m_str_but0id-type = /gkv/cd40_cl_const=&amp;gt;con_pkkv.
       IF ( &amp;lt;ld_fld&amp;gt; = /gkv/cd40_cl_const=&amp;gt;con_pkkv ).
          ... 
      ENDIF.
 
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even simpler might be the following approach:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT ref_table assigning &amp;lt;l_wrk_ref_but0id&amp;gt;
                WHERE ( table_line-&amp;gt;m_str_but0id-type = /gkv/cd40_cl_const=&amp;gt;con_pkkv ).
...
ENDLOOP.
" Assumption: Itab has class reference type as line type.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2009 12:49:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-reference-internal-table/m-p/6320187#M1394346</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-11-06T12:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Class reference internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-reference-internal-table/m-p/6320188#M1394347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Uwe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you for the response. What do you mean with "table_line" ? Yes the table line is of type class reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: ref_table type tab_but0id_ref. " tab_but0id_ref ... table type with line type class reference ( ref to cl_99_dat_obj_but0id)

FIELD-SYMBOLS: &amp;lt;l_wrk_ref_but0id&amp;gt; type ref ro cl_99_dat_obj_but0id.


LOOP AT ref_table assigning &amp;lt;l_wrk_ref_but0id&amp;gt;
                WHERE ( table_line-&amp;gt;m_str_but0id-type = /gkv/cd40_cl_const=&amp;gt;con_pkkv ).
...
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ioan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Nov 2009 11:00:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-reference-internal-table/m-p/6320188#M1394347</guid>
      <dc:creator>former_member205645</dc:creator>
      <dc:date>2009-11-07T11:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Class reference internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-reference-internal-table/m-p/6320189#M1394348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What Uwe 'means' is this (actually it is not really 'means'): table_line is used in generic programming. It is not really the name of an internal table line, but more a generic name for 'all' internal tables. So as you can see in the example from Uwe is the generic name 'table_line'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Nov 2009 19:26:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-reference-internal-table/m-p/6320189#M1394348</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2009-11-07T19:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Class reference internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/class-reference-internal-table/m-p/6320190#M1394349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As far as &lt;EM&gt;generic&lt;/EM&gt; access (not specified type of object being access until runtime) is concerned, Guys are of course right, but as you know line type of table, which is fully typed (specifeid as ref to &lt;EM&gt;cl_99_dat_obj_but0id&lt;/EM&gt; ) there can be a problem of attribute's visibility within class. Ensure that is it a &lt;STRONG&gt;public&lt;/STRONG&gt; attribute, not protected or private, otherwise the acces from the outside will not be possible, hence you get the error.&lt;/P&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, 09 Nov 2009 08:30:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/class-reference-internal-table/m-p/6320190#M1394349</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-11-09T08:30:42Z</dc:date>
    </item>
  </channel>
</rss>

