<?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: ooabap object creation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442465#M1998800</link>
    <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;frdric.girod&lt;/SPAN&gt; Thanks. Yes I know that &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I just meant that "private class" is not an official term (although I see the term appears once in the official ABAP documentation - in CREATE OBJECT). With a so much general question in 8 words, I'm not sure the person understands the whole topic, so I try to make her speak more about it. The term "class with private instantiation" or "privately instantiated" would be better suited. The term "private class" makes me think that we are talking about package check: a class which cannot be seen/used by objects of other packages.&lt;/P&gt;</description>
    <pubDate>Wed, 18 Aug 2021 06:24:44 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2021-08-18T06:24:44Z</dc:date>
    <item>
      <title>ooabap object creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442456#M1998791</link>
      <description>&lt;P&gt;Can we create an object for private class&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 12:11:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442456#M1998791</guid>
      <dc:creator>former_member1241090</dc:creator>
      <dc:date>2021-08-17T12:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: ooabap object creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442457#M1998792</link>
      <description>&lt;P&gt;I never heard of "private class" concept in ABAP. Can you explain what you mean?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 12:13:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442457#M1998792</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-08-17T12:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: ooabap object creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442458#M1998793</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Information provided is not sufficient.&lt;/P&gt;&lt;P&gt;But still, by private instantiation of class , This is something you can achieve by using SINGLETON class .(ABAP design patterns) , You can find examples of singleton classes on google.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 14:13:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442458#M1998793</guid>
      <dc:creator>former_member598787</dc:creator>
      <dc:date>2021-08-17T14:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: ooabap object creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442459#M1998794</link>
      <description>&lt;P&gt;Yes, but only from that class or a friend of that class. &lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 17:52:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442459#M1998794</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-08-17T17:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: ooabap object creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442460#M1998795</link>
      <description>&lt;P&gt;Other examples are enumeration classes where a public read-only structure holds self-references, and factory classes where the classes they return are all friends of the factory class. In this way the ability to instantiate is entirely controlled.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Aug 2021 17:54:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442460#M1998795</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-08-17T17:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: ooabap object creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442461#M1998796</link>
      <description>&lt;P&gt;A private class should (must) avec have a public method to create the instance : Get_Instance( ) or something like that&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 05:42:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442461#M1998796</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2021-08-18T05:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: ooabap object creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442462#M1998797</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CLASS ZCL_MyBeautifullClass DEFINITION
  PUBLIC
  FINAL
  CREATE PRIVATE.   &amp;lt;--


  PUBLIC SECTION.
    INTERFACES zif_MyBeautifullInterface
    METHODS CONSTRUCTOR.
    METHODS GET_INSTANCE 
      RETURNING VALUE(o_instance) TYPE REF TO zif_MyBeautifullInterface.
ENDCLASS.



CLASS zcl_MyBeautifullInterface IMPLEMENTATION.
  METHOD constructor.
    ...
  ENDMETHOD.


  METHOD get_instance.
    o_instance = new zcl_mybeautifullclass( ).
  endmethod.
ENDCLASS.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You cannot call the constructor from outside. You can only call get_instance, and get_instance will call the constructor.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 05:47:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442462#M1998797</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2021-08-18T05:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: ooabap object creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442463#M1998798</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;frdric.girod&lt;/SPAN&gt; a public &lt;EM&gt;class/static&lt;/EM&gt; method. But not always.&lt;/P&gt;&lt;P&gt;An example of a private class without a public method, &lt;A href="https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-enumeration-classes-to-constants-interfaces" target="test_blank"&gt;https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-enumeration-classes-to-constants-interfaces&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The second one.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 05:47:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442463#M1998798</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2021-08-18T05:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: ooabap object creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442464#M1998799</link>
      <description>&lt;P&gt;yes ! constant class also use it&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 05:49:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442464#M1998799</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2021-08-18T05:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: ooabap object creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442465#M1998800</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;frdric.girod&lt;/SPAN&gt; Thanks. Yes I know that &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I just meant that "private class" is not an official term (although I see the term appears once in the official ABAP documentation - in CREATE OBJECT). With a so much general question in 8 words, I'm not sure the person understands the whole topic, so I try to make her speak more about it. The term "class with private instantiation" or "privately instantiated" would be better suited. The term "private class" makes me think that we are talking about package check: a class which cannot be seen/used by objects of other packages.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 06:24:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442465#M1998800</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2021-08-18T06:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: ooabap object creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442466#M1998801</link>
      <description>&lt;P&gt;  &lt;SPAN class="mention-scrubbed"&gt;sandra.rossi&lt;/SPAN&gt; I wrote this big example for you, before my coffee, and you already know it ... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 06:46:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442466#M1998801</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2021-08-18T06:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: ooabap object creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442467#M1998802</link>
      <description>&lt;P&gt;Hi Rajani,&lt;/P&gt;&lt;P&gt;yes we can create object for private class ( within same class)&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1969571-scr1.png" /&gt;&lt;/P&gt;&lt;P&gt;if we try  to create object in sub class error will be thrown.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1969572-scr2.png" /&gt;&lt;/P&gt;&lt;P&gt;so if we want to create object of parent class(private class) in sub class then we have to use friend class concept as shown in below image.&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/1969573-scr3.png" /&gt;&lt;/P&gt;&lt;P&gt;and you can also achieve using singleton class.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Aug 2021 12:57:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442467#M1998802</guid>
      <dc:creator>former_member697514</dc:creator>
      <dc:date>2021-08-18T12:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: ooabap object creation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442468#M1998803</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Yes we can create the object for the private class .&lt;/P&gt;&lt;P&gt;We can also create the object for the friends class which is the friend of the private class.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 11:33:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/ooabap-object-creation/m-p/12442468#M1998803</guid>
      <dc:creator>Shruthi2979</dc:creator>
      <dc:date>2022-01-24T11:33:25Z</dc:date>
    </item>
  </channel>
</rss>

