In some business scenarios, you need to control if an specific planning element will be relevant to MRP or not. For some MRP elements, there is no customizing or master data setting to control that, therefore, SAP delivered BAdI MD_CHANGE_MRP DATA, which allows you to add a custom logic to define the MRP availability of each planning element.
This BAdI is called during the MRP run and on the MRP transactions, such as the stock/requirements list.
On the screenshot below you can see that there is an element PRqRel. This element is MRP relevant, as it is turning the available quantity negative and a purchase requisition was created by MRP to cover it.
It is a very commomn business requirement to have only stock transfer order (not requisition) releases relevant to MRP on the supplying plant. On this document you will find an example of how this BAdI can be used to make a stock transfer requisition release not relevant to MRP on the supplying plant.
Firstly, open BAdI MD_CHANGE_MRP_DATA on transaction SE18. Clicking the button "documentation" you will find a detailed description of this BAdI.
On tab "interface" you will find a list of all the available methods. There is one method for type of each planning and, since this example is focused on stock transfer requisitions releases, we will use method CHANGE_MDPSX_MDUA.
Go to the menu GOTO, SAMPLE CODE and choose the option DISPLAY.
Here, double click the method CHANGE_MDPSX_MDUA.
Here you will find a sample code delivered by SAP that makes stock transfer requisitions releases not relevant to MRP (this logic replaces the old modification note 190298). This code will be used as a base for our BAdI implementation.
Get back to transaction SE18 intial screen, choose the menu IMPLEMENTATION and CREATE and choose a name for your BAdI,
On the next screen, write a short text and double click method CHANGE_MDPSX_MDUA, on tab interface. You may be prompted to save and choose a package to your BAdI. You may click the button "LOCAL OBJECT" if you don't have a package.
Now copy the sample code, make the desired changes and activate your method.
Go back to the previous screen and activate the BAdI. If the BAdI is correctly activated, you will see the text "Implementation is called" on field "Runtime Behavior".
Checking the same material from the first screenshot again after the MRP run, we can notice that the purchase requisition was deleted and that stock transfer requisition release does not affect the available quantity anymore.
For more details about all the BAdIs available on MRP, see the following document:
If you are facing any problem with a BAdI on MRP, see the following note:
2012620 | MRP: Problems with BAdIs |