ABAP Keyword Documentation → ABAP − Reference → Enhancements
Enhancements Using BAdIs
BAdIs are created in Enhancement Builder as a part of the ABAP enhancement concept. These BAdIs, together with their calling points in ABAP programs, form explicit enhancement points of these programs and are assigned to enhancement spots.
If BAdIs and their calling points are defined in a system, enhancements can be made in follow-on systems by creating BAdI implementations in these systems. A BAdI implementation consists mainly of a BAdI implementation class whose instances enhance the functions of an ABAP program at runtime in the form of an object plug-in. In the enhancement concept, a BAdI implementation is an enhancement implementation element and is administrated by enhancement implementations.
A BAdI consists mainly of a BAdI interface that contains the declaration of BAdI methods, and a set of filters. The filters enable certain BAdI implementations to be selected for use. The following settings can be made in the definition of a BAdI, in addition to the selection of the BAdI interface:
- Whether a BAdI is intended for single or multiple use. If a BAdI is intended for single use, only a single BAdI implementation can be used in one internal session, and one BAdI implementation must be available for each use.
- A fallback BAdI implementation class can be specified to be used if no BAdI implementation matches the filter conditions.
- A BAdI can be defined as context-free or context-dependent. This setting controls the instantiation of the object plug-ins. In context-free BAdIs, it is possible to define whether an object plug-in can be created only once or multiple times within an internal session. In context-dependent BAdIs, the object plug-ins are associated with a context object.
Unlike the previous classic BAdIs, which were edited directly in the BAdI Builder, the BAdIs of the enhancement concept are supported by the ABAP runtime environment by the following ABAP statements:
GET BADI
Creates a BAdI object as a handle for object plug-ins.
CALL BADI
Calls BAdI methods in object plug-ins.
The BAdIs of the enhancement concept are also freely switchable using switches from Switch Framework.
Other versions: 7.31 | 7.40 | 7.54
Notes
- For a BAdI intended for single use, it is best to always enter a fallback implementation class and to implement it in the same system as the BAdI.
- The implementation of the BAdI methods of a
BAdI interface can be
made optional (like any other interface method) by using the addition
DEFAULT
.
- For AMDP procedure implementations, special AMDP BAdIs are available. These apply the effect of the switches from Switch Framework to the implementation of database procedures in the current database.
- See also the Documentation Enhancement Framework in SAP Help Portal.