‎2011 May 20 5:14 AM
Hi Gurus,
I have a question. I know that there is a constructor in ABAP Objects and it is declared in Public class. But i would like to know that how do we make a constructor as private. Please let me know your feedbacks.
Thanks,
Siby Chakko.
‎2011 May 20 5:17 AM
Hi Siby,
have you ever heard about the Singleton Class. It is declared aa Private.
The constructor in the class may be called as Private class.
Thanks,
Bhargav.
‎2011 May 20 5:17 AM
Hi Siby,
have you ever heard about the Singleton Class. It is declared aa Private.
The constructor in the class may be called as Private class.
Thanks,
Bhargav.
‎2011 May 20 6:10 AM
Hello Siby,
My two cents ...
As of Release 701, you could declare the instance constructor in the Public visibilty section of the class. Of course you could mark the instantiation level of the class as Private & prevent creation of the object by the usual CREATE OBJECT statement.
As of Release 702 you can declare the instance constructor in any visibility section of the class. Check this out: [http://help.sap.com/abapdocu_702/en/abennews-71-abap-objects.htm#!ABAP_MODIFICATION_1@1@].
BR,
Suhas