Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAdi is being called on one transaction and not on the other?

former_member709132
Discoverer

Hey,

I have quite a weird problem... this BAdi - /SCWM/EX_CORE_CR_ABORT
is being called on '/scwm/adprod' '/scwm/adhoc' etc. but on this particular transaction - '/scwm/adhu' it doesn't. they are all belong to the same package and I'm having a bit of hard time understanding this. maybe someone has an Idea? would be very appreciated

Thank you!

2 REPLIES 2

Sandra_Rossi
Active Contributor

Did you check SAP notes or SPRO documentation if there's something about it?

Eventually ask SAP support.

wridgeu
Participant

Hey there,

first of all, different transactions or transaction codes being grouped together in the same package, doesn't necessarily mean that their process flow under the hood uses the same BAdIs.

When checking out the BAdI /SCWM/EX_CORE_CR_ABORT and it's implementation details, you can see that the BAdI call itself is embedded within the function module /SCWM/BADI_TO_CREATE_ABORT. This module and therefore the BAdI is called only in one scenario within the function module (if I recall correctly) /SCWM/TO_CREA_INT.

Here we have a condition on the field ANFME (while anfme > 0). In the transaction /SCWM/ADHU we don't change anything to the stock on the HU nor do we move the stock itself but only the HU and therefore have no specific ANFME. So even if the function module /SCWM/TO_CREA_INT would've been called during the WHT creation in /SCWM/ADHU it wouldn't call the /SCWM/EX_CORE_CR_ABORT BAdI implementation as there is no particular ANFME.

I'm not sure if there is a specific setting in the wht creation customizing that allows you to change or adjust this behavior.

Please let me know if I could help and don't hesitate to correct any errors or mistakes made by me.

BR,

Marco