‎2010 Jun 16 8:00 AM
Hi,
I have created the Enhancement Spot with name 'ZKK_ES_CALCULATE_TAX'. The Badi Definition Name is 'ZKK_BADI_CALC_VAT'. The Interface name is 'ZKK_IF_CALC_VAT'. This interface inherits the interface 'IF_BADI_INTERFACE' and the method I have created with name 'GET_VAT' with parameters 'IM_AMOUNT' of type importing and 'EX_AMOUNT_VAT' and 'EX_PERCENT_VAT' of type exporting.
I have unchecked the multiple use check button and instance creation mode is newly created instantiation and checked the check box call fallback if no implementation is executed.
Created the fall back class with name 'ZKK_CL_CALC_VAT_FB' and this class inherits the interfaces 'IF_BADI_INTERFACE' and 'ZKK_IF_CALC_VAT' and implemented method 'ZKK_IF_CALC_VAT~GET_VAT'. I have written a report to call the GET_VAT method and it executes well, the method in fall back class is getting executed
Now I want to check multiple use check button for multiple implementations of BADI when I try to do this, I am getting error like 'Interface ZKK_IF_CALC_VAT cannot be used (see long
text)' and the contents of the long text is
Message no. SEEF_BADI090
Diagnosis
The BAdI ZKK_BADI_CALC_VAT a single-use BAdI (can be implemented once). However, the interface ZKK_IF_CALC_VAT has methods with return or export parameters.
The BAdI ZKK_BADI_CALC_VAT has the same name as interface ZKK_IF_CALC_VAT.
System Response
Error
Procedure
Define the BAdI as a single-use BAdI, remove the methods with return or export parameters, or choose a different interface.
Regards,
Kiran Kumar K
‎2010 Jun 16 10:36 AM
The issue i.e not able to check the multiple use check button is because of two of the paramers in the interface are of type exporting. just change them to type changing and we can check the multiple use check box..
‎2010 Jun 16 2:39 PM
However, the interface ZKK_IF_CALC_VAT has methods with return or export parameters.
This is your problem.
Interfaces with returning and/or exporting parameters may not be used for BAdIs with multiple use.
The reason is simple: If two instances are active and both set your export parameter, which value should be returned to the caller? What happens with the value provided by the first called implementation when the second one is called? These questions can't be answered, you can't even say which implementation is called first or last.
You may use methods with import and/or changing parameters, but using exporting and returning is not possible.
Alex