CALL BADI
Short Reference
Syntax
CALL BADI badi->meth [EXPORTING p1 = a1 p2 = a2 ...]
{ {[IMPORTING p1 = a1 p2 = a2 ...]
[CHANGING p1 = a1 p2 = a2 ...]}
| [RECEIVING r = a ] }
[EXCEPTIONS [exc1 = n1 exc2 = n2 ...]
[OTHERS = n_others]].
Effect
: Calls a BAdI method. For badi, a
BAdI reference variable must be specified. For meth, a BAdI method of the corresponding
BAdI must be entered directly. The additions
assign actual parameters to the formal parameters of the BAdI method, or handle non-class-based exceptions
as described in CALL METHOD.
The effect of the statement CALL BADI is that the specified method is called in all
object plug-ins to which the
BAdI object referenced by the badi refers.
-
If the BAdI is defined for single use, then badi must contain a valid
BAdI reference. If badi is initial, a treatable exception occurs in this case.
-
If the BAdI is defined for multiple use, then badi must contain a valid
BAdI reference or can be initial.
If the referenced BAdI object refers to several object plug-ins ,then the calling sequence is the same
with every CALL BAdI statement. The exact calling sequence can be determined in the definition of the corresponding
BAdI implementations, if the
predefined BAdI BADI_SORTER of the enhancement spot of the same name was implemented 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.
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 an
enhancement 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 rather corresponds to the triggering of an event with RAISE EVENT: There can exist no, one, or several methods.
-
If a BAdI is later extended by a method then the method may be missing from a BAdI implementation. In this case the exception CX_SY_DYN_CALL_ILLEGAL_METHOD is raised at the call of the method and can be treated.
Catchable Exceptions
CX_BADI_ INITIAL_REFERENCE
-
Cause: The reference variable badi is initial, although the BAdI was defined for single use.
CX_SY_DYN_CALL_ILLEGAL_METHOD
-
Cause: Method not available
Runtime Error: DYN_CALL_METH_NOT_FOUND (catchable)