Sie sind auf Seite 1von 7

MRP MANUAL

Net Requirements Calculation / Lot-Size Calculation

Net Requirements Calculation / Lot-Size Calculation in Planning Run


The following section outlines the process flow of the entire planning run for a material.

Process Flow
The system works through the following sub-processes during a planning run: 1. The system checks the planning file. It checks to see if a material is to be planned as a result of an MRP-relevant change and, if applicable, how to proceed with existing procurement proposals. 2. The system calculates net requirements for each material. It checks to see if the requirements are covered by the available warehouse stock and the planned receipts of Purchasing or Production; if the requirements are not covered, the system generates a procurement proposal. If a range of coverage profile has been assigned to a material, this profile is used to calculate the dynamic safety stock as well so that, even if additional unplanned requirements arise, enough material will be available. 3. The system then calculates the procurement quantities. It takes the selected lot-sizing procedure and any scrap and rounding values into account here. 4. The system carries out scheduling to calculate the start and finish dates of the procurement proposals. 5. The system determines the type of procurement proposal. Depending on the way the system is set up, either planned order, purchase requisitions or delivery line schedules are generated for a material. If the appropriate quota arrangement data has been entered, the system determines the source of supply and assigns this to the procurement proposal. 6. The BOM for every procurement proposal of an assembly is exploded, and the dependent requirements determined (see BOM Explosion and Determination of Dependent Requirements). 7. The system detects any critical situations that arise during the planning run these then have to be processed manually by the planner in the planning result. The system generates exception messages for this purpose and, if necessary, runs a rescheduling check (see Creating Exception Messages, Rescheduling Check). The system also calculates the actual range of coverage as well as the days supply and the receipt days supply (see Days Supply and Receipt Days Supply, Actual Range of Coverage). The net requirements are calculated in sub-process 2. The lot sizes are calculated in sub-process 3 (lot-size calculation = calculation of procurement quantities) We will now look at these sub-processes in more detail.

Net Requirements Calculation General Information


In an MRP run, the net requirements are calculated after the planning file has been checked. Net requirements are calculated at the plant level. The system checks to see if the requirements can be covered by the plant stock and planned receipts if not, it generates a procurement proposal.

Process Flow
The system calculates the plant stock. The following stocks are grouped together into plant stock for all storage locations that belong to the plant in question and are not excluded from MRP or planned separately: Unrestricted-use stock Stock in quality inspection Unrestricted-use consignment stock Consignment stock in quality inspection

MRP MANUAL

Net Requirements Calculation / Lot-Size Calculation

You can also make settings in Customizing for Material Requirements Planning (step: Define Availability of Stock in Transfer/Blocked Stock/Restricted Stock ) to specify that stock in transfer, blocked stock and restricted-use stock for batches should also be included in the plant stock. The system reads all of the receipts and issues pertaining to a material. Receipts are, for example, planned orders or purchase requisitions; issues are, for example, customer requirements, planned independent requirements, reservations, etc. The system runs a check for every requirements date to see if the requirements are covered by the plant stock or by one or more receipts. If not, it calculates the material shortage quantity and generates a suitable procurement proposal. The lot-sizing procedure, scrap and rounding values are taken into account when the system calculates the amount of the procurement proposal. In net requirements calculation, a distinction is drawn between material requirements planning, reorder point planning, and forecast-based planning, i.e. the available stock is calculated differently in each case.

Lot-Size Calculation General Information


The procurement quantities are calculated as part of MRP. When the system calculated the net requirements, it determined whether there were any material shortage quantities on the various requirements dates. These material shortage quantities now have to be covered by receipt elements. The system determines the quantities of the receipt elements when it calculates the procurement quantities in the planning run.

Prerequisites
You have specified which lot-sizing procedures you want to use in MRP Customizing (step: Check Lot-Sizing Procedures). You have assigned the appropriate lot-sizing procedure to the material in the material master (MRP 1 view), and you have specified any additional restrictions you wish to impose: Minimum lot size (minimum procurement quantity per lot) Maximum lot size (maximum procurement quantity per lot) Rounding value (the system rounds up the procurement quantity to a multiple of this value) Rounding profile (graduated rounding) You have entered the values for calculating scrap in the material master or the BOM.

