Skip to Content

MM Exit/BADI/BAPI to apply rules when UPDATING material. Only when updating, not creating.

We have an external system which manages certain materials, and this info is passed into SAP via BODS, which either creates or updates the SAP Materials. In this case there is also a Z table that identifies the specific material that is maintained externally.

I have already implemented an enhancement (see previous post) to protect certain fields, setting them to Read Only, when in MM02. However, we have a number of batch and user run jobs which may also update the materials.

My task is to find an Exit/BAPI/BADI/enhancement that is called whenever a material is updated (not created), and then apply my logic ot see if that material is registered as being maintained outside (via a PIM), and if so then block the update with a suitable warning/error. Probbaly an error message though as I would need to stop processing of that particular material update.

There are many areas where I insert code, butI'm looking for an area that is called no matter what method you choose to update the material, so LSMW,BDC, Material_maintain_dark, BAPI_material_savedata etc. And yes, I know that the BAPI mentioned actually calls material_maintain_dark, but wanted to give the idea that I meant everywhere that a material can be updated.

If anyone knows of such an area of code that would allow user changes, then do please let me know.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 12, 2017 at 03:56 PM


    You can try to use BADI_MATERIAL_CHECK ~ Check_data. This is called for all material maintenance.for LSMW,BDC,IDOC,Manual transaction level.Also you may explore BTE 00001250 ->OPEN_FI_PERFORM_00001250_E



    Add comment
    10|10000 characters needed characters exceeded

  • Jul 12, 2017 at 12:37 PM

    A quick update. I am currently looking through FM material_maintain_dark as most, if not all material updates seem to go through this FM. I'm not sure if in the background that LSMW and BDC would do the same though, that needs to be checked. We do mainly use RMDATIND within our LSMW objects, and I believe that object also uses material_maintain_dark as well. So, that might be a good place to start with. Can anyone think of an object that updates material data and does NOT make use of the FM material_maintain_dark?.

    Add comment
    10|10000 characters needed characters exceeded