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

Error while forming cl_exithandler=>get_instance

Former Member
0 Likes
768

Hi,

I have created an enhancement spot ZMANAS_BADI_EN_SPOT and a badi diefinition ZMANAS_BADI_DEFN_1 (with multiple use flag enabled) under it. I am using the Z_IF_MANAS_BADI_DEFN_1 interface for this badi definition.

I have implemented the fall back class and 2 implementation also.

Now when I try to run the below code I am getting data_incons_in_exit_managem exception.

DATA exit TYPE REF TO z_if_manas_badi_defn_1. "Interface reference

CALL METHOD cl_exithandler=>get_instance "Factory method call

EXPORTING "Method

exit_name = 'ZMANAS_BADI_DEFN_1'

null_instance_accepted = 'X'

CHANGING instance = exit.

After debugging I got to know that there are no entried in the table sxs_attr for this badi. So it is failing.

Then I tried get badi command and it is working fine. So why is it not working with cl_exithandler=>get_instance method ?

Which one is better way ? cl_exithandler=>get_instance or get badi command ?

Any information on this is appreciated.

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
576

Hello Manas

Since BAdIs have become more and more important SAP has integrated the instantiation of BAdIs into the ABAP kernel with the statement GET BADI.

Sooner or later all old-fashioned calls for getting BAdI instance (CL_EXITHANDLER) will disappear. Therefore, I recommend to use the more modern GET BADI statement.

Regards

Uwe

1 REPLY 1
Read only

uwe_schieferstein
Active Contributor
0 Likes
577

Hello Manas

Since BAdIs have become more and more important SAP has integrated the instantiation of BAdIs into the ABAP kernel with the statement GET BADI.

Sooner or later all old-fashioned calls for getting BAdI instance (CL_EXITHANDLER) will disappear. Therefore, I recommend to use the more modern GET BADI statement.

Regards

Uwe