‎2007 May 22 7:16 PM
Hello All:
1) Here is the code I have to declare object variable and call a method:
DATA: process TYPE REF TO cl_hr_pm_pw_start_manager.
CALL METHOD process->start
EXPORTING
processid = my_pid
STEPID =
NO_DIALOG_BOXES =
variant = l_variant
WAITING =
EXCEPTIONS
error_occurred = 1
OTHERS = 2.
2) I cannot use "CREATE OBJECT" because class instantiation type is "private".
3) I am getting the dump with the error when I execute theabove code:
Access via 'NULL' object reference not possible
4) I did research in this forum and found the articles but none of the solutions are working. I am working with version ECC6.0.
I am new to SAP OO programming but coming from other programming world have concepts of OO programming. I am not sure how to fix this! Could anyone please help?
Mithun.
‎2007 May 22 7:33 PM
Thanks Rich. Could you please tell me how to find that class?
Mithun
‎2007 May 22 7:24 PM
Well the problem is that you do not have an object reference for PROCESS. The class in question has been designed not to allow instantiation, so this object must be instanitated by another class and it may not offer access to it directly. This is the basic concepts and foundation of object oriented programming. You must find the class which instaniates this object and maybe, there will be a method to retrieve the object from it.
Regards,
RIch Heilman
‎2007 May 22 7:33 PM
Thanks Rich. Could you please tell me how to find that class?
Mithun
‎2007 May 22 7:47 PM
‎2007 May 22 7:55 PM
So for example, you can do something like this.
data: manager type ref to cl_hr_pm_pw_start_manager.
manager = cl_hr_pm_pw_start_manager=>manager.
CALL METHOD manager->start
EXPORTING
processid = my_pid
* STEPID =
* NO_DIALOG_BOXES =
variant = l_variant
* WAITING =
EXCEPTIONS
error_occurred = 1
OTHERS = 2.
check sy-subrc = 0.
Regards,
Rich Heilman
‎2007 May 22 9:31 PM
Thanks Rich. I could get past that "NULL" obeject reference error now. I rewarded everyone with points.
Thanks.
Mithun