<?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 How to access local classes inside a global class? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175730#M1712505</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This may be a silly question to some.. but..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have put a simple local class definition and implementation into the "Local Definitions/Implementations" section of my global class (SE24). However I am unable to reference this local class *anywhere* in my global class. According to what 'little' documentaiton I can find on this, the local class should be accessible within the global class. My local class is just called lcl_model. If I try to reference it with: "data mr_model type ref to lcl_model." it raises an error that "lcl_model is unknown" (tried in private, protected and public sections). I've also tried various friend attributes in the local definitions include to no avail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas? Surely it's something silly...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Jason.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Nov 2012 04:20:33 GMT</pubDate>
    <dc:creator>js2</dc:creator>
    <dc:date>2012-11-08T04:20:33Z</dc:date>
    <item>
      <title>How to access local classes inside a global class?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175730#M1712505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This may be a silly question to some.. but..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have put a simple local class definition and implementation into the "Local Definitions/Implementations" section of my global class (SE24). However I am unable to reference this local class *anywhere* in my global class. According to what 'little' documentaiton I can find on this, the local class should be accessible within the global class. My local class is just called lcl_model. If I try to reference it with: "data mr_model type ref to lcl_model." it raises an error that "lcl_model is unknown" (tried in private, protected and public sections). I've also tried various friend attributes in the local definitions include to no avail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any ideas? Surely it's something silly...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards, Jason.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 04:20:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175730#M1712505</guid>
      <dc:creator>js2</dc:creator>
      <dc:date>2012-11-08T04:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to access local classes inside a global class?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175731#M1712506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can access it in the method implementations and not in declaration of a method parameter( importing/exporting/changing). Please check if the local definitions is activated properly. It works for me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 04:46:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175731#M1712506</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2012-11-08T04:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to access local classes inside a global class?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175732#M1712507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply - you're correct - I can reference the class INSIDE a method but I cannot reference it in a class attribute nor in the parameter interface of any method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying to set my class up to allow dependacy injection for testing but its looking like thats just not possible with abap-oo in this case as I need to be able to pass in a reference to the local class to the method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e. put my select statements into a local class which can be replaced with a test double in unit-tests.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 05:00:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175732#M1712507</guid>
      <dc:creator>js2</dc:creator>
      <dc:date>2012-11-08T05:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to access local classes inside a global class?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175733#M1712508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it´s correct - local class definitions are not accesible from outside their surrounding class. I think this makes sense because otherwise the class would be global. Although, e. g. Java offers more possibilities here...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your problem I would suggest to define a global interface which the parameter is typed to. Then you can have a local implementation (e. g. if the parameter is not filled) and the caller can produce it´s own implementation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Btw.: Whe don´t&amp;nbsp; you implement your Unit Test as a local class of the test class?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Local testclasses and Interfaces for used objects is btw. our best practice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 08:33:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175733#M1712508</guid>
      <dc:creator>wol</dc:creator>
      <dc:date>2012-11-08T08:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to access local classes inside a global class?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175734#M1712509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P&gt;Thanks Stefan. The code I'm speaking of is not the actual test code. I'll use local test classes for that of course. &lt;/P&gt;&lt;P&gt;I think I'll switch to global classes and interfaces as you've suggested as local classes inside a global class are too limited. Thankyou. &lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 13:18:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175734#M1712509</guid>
      <dc:creator>js2</dc:creator>
      <dc:date>2012-11-08T13:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to access local classes inside a global class?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175735#M1712510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK. Plaease mark this thread as answered.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 13:33:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175735#M1712510</guid>
      <dc:creator>wol</dc:creator>
      <dc:date>2012-11-08T13:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to access local classes inside a global class?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175736#M1712511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;P&gt;The Jive iPhone app won't let me do anything except like and reply. Next time I look at this on the full website I'll close it out...&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 13:36:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175736#M1712511</guid>
      <dc:creator>js2</dc:creator>
      <dc:date>2012-11-08T13:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to access local classes inside a global class?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175737#M1712512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've marked it as answered for you. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 10:30:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/9175737#M1712512</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2012-11-09T10:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to access local classes inside a global class?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/13874368#M2031031</link>
      <description>&lt;P&gt;You can of course use local classes for attributes in your global class, e.g.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt; data mo_substitution type ref to lcl_substitution.&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;You have to define them in the separate tab "Class-relevant Local Types" in Eclipse. In SAPGUI, you can access it via menu only: Goto / Local Definitions / Class relevant local definitions&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 13:47:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-access-local-classes-inside-a-global-class/m-p/13874368#M2031031</guid>
      <dc:creator>vonglan</dc:creator>
      <dc:date>2024-09-23T13:47:27Z</dc:date>
    </item>
  </channel>
</rss>

