Documentation >
MAC-PAC Technical Library >
Distribution >
Order Processing >
Programs >
Stock Location Reservation Monitor - Purpose >
Stock Location Reservation Monitor - Calculations
Stock Location Reservation Monitor - Calculations
OP220E
A. Housekeeping
1. See the Common Processing Routines - Housekeeping section of this manual for a general discussion of this subroutine. Processing specific to this program is described below.
2. The balances available for distribution are retrieved from the System Control file (CT100M).
3. Arrays and fields are initialized from the Reference file (REFERP).
4. The stock location reservation option is retrieved from the Warehouse Description file (IC170M) and stored in arrays.
B. Mainline
1. The Stock Location Reservation Request file (OP220AP) is read sequentially. This file contains one record for each sales order that has had any type of order maintenance activity.
2. For each transaction file record retrieved, the Sales Order Header file (OP100M1) is retrieved and the order in use code is checked.
3. For each transaction file record retrieved, the Sales Order Line Audit file (IC180BL2) is read with a key of company, warehouse, order number, and release number.
4. A comparison is performed between the previous and current values to determine if either of the following changes occurred:
· Line was closed (unreserved inventory)
· Unit of measure changed (unreserve and reserve again)
· Reserved quantity changed (change reserved)
5. If the changes listed above did not occur for any of the lines on the order, then the following updates are made:
· The stock location processed flag is updated to YES on the Sales Order Line Audit Trail file (this results in processing the record only once).
· An immediate picker print request record is written if an immediate picker was requested.
· The order-in-use code is updated on the Sales Order Header file.
6. If one of the changes listed above (step B. 4.) occurred, then the following processing is performed based on the change that occurred:
a. Line Closed - All inventory previously reserved to the line is unreserved. This is done by reading all records for the order number/release number/line number in the Sales Order Line/Lot/Stock Location file (OP100M4). The quantity reserved on each record read is then unreserved from the corresponding Multiple Location File (IC130M) record and updated. Then the sales order line/lot/stock location record is deleted.
b. Unit of Measure Change - All inventory previously reserved to the line is unreserved (same as line closed above) using the previous unit of measure value. Then, inventory is reserved from scratch using the new unit of measure value (same as line change below).
c. Reserved Quantity Change - The change in reserved quantity is calculated by subtracting the current reserve quantity from the previous reserve quantity. If the change is less than zero, the program treats it as unreserving. If the change in reserve quantity is greater than zero, the program will reserve the additional inventory.
(1) Unreserving (change is less than zero) - The Sales Order Line/Lot/Stock Location file (OP100M4) is read for records with the same order number/release number/line number. The quantity reserved on each record is compared to a running total of how much is still left to unreserve. The lesser of the two is used to establish how much can be unreserved. The unreserving is performed by reducing the quantity reserved on the corresponding Multiple Location File (IC130M) record.
(2) Reserve Additional (change is greater than zero) - If inventory is already reserved to stock locations for this line number then an attempt will be made to reserve additional stock from the same locations. This is done by reading the Sales Order Line/Lot/Stock Location file (OP100M4) and retrieving the corresponding record from the Multiple Location file (IC130M). The available quantity is calculated for the stock location and reserved if possible. Both files are updated to reflect the additional reserved quantity.
Then, the Multiple Location file (IC130M) is read for records with the same sourcing company, warehouse, and part number. The file is also keyed by stock location, which results in alphanumeric priority. The available quantity is calculated for each stock location record read. The available quantity is then compared to a running total of how much is left to reserve. The lesser of the two is used to establish how much additional inventory can be reserved from this stock location. The Multiple Location file (IC130M) is updated with the new reserved quantity. A Sales Order Line/Lot/Stock Location (OP100M4) record is written which reflects the stock reserved form the stock location.
d. Over or Under Reservation necessary - If a quantity remains to either reserve or unreserve and all of the stock locations have been processed, the remaining quantity will be forced to reserve from the default stock location. The default stock location is set up on the Warehouse Balance file. The Multiple Location file (IC130M) and the Sales Order Line/Lot/Stock Location file (OP100M4) are either updated or written, to reflect the reservation.
7. After all lines on the order have been processed, the following updates are made:
· The stock location processed flag is updated to YES on the Sales Order Line Audit Trail file (this results in processing the record only once).
· An immediate picker print request (OP505AP) record is written if an immediate picker was requested.
· An immediate Expert Configurator manufacturing configuration request (EC200DP) record is written if an immediate manufacturing configuration was requested but an immediate picker print was not requested.
· The order-in-use code is updated on the Sales Order Header file.