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 checking multipleuse checkbutton after uncheck and usingFBclass

former_member283828
Participant
0 Likes
1,052

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

2 REPLIES 2
Read only

former_member283828
Participant
0 Likes
544

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..

Read only

Former Member
0 Likes
544

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