2011 Apr 07 6:44 AM
Hi,
Does this mean that we can have multiple implementations for the BADI ? If that is so, We shall have to extend the functionality of the same method multiple times so that way two extensions of the same method would be called, but in what order, and what is the requirement that requires multiple implementations for the same method ?
Regards,
Chitwanjit
2011 Apr 07 7:07 AM
Hi,
The same BADI can be implemented many times. There is not particular order in which the system picks up the various implementations of same BADI. When there is a call, they are all called up - however, in an unpredictable sequence.
If you have multiple-use BADI definitions, the sequence must not play any role therefore. A typical example is the execution of checks before a save.
Please refer the below link for more information
2011 Apr 07 7:07 AM
Hi,
The same BADI can be implemented many times. There is not particular order in which the system picks up the various implementations of same BADI. When there is a call, they are all called up - however, in an unpredictable sequence.
If you have multiple-use BADI definitions, the sequence must not play any role therefore. A typical example is the execution of checks before a save.
Please refer the below link for more information
2011 Apr 07 7:17 AM
>
> There is not particular order in which the system picks up the various implementations of same BADI.
This is true if you don't implement the enhancement BADI_SORTER.
@Chitwanjit: I would suggest you read the F1 documentation on BAdIs. [http://help.sap.com/abapdocu_702/en/abenbadi_enhancement.htm]
Cheers,
Suhas
2011 Apr 07 7:33 AM
Thanks Vinraaj and Suhas.
Coming to the other part of my question, In what scenario we are compelled to have multiple implementations, while the same can be written in one implmentation only ?
Regards,
Chitwanjit
2011 Apr 07 7:42 AM
>
> Coming to the other part of my question, In what scenario we are compelled to have multiple implementations, while the same can be written in one implmentation only ?
Hello Chitwanjit,
It's not like compelled, it's how you want to design the BAdI!
Suppose you have a BAdI which validates some fields in the Sales Order. And you want to have different validations for different order types or skip the validations for some order types.
One design would be to create a "mutli-use" BAdI with "filter" on order type. You can however create a "single-use" BAdI as well. As i've said this is purely a design concept.
BR,
Suhas
2011 Apr 07 8:13 AM
Hi Suhas,
To add on to what you said,
Filter-Dependent: Business Add-Ins may be implemented depending on a specific filter value (example, country-specific versions: Distinct implementations of the BADI can be created for each country). A filtertype must be entered when defining your enhancement (a country or industry sector, for example). All methods created in the enhancement's interface have filter value 'FLT_VAL' as their import parameter. The method then selects the active implementation based on the data provided in the filter value
So that give us another reason to have multiple implementations of the same.
Thus, My question is answered.
Thanks & Regards,
Chitwanjit