‎2008 Mar 15 9:53 PM
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.
‎2008 Mar 15 10:00 PM
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
‎2008 Mar 15 10:00 PM
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