‎2008 Nov 01 10:56 AM
Hi All,
Please can you tell me how to call a instance method created in a global class in different program.
This is the code which I have written,
data: g_cl type ref to <global class>.
call method g_cl -> <method name>
I am not able to create Create object <object>.
It is throwing the error message " Instance class cannot be called outside...."
Please can anybody help me..
*Text deleted by moderator*
Thanks
Sushmitha
‎2008 Nov 01 2:19 PM
Look at the global class attributes in SE24. It probably has instantiation set to "private". Look at the methods of the class. There's probably a method called FACTORY, or CREATE. These are what you should use to instantiate the class - not the CREATE OBJECT.
matt
‎2011 Aug 22 10:55 AM
Hi Matt,
I have a similar scenario in which i have to call a instance method from the class 'CL_HRECM00_BUDGET_EE_SRV', in which the instantiation is set to 'Private' but there is no such methods by name 'FACTORY' or CREATE. How shall i call a instance method in my case. Please help me.
Regards,
Sarathy.
‎2008 Nov 01 3:16 PM
‎2008 Nov 03 9:15 AM
Hi susmitha,
1.
data: g_cl type ref to <global class>.
2.
Create object <object>.
3.
call method g_cl -> <method name>.
if still you are getting error.
then first check that method level and visibility in se24.
1.if level is static you can not call it threw object.
2. if visibility is protected or private then you can not call it directly.
If still you are facing same problem please paste the in this thread so that i can help you better.
Regards.
Punit
Edited by: Punit Singh on Nov 3, 2008 11:54 AM
‎2008 Nov 04 11:07 AM