‎2014 Mar 03 10:58 AM
Hi,
When we want to implement a SAP Provided BADI for a standard t-code (say VL02),
how is our Badi implementation called when the tcode (say VL02) is executed?
There may be multiple (say 5 different) implementations of the same Badi for the same Tcode.
‎2014 Mar 05 5:37 AM
Hi Monika,
SAP HELP says the BAdI will be called in a random order, which means you cannot control the execution sequence, hence you must be very careful.
Multiple use for BADI definitions means that there can be several
active BADI implementations. 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.
Cheers,
Custodio
‎2014 Mar 05 5:23 PM
Hi,
Thanks a lot.
That answers my question.
Appreciated your quoting the 'SAP Help' contents.
‎2014 Mar 05 6:16 AM
Hi Monika,
Please use the below code to coll the BADI implementation-
CALL METHOD CL_EXITHANDLER=>GET_INSTANCE
EXPORTING EXIT_NAME = LV_EXITNAME
NULL_INSTANCE_ACCEPTED = SEEX_TRUE
CHANGING INSTANCE = LV_INSTANCE.
LV_INSTANCE will point to the instance of BADI implementation.
LV_EXITNAME is the Badi implementation to be called.
LV_INSTANCE must be TYPE REF TO BADI's interface.
Thanks,
Anuj
‎2014 Mar 05 5:25 PM
Hi Anuj,
Hope this code works for CLASSIC BADI.
Thanks for your interest in this topic.
‎2014 Mar 05 7:15 AM
Hi,
There is no particular sequence which triggers the BADI implementation. They will be triggered randomly.
Raghav
‎2014 Mar 05 5:24 PM
‎2014 Mar 06 6:59 AM
Monica..Please mark question answered if your query is answered.
Raghav
‎2014 Mar 28 6:18 PM
‎2014 Mar 29 3:17 PM
You can't mark it correct as it is a discussion, not marked as question.
It was either not marked as question from the very beginning, or a moderator did it acting upon an alert.
‎2014 Mar 31 1:25 AM
‎2014 Mar 06 8:57 AM
Hi Monika,
In case of New BADI(Kernel), the attribute 'Runtime Behavior' of the BADI implementation also plays a very important role.
suppose a BADI has 2 implementations, BADI_IMP1 and BADI_IMP2. And Both the BADI Implementations are active and Runtime Behavior will be 'Implementation is active'. At a later point of time BADI_IMP1 is deleted and only BADI2 exist and is active. But the BADI assigment of BADI_IMP1 to the enhancement implementation still exist. Then while execution, when the control comes to Enhancement Implementation, it'll check for the BADI implementations in that. There BADI_IMP1 and BADI_IMP2 are present. And if BADI_IMP1 (deleted BADI) runtime behaviour is active, then control will just skip the remaining BADI's, as BADI1 is not available. So BADI2 will not be executed.
Thanks and regards,
Abyson Joseph