ABAPCALL_BADI - CALL BADI
CPI1466 during Backup ABAP Short ReferenceThis documentation is copyright by SAP AG.
CALL BADI
Syntax
CALL BADI { badi->meth parameter_list }
| { badi->(meth_name) {parameter_list
|parameter_tables} }.
Effect
: Calls a BAdI method. The statement has a static and a dynamic variant. In both variants aBAdI reference variable must be specified for badi.
- In the static variant, a BAdI reference variable of the static type of a concreteBAdI class must be specified, and for meth a BAdI method of the correspondingBAdI must be entered directly.
- In the dynamic variant, a BAdI reference variable of the static type of the abstract super class CL_BADI_BASE must be specifiedfor badi. For meth_name, a character-like data object must be specified that must contain the name of a BAdI method in uppercase when the statement is executed.
With regards to the addressing of BAdI methods, the BAdI reference variable behaves like aninterface reference variable with the static type of the affectedBAdIinterface. A BAdI method declared as a component of the corresponding BAdI interface is addressed directly using its name. BAdI methods declared incomponent interfaces of the BAdI interface can be addressed using theinterface component selector or anyalias names.
The options parameter_list and parameter_tablesassign the formal parameters of the BAdI method to the actual parameters and handle exceptions thatare not class-based exactly as described for CALLMETHOD. The possible exceptions in a dynamic call also correspond to those of CALL METHOD.
The effect of the statement CALL BADI is that the specified method is called in allobject plug-ins to which theBAdI object referenced by the badi refers.
- If the BAdI is defined for single use, then badi must contain a validBAdI reference for a static BAdI call. If badi is initial, a treatable exception occurs.
- If the BAdI is defined for multiple use, then badi must contain a validBAdIreference or can be initial for a static BAdI call. If the referenced BAdI object refers to severalobject plug-ins, then the calling sequence is the same for every CALL BADI statement. The exact calling sequence can be determined in the definition of the correspondingBAdIimplementations, if the predefined BAdI BADI_SORTER of the enhancement spot of the same name wasimplemented for the current BAdI. If the referenced BAdI object does not reference object plug-ins, or the badi is initial, then the statement is without effect.
- In a dynamic BAdI call, a treatable exception always occurs if there is an invalid BAdI reference in badi.
If a method is added to a BAdI afterwards, it can be missing in a BAdI implementation. In this casethe call is executed as if the method existed with an empty implementation. Actual parameters that are linked with passed EXPORTING or RETURNING parameters are not changed.
System fields
As for a normal CALL METHOD, the system field sy-subrc is either set to 0 or, when treating non-class-based exceptions, it is set to the value specified after EXCEPTIONS.
Notes
- BAdI objects and BAdI references can only be generated using the statement GET BADI.
- In the terminology of the enhancement concept, the statement CALL BADI is known as anenhancement spot element invocation.
- The call of a BAdI method of a BAdI defined for single use behaves as a method call with CALL METHOD:the called method must exist. In contrast, the call of a BAdI method defined for multiple use correspondsmore to triggering an event with RAISE EVENT: There can be no methods, one method, or multiple methods.
Exceptions
Catchable Exceptions
- Cause: The reference variable badi is initial either for the static call, although the BAdI was defined for single use, or for the dynamic call.
- Cause: Method does not exist at the dynamic call
Runtime Error: DYN_CALL_METH_NOT_FOUND (catchable)
Addresses (Business Address Services) General Material Data
This documentation is copyright by SAP AG.
Length: 8153 Date: 20120518 Time: 194651 triton ( 221 ms )