Process Flow
The system matches up the material shortage quantity with the parameters of the lot-sizing procedure selected, and thus calculates the lot size. If you have specified a scrap value, the system calculates the scrap quantity and, depending on the procedure, adds or subtracts it to/from the lot size. If you have specified a rounding value or rounding profile, the system rounds the lot size, and calculates the procurement quantity in this way. If you have specified a scrap value, the system calculates the scrap quantity again, and adds/subtracts it to/from the lot size to give the yield.

Result
The result of procurement quantity calculation is the quantity to be produced or procured. This quantity is made up of the expected yield and scrap. You can display and change the procurement quantity in the procurement proposal. You can view the expected yield and scrap in the MRP list and the stock/requirements list.

MRP MANUAL

Net Requirements Calculation / Lot-Size Calculation

Lot-Size Calculation / Net Requirements Calculation Technical Programming Details


The net requirements calculation and lot-size calculation are programmed in function group M61Y. The function module is called DO_NETTORECHNUNG (LM61YU01):
FUNCTION DO_DISPOSITIONSRECHNUNG.

*"---------------------------------------------------------------------*"*"Globale Schnittstelle: *" IMPORTING *" VALUE(ECM61D) LIKE CM61D STRUCTURE CM61D *" VALUE(ECM61M) LIKE CM61M STRUCTURE CM61M *" VALUE(ECM61W) LIKE CM61W STRUCTURE CM61W *" VALUE(ECM61X) LIKE CM61X STRUCTURE CM61X *" VALUE(EMDKP) LIKE MDKP STRUCTURE MDKP *" VALUE(EMT61D) LIKE MT61D STRUCTURE MT61D *" VALUE(ET399D) LIKE T399D STRUCTURE T399D *" VALUE(ECM61B) TYPE M61X_CM61B OPTIONAL *" EXPORTING *" VALUE(IMDKP) LIKE MDKP STRUCTURE MDKP *" TABLES *" EQUKX STRUCTURE DQUK *" EQUMX STRUCTURE DQUM *" EQUPX STRUCTURE DQUP *" MDPSL STRUCTURE MDPS *" MDPSO STRUCTURE MDPS *" MDPSX STRUCTURE MDPS *" LORTX STRUCTURE LORT *" EXCEPTIONS *" MASTER_DATA_INCONSISTENT *"---------------------------------------------------------------------*--> Schnittstellendaten uebernehmen MOVE ECM61X TO CM61X. MOVE ECM61W TO CM61W. MOVE ECM61M TO CM61M. MOVE ECM61D TO CM61D. MOVE EMT61D TO MT61D. MOVE EMDKP TO MDKP. MOVE ET399D TO T399D. MOVE ECM61B TO CM61B. *--> Datenbereiche erfrischen PERFORM INITIALIZE. *--> Tabelle der Ausnahmemeldungen in interne Tabelle lesen PERFORM ERSTELLEN_ASSLX. *--> Horizonte ermitteln / Determine horizons PERFORM READ_T436A USING MDKP-PLWRK MT61D-FHORI. *--> Ermitteln Losgroessen / Determine lot sizes PERFORM READ_T439A USING MDKP-DISLS. *--> Vorplanungsbedarfe verrechnen / Consume pre-planning requirements PERFORM VP_BEDARFE_VERRECHNEN. *--> Sonderfall (im Standard inaktiv) Parallelisierung innerhalb Mat. PERFORM REDUCE_TABLES. *--> Pruefen Lagerortdisposition / Check storage location MRP PERFORM CHECK_LAGERORTDISPOSITION. *--> Prfen Sicherheitszeit / Check float after production PERFORM SET_SH_ZEIT. *--> Nettorechnung / Net requirements calculation

MRP MANUAL

Net Requirements Calculation / Lot-Size Calculation

PERFORM DO_NETTORECHNUNG. *--> Uebernahme der neuen Bestellvorschlaege / Copy new order proposals PERFORM PUT_MDPSN_MDPSX. *--> Uebernahme Lagerortdispositionstabelle / Copy storage location MRP table PERFORM PUT_MDPSL_MDPSX. *--> Pruefen Stuecklistenaufloesung fuer Zugangselemente / Check BOM explosion for receipt elements "4.0c PERFORM CHECK_NEW_AUFLOESUNG. *--> Prfen Sicherheitszeit / Check float after production PERFORM RESET_SH_ZEIT. *--> Dispositionstabelle sortieren PERFORM SORT_MDPSX. *--> Freigeben Arbeitstabellen PERFORM FREE_TABLES. *--> Schnittstellendaten zureuckgeben MOVE MDKP TO IMDKP. ENDFUNCTION.

