‎2009 Dec 03 4:34 AM
Hi All,
I have one interface with method XYZ... i am implementing that method with the help of classes ZCL and ZCL1 ...suppose when i am implemetig interface with class ZCL then its output is 123 and with class ZCL1 output is 456 ...when i call the instance of that interface in report with the help of class method get_instance of class cl_exithandler and run the report i am getting output as 123456.... i want to know how both the instances of both classes are called when we call one interface?
Thanks.
‎2009 Dec 03 2:45 PM
You must not use the class cl_exithandler to get your instance of the class. This class is part of the classical BADI framework.
For your requirement, you need to explicitly mention which class' object you want to instantiate. Like:
data: o_obj_ref type ref to zif_interface.
if condition = 0.
create object o_obj_ref type ZCL .
else.
create object o_obj_ref type ZCL1.
endif.
o_obj_ref->xyz( ).
Regards,
Naimesh Patel