<?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: Local class # Object creation from another program in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581042#M23032</link>
    <description>&lt;P&gt;Includes for re-use are indeed very very bad.&lt;/P&gt;
  &lt;P&gt;One project I was on decided to use an include in hundreds of BW routines. It all worked nicely until a change needed to be made... and 100s of BW flows had to be regenerated in production. Took quite a while.&lt;/P&gt;
  &lt;P&gt;The reason an include was used was the the outsourcing partner's staff weren't technically competent to do much beyond inserting include statements.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Apr 2018 06:02:02 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2018-04-18T06:02:02Z</dc:date>
    <item>
      <title>Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581034#M23024</link>
      <description>&lt;P&gt;Is there any way to create an object of a local class in program A in program B ? &lt;/P&gt;
  &lt;P&gt;REPORT Z_REPORT_A.&lt;BR /&gt; CLASS LCL_LOCAL_CLASS DEFINTION.&lt;BR /&gt; PUBLIC SECTION.&lt;BR /&gt; METHODS: say_foo.&lt;BR /&gt; ENDCLASS.&lt;BR /&gt; CLASS LCL_LOCAL_CLASS IMPLEMENTATION.&lt;BR /&gt; METHOD say_foo.&lt;BR /&gt; WRITE 'Foo from program Z_REPORT_A'.&lt;BR /&gt; ENDMETHOD.&lt;BR /&gt; ENDCLASS.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;REPORT Z_REPORT_B.&lt;/P&gt;
  &lt;P&gt; Can I create an object of &lt;/P&gt;
  &lt;P&gt;LCL_LOCAL_CLASS&lt;/P&gt; in 
  &lt;P&gt;Z_REPORT_B&lt;/P&gt; ??</description>
      <pubDate>Tue, 20 Feb 2018 08:06:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581034#M23024</guid>
      <dc:creator>arunneerolil</dc:creator>
      <dc:date>2018-02-20T08:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581035#M23025</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Not recommended! (see comments)&lt;/STRONG&gt;: You can put local class definition and implementation into the INCLUDE and use this include in both programs.&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;But it sounds it would be better to create global class? Reusability &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 08:12:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581035#M23025</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2018-02-20T08:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581036#M23026</link>
      <description>&lt;P&gt;No you can't, the clue is in the word "Local". Use a global class. &lt;/P&gt;
  &lt;P&gt;It is however possible to use an instance of a local class elsewhere.&lt;/P&gt;
  &lt;P&gt;Also, do not use includes in multiple programs. &lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abenmultiple_use_include_guidl.htm" target="test_blank"&gt;https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abenmultiple_use_include_guidl.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 08:30:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581036#M23026</guid>
      <dc:creator>pokrakam</dc:creator>
      <dc:date>2018-02-20T08:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581037#M23027</link>
      <description>&lt;P&gt;Horst &lt;A href="https://answers.sap.com/questions/62770/call-method-from-a-abap-program.html"&gt;once&lt;/A&gt; said: "You shouldn't do that but you can by using &lt;A href="http://help.sap.com/abapdocu_751/en/index.htm?file=abentype_names.htm"&gt;absolute type names&lt;/A&gt;."&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 08:46:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581037#M23027</guid>
      <dc:creator>nomssi</dc:creator>
      <dc:date>2018-02-20T08:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581038#M23028</link>
      <description>&lt;P&gt;hi&lt;/P&gt;
  &lt;P&gt;you can export/import object of class in one report to another report.&lt;/P&gt;
  &lt;P&gt;for this you have to use shared memory concept technique.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 05:16:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581038#M23028</guid>
      <dc:creator>former_member241258</dc:creator>
      <dc:date>2018-02-21T05:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581039#M23029</link>
      <description>&lt;P&gt;Is there any reason why we shouldn't use absolute type names ?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 04:49:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581039#M23029</guid>
      <dc:creator>arunneerolil</dc:creator>
      <dc:date>2018-04-18T04:49:44Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581040#M23030</link>
      <description>&lt;P&gt;Never reuse include programs&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenmultiple_use_include_guidl.htm" target="test_blank"&gt;https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenmultiple_use_include_guidl.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 05:56:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581040#M23030</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2018-04-18T05:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581041#M23031</link>
      <description>&lt;P&gt;Yes. It's really bad programming. Likely to lead to hard to find (and therefore extremely expensive) bugs.&lt;/P&gt;
  &lt;P&gt;Why do you think you need to use local classes in this way?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 05:58:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581041#M23031</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-04-18T05:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581042#M23032</link>
      <description>&lt;P&gt;Includes for re-use are indeed very very bad.&lt;/P&gt;
  &lt;P&gt;One project I was on decided to use an include in hundreds of BW routines. It all worked nicely until a change needed to be made... and 100s of BW flows had to be regenerated in production. Took quite a while.&lt;/P&gt;
  &lt;P&gt;The reason an include was used was the the outsourcing partner's staff weren't technically competent to do much beyond inserting include statements.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 06:02:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581042#M23032</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-04-18T06:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581043#M23033</link>
      <description>&lt;P&gt;I remember a hotline issue with macros in mutliply used includes, arrgh ...&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 06:04:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581043#M23033</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2018-04-18T06:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581044#M23034</link>
      <description>&lt;P&gt;Edited, thank you.&lt;/P&gt;
  &lt;P&gt;It is true that I do not like debug through a lot of standard multiple used includes...&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 06:42:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581044#M23034</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2018-04-18T06:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581045#M23035</link>
      <description>&lt;P&gt;It breaks encapsulation. &lt;/P&gt;
  &lt;OL&gt;
   &lt;LI&gt;If you need the functionality, that copy the class in your local scope.&lt;/LI&gt;
   &lt;LI&gt;If the class is too complex to copy, then you probably do not understand its contract, so how are your going to make sure it is created correctly and all its collaborators are also correctly defined?&lt;/LI&gt;
   &lt;LI&gt;Even if you manage to do it, the original code is by definition out of your control and can change in unexpected ways.&lt;/LI&gt;
  &lt;/OL&gt;
  &lt;P&gt;So, you shouldn't, but you can.&lt;/P&gt;
  &lt;P&gt;JNN&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 08:03:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581045#M23035</guid>
      <dc:creator>nomssi</dc:creator>
      <dc:date>2018-04-18T08:03:03Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581046#M23036</link>
      <description>&lt;P&gt;I believe this might come as a surprise to many long time ABAPers. Judging by the standard SAP code, at some point using the same INCLUDE in multiple places was The Thing. Personally, I haven't even heard that officially changed. I just happened to dislike INCLUDEs personally (especially those standard ones that tend to generate an annoying "what's the main program for this?" pop-up, ugh) and avoid them like plague. But I wouldn't have known it is a no-no these days to reuse them. Kind of thought that was their whole point... Huh. Well, that's my "learned something today". &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 18:21:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581046#M23036</guid>
      <dc:creator>Jelena_Perfiljeva</dc:creator>
      <dc:date>2018-04-18T18:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581047#M23037</link>
      <description>&lt;P&gt;Better question to ask would be "why do I have to have some functionality that is implemented as local?" In this case, ask "why" not "why not".&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 18:25:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581047#M23037</guid>
      <dc:creator>Jelena_Perfiljeva</dc:creator>
      <dc:date>2018-04-18T18:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581048#M23038</link>
      <description>&lt;P&gt;Hmm, maybe if you read the &lt;A href="https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenabap_pgl.htm"&gt;ABAP Programming Guidelines &lt;/A&gt;(that were also published as a book about ten years ago) from beginning to end you'll find one or the other additional rule that you didn't know of &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 05:49:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581048#M23038</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2018-04-19T05:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Local class # Object creation from another program</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581049#M23039</link>
      <description>&lt;P&gt;At one time it was considered a nice way of organising code. There were even common memory areas - take the horror of global variables to a new level! &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Back in pre-2000, there was a lot of bad practice programming. I guess we just didn't know it was bad practice - or maybe it was only known inside the ivory towers of academia. Now we know what's good and bad*. One of the beneficial side effects of the internet... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;* For people who can be bothered to look. Apparently, some people still use prefixes to indicate the types of their variables. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 06:48:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/local-class-object-creation-from-another-program/m-p/581049#M23039</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2018-04-19T06:48:03Z</dc:date>
    </item>
  </channel>
</rss>

