2023 Apr 04 8:23 AM
Hello All,
I have searched all posts/blogs before posting this.
I need a BADI/User-exit immediately after save of material using MM01.
i tried below ones:
BADI_MATERIAL_REF
BADI_MATERIAL_CHECK
BADI_MATERIAL_od
and also the user-exit -> EXIT_SAPLMGMU_001
These are all called before saving the material using MM01.
Thanks in advance.
2023 Apr 05 11:34 AM
Hi,
we use for this the Buiness Object Events.
In transaction SWEC you can maintain a business object event based on change documents:
then maintain the field restrictions (in this case "material group was maintained")
Now the customizing is completed for raising the event.
Afterwards maintain the "Event Type Linkage" to the function module to be called with transaction SWETYPV.
After that, you implement the receiver function module with your logic.
As copy template take SWE_TEMPLATE_RECTYPE_FB or SWE_TEMPLATE_RECTYPE_FB_2, which both contain a (german) documentation.
Remark: the parameter OBJKEY contains the changed material number.
Best regards, Matthias
2023 Apr 04 2:09 PM
2023 Apr 04 3:17 PM
You can use any of those BAdI/Exit to CALL a FUNCTION IN BACKGROUND UNIT so it will be executed after the update has been processed.
2023 Apr 04 3:21 PM
Thanks Raymond...can you please explain in details..is this a ZFM(which i can create?)...currently i am using BADI_MATERIAL_CHECK for validating other MARA fields...so in this BADI implementation shall i call this ZFM in background task?
2023 Apr 04 4:03 PM
Yes create a Z FM, RFC enabled, just insure
2023 Apr 05 5:37 AM
Wrote below code in BADI implementation-> calling a rfc call in background mode with commit work-> is this allowed??
it is calling FM while running MM01 tcode -> BUT since i am changing values of same material using BAPI BAPI_MATERIAL_SAVEDATA -> it is throwing error as "the group data for the material is locked by user" -> how to overcome this - need to update few fields of same material AFTER the material is saved in MARA.
Any suggestions??
2023 Apr 05 1:52 PM
Remove
2023 Apr 05 11:34 AM
Hi,
we use for this the Buiness Object Events.
In transaction SWEC you can maintain a business object event based on change documents:
then maintain the field restrictions (in this case "material group was maintained")
Now the customizing is completed for raising the event.
Afterwards maintain the "Event Type Linkage" to the function module to be called with transaction SWETYPV.
After that, you implement the receiver function module with your logic.
As copy template take SWE_TEMPLATE_RECTYPE_FB or SWE_TEMPLATE_RECTYPE_FB_2, which both contain a (german) documentation.
Remark: the parameter OBJKEY contains the changed material number.
Best regards, Matthias