Application Development 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: 

What does "BADI's can be used any number of times" mean?

Former Member
0 Kudos
452

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

1 ACCEPTED SOLUTION

Former Member
166

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

http://wiki.sdn.sap.com/wiki/display/ABAP/DocumentonBADI

5 REPLIES 5

Former Member
167

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

http://wiki.sdn.sap.com/wiki/display/ABAP/DocumentonBADI

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Kudos
166

>

> 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

0 Kudos
166

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

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Kudos
166

>

> 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

0 Kudos
166

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