Important routines in DO_DISPOSITIONSECHNUNG VP_BEDARFE_VERRECHNEN: Consumption of planned independent requirements with sales orders, and dependent requirements according to the planning strategy. CHECK_LAGERORTDISPOSITION: If the MRP 4 view in the material master is set up in such a way that a storage location is planned for separately, the material shortage is determined here and, if necessary, a stock transfer reservation is generated from the plant. SET_SH_ZEIT: If a float after production has been defined, the corresponding elements are brought forward for the calculation of net requirements here. DO_NETTORECHNUNG: This is where net requirements and lot sizes are actually calculated, and where procurement proposals are generated (MDPSN). PUT_MDPSN_MDPSX: The procurement proposals generated in DO_NETTORECHNUNG (MDPSN) are written to the table of MRP elements (MDPSX). PUT_MDPSL_MDPSX: The procurement proposals generated in storage location MRP are written to the table of MRP elements (MDPSX). CHECK_NEW_AUFLOESUNG: Receipt elements (e.g. planned order) are re-exploded here if they were not created or changed by MRP (MDPSX-VSTAT = H (created), = V (changed)) this depends on the BOM explosion flag in the planning file (RESAL) or, in the case of make-to-order production, on the individual customer planning file entry. This explosion (BOM explosion) occurs later on in the planning run (e.g. during the database update). To achieve this, the indicator MDPSX-VSTAT is set to N (re-explode). RESET_SH_ZEIT: If a float after production has been defined, the corresponding elements are reset (see SET_SH_ZEIT above). SORT_MDPSX: The table of MRP elements is sorted by: planning segment (e.g. net segment, individual customer segment, pre-planning segment,...), date, number of MRP element,...

DO_NETTORECHNUNG Tables: MDPSX Table containing all MRP elements that were read from the database. MDPSN Table containing all procurement proposals generated by the net requirements/lot-size calculation. MDNBX Table containing all net requirements generated by the net requirements calculation. This table forms the basis for lot-size calculation. MDRWX Table containing values determined from the range of coverage profile (only relevant if a range of coverage profile has been defined for the material).

MRP MANUAL

Net Requirements Calculation / Lot-Size Calculation

Structures: AF61Y Work fields in function group M61Y Net requirement calculation / lot-size calculation is always performed separately for each planning segment. The following FORM routines apply here: PLANNING_SEGMENT_CLOSE: Closes a planning segment if a change of planning segment is detected when the MRP element table is looped through (MDPSX). If a change of planning segment is detected, the lot-size calculation (DO_LOSGROESSEN) is called. SET_NEW_PLAKZ: Prepare new planning segment, e.g. initialize AF61Y fields, compile the range of coverage table MDRWX. The available quantity is determined (AF61Y-FLP01) when the loop is run through the MRP elements (Loop at mdpsx). At the same time, rescheduling is performed if there is an excess stock quantity or a stock shortage. ADD_SUB_MDPSX: Case statement for stock, requirements, receipts. Calculates AF61Y-FLP01 (available quantity) CHECK_VERSCHIEBEN_01: In the case of receipt elements and an excess stock quantity: postpone or cancel MRP element; if appropriate, set the corresponding exception message. CHECK_VORZIEHEN_01: In the case of a stock shortage: search for receipt elements in the future that are to be brought forward. If, even after rescheduling, a stock shortage cannot be covered, this means that AF61Y-FLP01 < 0 (or AF61Y-FLP01 < AF61Y-MINMG if the range of coverage profile is used, otherwise AF61Y-MINMG is always = 0). In this case, a new net requirement (MDNBX) is prepared using the data from the MRP element (e.g. date). When the program loops through the elements in table MDPSX, it checks each element to see if the existing net requirement is to be written to table MDNBX (e.g. next day): CHECK_NEW_ELEMENT: Check whether a new net requirements record is to be written (MDNBX) APPEND_MDNBX: Write a new net requirements record (MDNBX). The process flow detailed above applies to MRP. In reorder point planning, only the stock is taken into account. For this reason, the process flow is somewhat different here. The process flow detailed above is applies to Release 4.6C. The process flow for earlier releases might be slightly different.

