Quantcast
Channel: SCN: Message List - SAP ERP - Logistics Materials Management (SAP MM)
Viewing all articles
Browse latest Browse all 9093

Re: Quantity rounding in MB21 - Material reservation

$
0
0

I will add more information on how I have accomplished this, as I see that more than a few questions about this topic have been raised before, without a complete and thorough answer.

 

1) You can take a lot of approaches here, mine was maintaining unit of issue (MARC-AUSME).

 

2) Go to report FM07MFM0 - find enhancement OI0_FM07MFM0.
Here, you can use table RESB to get the line item material, entered quantity in entered UoM etc.
Now you can query table MARC to get the material unit of issue.
So now you have quantity and UoM of entry, unit of issue you want to be rounded to.
Query MARM table for both UoMs (entry / issue), and get umren and umrez fields fro both UoMs.
quantity of entry * umrez / umren = quantity in base UoM
umrezIssue / umrenIssue = rounding qty in base UoM
quantity of entry in base UoM / rounding qty in base UoM = some decimal number in Unit Of Issue
Round off this number e.g. if it is 5.6 yuo might want to round up, if 5.2 round down, but that depends on your rounding rule. We want to round up everything higher than 10% if unit of issue.


Now we have rounded quantity in unit of issue.
Convert it to quantity in unit of entry and update field RESB-ERFMG with this quantity.

 

You can also maintain custom message box to show your user that rounding has occurred.
I use function module 'POPUP_TO_CONFIRM' for this.

Everything is done now. You can enjoy your rounding.
(You still need to maintain unit of issue for the materials you want rounded)


There are a few more things to consider to prevent dividing by zero, prevent the code from executing if the material doesn't have unit of issue maintained, etc. You need functional, but also bug-free code.


Viewing all articles
Browse latest Browse all 9093

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>