‎2010 May 23 1:53 PM
Hi I have Created Class in SE24 and I have declared three public methods in that class and Finally I made Class as Private. then How can access the public methods of the class From the Report Program.
Regards,
D.Kiran Kumar.
‎2010 May 23 2:15 PM
> I made Class as Private
hmmm. I guess you mean the flag which is located in the properties of the class. It means that you restrict the access to the class instanciation: it can only be instantiated by a method of the class itself, not from outside the class.
You can always access the public methods from everywhere. It's only the CREATE OBJECT (the instanciation) that you can't do outside the class.
‎2010 May 24 8:12 AM
hi Kiran,
you can not access the public methods of the private class because you can not create the object of that private class......
Thanks and Regards
Gaurav Khare
‎2010 May 24 8:42 AM
>
> hi Kiran,
>
> you can not access the public methods of the private class because you can not create the object of that private class......
>
> Thanks and Regards
> Gaurav Khare
Not so. Consider a class my_class which is marked as private. Create a static public method, which returns r_myinstance TYPE REF TO my_class. The body of the static public method is
CREATE OBJECT r_myclass. The static method is called a factory method. It can be used to implement the singleton pattern, and in other ways. There is extensive literature about this on the net.
matt
‎2010 May 27 10:16 AM