DO_LOSGROESSEN Lot sizes are calculated for each planning segment on the basis of the net requirements calculated (MDNBX). The FORM routine called for lot-size calculation will depend on the type of planning segment in question (net, gross, make-to-order, pre-planning, ...):
FORM do_losgroessen. *--> Nettobedarfe berprfen IF mdnbx[] is initial. *--> Pruefen Ueberdeckung im Einzelabschnitt ueber die bereits * vorhandenen Elemente des Einzelabschnitts/ *--> Check excess in individual segment using the existing * elements of the individual segment IF ( af61y-plaab eq kndpla or af61y-plaab eq propla or af61y-plaab eq mstpla

"46a: auch Direktfert. und -beschaff.

MRP MANUAL

Net Requirements Calculation / Lot-Size Calculation

or af61y-plaab eq lobpla ) "46a auch Lohnbearb. and af61y-flp01 gt 0. MOVE mdpsx_index TO mdpsx_aline. PERFORM check_restmenge_mdpsx. ENDIF. EXIT. ENDIF. *--> Pruefen Planungsabschnitt / Check planning segment CASE mdnbx-plaab. *--> Nettoplanung oder Bruttoplanung / Net planning or gross planning WHEN netpla OR brtpla. PERFORM check_disp_losgroesse. *--> Kundeneinzelplanung oder Projekteinzelplanung / Make-to-order planning or individual project planning WHEN kndpla OR propla. PERFORM kndplan_losgroesse. PERFORM check_restmenge_mdpsn. *--> Direktfertigung oder Vorplanung fuer Direktfertigung / Direct production or pre-planning for direct production WHEN mstpla OR vmspla. PERFORM mstplan_losgroesse. *--> Vorplanung ohne Fertigung / Pre-planning without production WHEN vorpla. PERFORM vorplan_losgroesse. ENDCASE. ENDFORM.

The standard scenario is CHECK_DISP_LOSGROESSE (in the net segment). This will now be explained in more detail. In CHECK_DISP_LOSGROESSE, the AF61Y work fields are initialized first of all (the quantity field AF61Y-MNG01 in which the net requirements are stored later is particularly important here). Then, the routine check_losgroessenverfahren is called (it might be called several times for short-term and long-term planning, this will depend on the Customizing settings made for the MRP lot size). In CHECK_LOSGROESSENVERFAHREN, the FORM routine that corresponds to the type of lot size used (standard, periodic, optimized) is called. A standard lot size is normally used, so in this case the scenario continues with: LOOP_S_LOSGROESSE: the program loops through the net requirements here (MDNBX), and usually generates a procurement proposal for each net requirement. The data from the MDNBX record in structure MDNBS are passed on for this purpose. The quantity for the order proposal is passed on via the work field AF61Y-MNG01. In the standard scenario in ERMITTELN_BESTELLVORSCHLAG (i.e. no splitting quota arrangement), the routine BESTELLVORSCHLAG_STANDARD is called immediately for the purpose of generating the actual order proposal (MDPSN record). The quantity in AF61Y-MNG01 is saved to AF61Y-NBMNG beforehand. Now, in BESTELLVORSCHLAG_STANDARD, order proposals are generated until the AF61Y-NBMNG quantity is consumed:
*--> Pruefen Nettobedarfsmenge / Check net requirements quantity DO. IF AF61Y-NBMNG LE 0. EXIT. ENDIF. ... ...

MRP MANUAL

Net Requirements Calculation / Lot-Size Calculation

Some data from the net requirement (MDNBS) are then written to the order proposal (MDPSN). This is followed by more routines which supply more information on the net requirement, e.g. ERMITTELN_BESKZ_SOBES (procurement indicator, special procurement and quota arrangement). Other routines important for lot-size calculation are the routines ERMITTELN_BESTELLMENGE and, within this, the routine ERMITTELN_LOSMENGE where the order quantity is determined on the basis of the lot-sizing procedure indicator in question (exact, fixed, maximum stock level, ...). Scrap and rounding are also taken into account there. The routine COMPUTE_TERMINE is called to determine the dates. Depending on the MRP type (reorder point, rhythmic, other), either forward or backward scheduling is performed here. Please note that it is the basic dates that are computed here on the basis of the times defined in the material master (i.e. not lead time scheduling on the basis of the routing!). In CHECK_MDPSO, a check is then run to see if an existing order proposal that was flagged for deletion when the MRP elements were read (function group M61X) can be used for this procurement proposal. Finally, the new procurement proposal is saved (APPEND MDPSN) and the net requirement quantity (AF61Y-NBMNG) reduced. In the case of fixed lot sizes, for example, several procurement proposals (MDPSN) could be generated in this way for a net requirement (MDNBS).