<?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: Problem with local class, static private attribute and public method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333508#M513670</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I already tried this before posting the thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I try to create a dictionary table type, of a line type of the class I defined in my abap report, it will not activate on grounds of not finding the local class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the exact error message when attempting to activate the dictionary type:&lt;/P&gt;&lt;P&gt;Referenced class or interface LCL_AIRPLANE not active/implemented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm most sure that the report is activated, and it makes sense. The dictionary normally cannot find local types either when taken outside of the report context.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 May 2007 12:48:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-31T12:48:45Z</dc:date>
    <item>
      <title>Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333504#M513666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello SDN,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider the following situation:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) I have defined a LOCAL class airplane.&lt;/P&gt;&lt;P&gt;2) This class has a private static attribute "type table of ref to" airplane (array of airplanes)&lt;/P&gt;&lt;P&gt;3) A public method should return the private static table attribute&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problems:&lt;/P&gt;&lt;P&gt;a) The table cannot be given as an EXPORTING parameter in the method because TYPE TABLE OF... is not supported and I get syntax errors. I also cannot define a dictionary table type because it is a local class.&lt;/P&gt;&lt;P&gt;b) The table cannot be given as a TABLES parameter in the method because TABLES is not supported in the OO context.&lt;/P&gt;&lt;P&gt;c) The table cannot be given as an EXPORTING parameter in the method defined as LIKE myStaticAttribute because my method is PUBLIC and my attribute is PRIVATE. ABAP syntax requires that all PUBLIC statements are defined before PRIVATE ones, therefore it cannot find the attribute to reference to with LIKE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see only 2 solutions:&lt;/P&gt;&lt;P&gt;a) Never ever use local classes and always use global classes so that I might define a dictionary table type of my class which I can then use in my class.&lt;/P&gt;&lt;P&gt;b) Make the attribute public, but this goes against OO principles, and isn't really an option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing anything here, or is this simply overlooked so far?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 12:08:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333504#M513666</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T12:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333505#M513667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nils,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;all the stuff you mentioned should work once you define a table type in SE11. Define a new data structure of type "table type" and use this one. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know, if you still have problems.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;  ok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 12:30:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333505#M513667</guid>
      <dc:creator>oliver</dc:creator>
      <dc:date>2007-05-31T12:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333506#M513668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm afraid this is impossible, since it is a local class and not a global one. The dictionary does not recognize the class type outside of the ABAP report where I defined the class in, therefore, the problem cannot be solved this way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 12:33:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333506#M513668</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T12:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333507#M513669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand you correctly, the dictionary doesn't have to know your local class. Dictionary types are global and by that also known in your local class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table types at help.sap.com&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/90/8d7304b1af11d194f600a0c929b3c3/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/90/8d7304b1af11d194f600a0c929b3c3/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once defined in SE11, you define a internal table like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA lt_itab TYPE z_my_tabletype.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Give it a try.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 12:39:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333507#M513669</guid>
      <dc:creator>oliver</dc:creator>
      <dc:date>2007-05-31T12:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333508#M513670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I already tried this before posting the thread.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I try to create a dictionary table type, of a line type of the class I defined in my abap report, it will not activate on grounds of not finding the local class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the exact error message when attempting to activate the dictionary type:&lt;/P&gt;&lt;P&gt;Referenced class or interface LCL_AIRPLANE not active/implemented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm most sure that the report is activated, and it makes sense. The dictionary normally cannot find local types either when taken outside of the report context.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 12:48:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333508#M513670</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T12:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333509#M513671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, now I got it. I didn't realized that the table should contain references to your local class. Sure ddic doesn't know your local class, so you can't use it there. Sorry for that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How about using a type pool? Just a guess...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 13:00:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333509#M513671</guid>
      <dc:creator>oliver</dc:creator>
      <dc:date>2007-05-31T13:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333510#M513672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I fail to see how a type pool can solve this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bear in mind that I'm simply trying to create a local class with a static table attribute of the class itself. Such a simple OO scenario shouldn't be too hard too implement, should it? &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 13:43:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333510#M513672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T13:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333511#M513673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure;) But local classes are for me just a poor replacement of global SE24 classes. They work nice in a local context, but you shouldn't expect to much from it. I think they were done mostly because of having local event handler for global classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The nice thing is of course that you have the source in full in the editor, but as Horst Keller mentioned in a recent &amp;lt;a href="/people/horst.keller/blog/2007/05/05/source-code-editing-of-global-classes, this will also available for global classes in 7.10. Strike;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 13:51:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333511#M513673</guid>
      <dc:creator>oliver</dc:creator>
      <dc:date>2007-05-31T13:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333512#M513674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree that global classes are far superior when compared to their local variants. It's just that I bumped into this inconsistency when toying around with local classes, and I have to come to the conclusion that they are woefully flawed. I was just hoping someone could prove otherwise. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Until someone can, I'll consider this as a very serious inconsistency in the ABAP language.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 14:16:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333512#M513674</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-31T14:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333513#M513675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are absolutely free to do so;) If you want to see some fun stuff, look into the language specs before ABAP OO, like TABLES. That also quite interesting;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 May 2007 14:19:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333513#M513675</guid>
      <dc:creator>oliver</dc:creator>
      <dc:date>2007-05-31T14:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333514#M513676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Just a suggestion,&lt;/P&gt;&lt;P&gt;I suppose you're using the local class in an report/function group. Did you try to define your table type in  the "TOP" include.&lt;/P&gt;&lt;P&gt;First declare the class with "CLASS c1 DEFINITION DEFERRED."&lt;/P&gt;&lt;P&gt;Then your table type.&lt;/P&gt;&lt;P&gt;Finally your class definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Walter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: As Uwe said, you can create in your dictionary a table type with reference to OBJECT. Don't forget to cast your object when accessing it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Walter Tighzert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2007 07:21:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333514#M513676</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-01T07:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333515#M513677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Niels&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since your class is local and, thus, only know to the "surrounding" application is does not really make sense to make it public to any other application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if you require to store instances of your local classes in internal tables simply use the most generic reference type possible, i.e. &amp;lt;b&amp;gt;OBJECT&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following sample report shows how to do that. Furthermore, I believe it also shows that there are &amp;lt;u&amp;gt;&amp;lt;b&amp;gt;no &amp;lt;/b&amp;gt;&amp;lt;/u&amp;gt;serious inconsistency in the ABAP language. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZUS_SDN_LOCAL_CLASS
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*

