Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Interface related query

Former Member
0 Likes
352

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.

1 REPLY 1
Read only

naimesh_patel
Active Contributor
0 Likes
324

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