Single-Use BAdI
Single Customer Enhancement
The BAdI has no filters and is called once. No state has to be kept, so you can use static methods. Such a BAdI is defined in the core or in an industry solution and is implemented by the customer.
Since this is single-use BAdI (it requires exactly one implementation), a default class must be provided by SAP. Otherwise, the GET BADI statement will raise an exception if it is executed before the customer has inserted the respective implementation.
Multiple Customer Enhancements
This case is almost the same as the previous use case but with one important difference: there are different implementations for different countries.
Whenever you add an implementation for a specific country, it is selected with the respective filter value. The default implementation is selected if the country is in Europe, Asia, or America. Otherwise the default class is used.
Use Existing Coding As Default
If you have a piece of procedural coding which cannot be easily re-written in object-oriented style, you can use this code in combination with a BAdI. For that purpose, you need to use a single-use BAdI.
If there is no implementation, you get the exception CX_BADI_NOT_IMPLEMENTED. You can put the code you want to reuse in the respective CATCH clause. This code is executed if the BAdI has no active implementation. You code serves as a default implementation in that case.
If there are many implementations when you need exactly one, this is a more severe mistake and the handling of this exception must return you to a point in the call hierarchy where the next step of the current process is a step that can do without the result of the calculation.