REPORT  zus_sdn_local_class.


" NOTE: SWF_UTL_OBJECT_TAB is a table type having reference type OBJECT


*---------------------------------------------------------------------*
*       CLASS lcl_airplane DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_airplane DEFINITION.

  PUBLIC SECTION.
    DATA:    md_counter(3)             TYPE n.

    METHODS: constructor,

             get_instances
               RETURNING
                 value(rt_instances)   TYPE swf_utl_object_tab.

  PRIVATE SECTION.
    CLASS-DATA: mt_instances    TYPE swf_utl_object_tab.




ENDCLASS.                    "lcl_airplane DEFINITION




*---------------------------------------------------------------------*
*       CLASS lcl_airplane IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_airplane IMPLEMENTATION.

  METHOD constructor.
    APPEND me TO mt_instances.

    DESCRIBE TABLE mt_instances.
    md_counter = syst-tfill.
  ENDMETHOD.                    "constructor


  METHOD get_instances.
    rt_instances = mt_instances.
  ENDMETHOD.                    "get_instance

ENDCLASS.                    "lcl_airplane IMPLEMENTATION



DATA:
  gt_instances      TYPE swf_utl_object_tab,
  go_object         TYPE REF TO object,
  go_airplane       TYPE REF TO lcl_airplane.



START-OF-SELECTION.

  " Create a few airplane instance
  DO 5 TIMES.
    CREATE OBJECT go_airplane.
  ENDDO.


  gt_instances = go_airplane-&amp;gt;get_instances( ).
  CLEAR: go_airplane.

  LOOP AT gt_instances INTO go_object.
    go_airplane ?= go_object.

    WRITE: / 'Airplane =', go_airplane-&amp;gt;md_counter.
  ENDLOOP.



END-OF-SELECTION.&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;  Uwe&amp;lt;u&amp;gt;&amp;lt;/u&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2007 07:34:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333515#M513677</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-06-01T07:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333516#M513678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Grmlb,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would do the trick I suppose. But I still resent the fact that I would have to create my table using a general object instead of the type I immediately want. In any other OO language, this simple scenario would be not be an issue, hence my surprise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem solved.&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2007 07:42:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333516#M513678</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-01T07:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333517#M513679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Niels,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using the following.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS cl_a DEFINITION DEFERRED.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class cl_a definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;private section.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-data: gv_var type table of ref to cl_a.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Award points if found useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Indrajit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Jun 2007 07:53:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333517#M513679</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-01T07:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with local class, static private attribute and public method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333518#M513680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Niels&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Although I used a table type defined in the DDIC this is, of course, not mandatory.&lt;/P&gt;&lt;P&gt;Have a look at this version of the sample report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You mask as why I use the option ...&amp;lt;b&amp;gt;WITH DEFAULT KEY &amp;lt;/b&amp;gt;for the type definition? Well, simply inactive this option and see what the syntax check tells you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZUS_SDN_LOCAL_CLASS_1
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*

REPORT  zus_sdn_local_class_1.


" NOTE: SWF_UTL_OBJECT_TAB is a table type having reference type OBJECT


TYPES: ty_t_object  TYPE TABLE OF REF TO object
                    WITH DEFAULT KEY.  " this option is mandatory!!!

*---------------------------------------------------------------------*
*       CLASS lcl_airplane DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_airplane DEFINITION.

  PUBLIC SECTION.
    DATA:    md_counter(3)             TYPE n.

    METHODS: constructor,

             get_instances
               RETURNING
                 value(rt_instances)   TYPE ty_t_object.

  PRIVATE SECTION.
    CLASS-DATA: mt_instances    TYPE ty_t_object.




ENDCLASS.                    "lcl_airplane DEFINITION




*---------------------------------------------------------------------*
*       CLASS lcl_airplane IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_airplane IMPLEMENTATION.

  METHOD constructor.
    APPEND me TO mt_instances.

    DESCRIBE TABLE mt_instances.
    md_counter = syst-tfill.
  ENDMETHOD.                    "constructor


  METHOD get_instances.
    rt_instances = mt_instances.
  ENDMETHOD.                    "get_instance

ENDCLASS.                    "lcl_airplane IMPLEMENTATION



DATA:
  gt_instances      TYPE ty_t_object,
  go_object         TYPE REF TO object,
  go_airplane       TYPE REF TO lcl_airplane.



START-OF-SELECTION.

  " Create a few airplane instance
  DO 5 TIMES.
    CREATE OBJECT go_airplane.
  ENDDO.


  gt_instances = go_airplane-&amp;gt;get_instances( ).
  CLEAR: go_airplane.

  LOOP AT gt_instances INTO go_object.
    go_airplane ?= go_object.

    WRITE: / 'Airplane =', go_airplane-&amp;gt;md_counter.
  ENDLOOP.



END-OF-SELECTION.&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, 01 Jun 2007 08:47:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-local-class-static-private-attribute-and-public-method/m-p/2333518#M513680</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2007-06-01T08:47:41Z</dc:date>
    </item>
  </channel>
</rss>

