cancel
Showing results for 
Search instead for 
Did you mean: 

in MD04, how to remove element if it's origin and destination has the same MRP area?

daniel_barnea
Explorer
0 Kudos
259

Hello all!

When creating STO, MD04 show 2 element for this STO: goods issue for the date of the STO, and goods receipt for the delivery date at the different receiving storage location. 

now, i have a requirement to hide this STO from MD04 if both the storage locations has the same MRP area.

as far as i can see, i can configure new selection to exclude all STO's - but i need to exclude only STO (or all elements) with the same origin and destination MRP area.

any idea how to solve it without enchantment? 

View Entire Topic
Caetano
Product and Topic Expert
Product and Topic Expert

Hello

If I understood correctly, you have two different storage locations that belong to the same storage location MRP Area, and your users are manually creating STOs to move stock between those storage locations. 

If my understanding is correct, than it makes sense to hide those STOs. 

Nevertheless, I would suggest you to use BAdI MD_ADD_ELEMENTS instead of MD_CHANGE_MRP_DATA, because MD_CHANGE_MRP_DATA is no longer called in MD04 in SAP S/4HANA. 

Regards,
Caetano 

DominikTylczyn
SAP Champion
SAP Champion
0 Kudos

Hello @Caetano 

Are you sure MD_CHANGE_MRP_DATA is not called in MD04 in S/4? I have not found that in the BAdI documentation. Also the note 2268085 - S4TWL - MRP Live on SAP HANA - MD01N indicates that MD_CHANGE_MRP_DATA is not used in MRP Live and that it is not used in planning transactions. MD04 is not a planning transaction. Would you be able to shed some light on that?

Best regards

Dominik Tylczynski

Caetano
Product and Topic Expert
Product and Topic Expert

Hello Dominik,

You are right, SAP Note 2268085 does not clearly mention that BAdI MD_CHANGE_MRP_DATA will no longer be supported in MD04. 

However, if you set a break-point in function module AUFBAUEN_MDPSX_ANZEIGEN in an S/4HANA system, you will observe that the logic to read the planning elements from the database has been redesigned, and instead of sequentially reading the planning elements in an ABAP code, system now triggers an AMDP stored procedure to bulk read the planning elements in HANA. It basically means that the piece of code where MD_CHANGE_MRP_DATA was called is no longer being executed. 

The easiest alternative is to call the ABAP MD_ADD_ELEMENTS, which is called just after the stored procedure is executed, and this will work if the issue only happens in MD04. 
The BEST alternative is to use the AMDP BAdI that I mentioned in this blog, which is called in MD04, the MRP Fiori Apps, MRP Live and Classic MRP. Note that this BAdI is only available for the latest S/4HANA releases. 

I'll contact the author of note 2268085 and ask him to update the information, adding MD04. 
Regards,
Caetano 

DominikTylczyn
SAP Champion
SAP Champion

Thank @Caetano for detailed explanation. I've checked it and it's spot on.

It's a shame though that the MD_CHANGE_MRP_DATA documentation doesn't say any of it. It should have been updated in S/4HANA.