Documentation >
MAC-PAC Technical Library >
Manufacturing >
Just-in-Time >
Programs >
Unplanned Usage Recording - Purpose >
Unplanned Usage Recording - Calculations
Unplanned Usage Recording - Calculations
JT170E
A. Housekeeping
1. See the Common Processing Routines - Housekeeping section for a general discussion of this subroutine. Processing specific to this program is described below.
2. Parameter lists and key lists needed by the program are defined. Work fields and constants are defined and initialized.
3. The following information is retrieved from the Reference file (REFERP).
a. The operating system's file status codes (category 015) on the Reference file are retrieved. If this record is not found, the program terminates.
b. Reference File category 409 is read to determine which plants the user is authorized to.
c. The default plant (category 428) is retrieved from the Reference file.
d. The Date Format (category 049) on the Reference file is retrieved. If this record is not found, a message is sent to the system operator, the data defaults to MMDDYY, and processing continues.
e. The Quantity Field Sizes (category 446) on the Reference file is retrieved to determine the default number of decimal positions for quantity fields. If this record is not found, the program terminates.
f. The CONBON Container Codes (category C03) on the Reference file are retrieved. The codes are loaded into an array for retrieval.
g. The Relief Option Codes (category C02) on the Reference file are retrieved. The codes are loaded into an array for retrieval.
4. The following information is retrieved from the System Control file (CT100M):
a. The Lot Option is retrieved from the Inventory Control record (ICCTL1). If the record is not found, the program terminates.
B. Mainline
1. This program is directed by the program Status field (PGMSTS). When the status is select (PGMSTS = 'PMT') the program displays the select screen (JT170S01) and validates the screen fields. See the Just-In-Time User Manual for validation rules. If errors have occurred, an error message is displayed and the fields in error are highlighted.
2. For online transactions, after the select screen data is considered valid, the following processing occurs:
a. If a Component part was not entered, the Program Status field (PGMSTS) becomes detail (PGMSTS = 'DTL') and the program displays and validates the detail screen (JT170S02).
(1) The detail subfile is loaded using the entered revision of the parent part's bill of material.
(2) The Transaction Quantity (from the select screen) is multiplied by the quantity per unit for the given component, which is calculated as the quantity per batch divided by the product structure batch quantity of the component. The resulting issue quantity for the component is then inflated by the yield factor ( 1), which is one minus the quantity of the - product structure scrap factor divided by one hundred. This issue quantity adjusted for scrap is then checked for low and high end overflow (all 0's or all 9's) and the user is warned accordingly before defaulting the issue quantities to the detail screen. The Transaction Quantity may be changed on the detail screen.
(3) The Relief Stock Location is formatted while exploding the bill of material (except for non-stock part types - any valid location should be entered for reference).
· Point of Use: The Location is formatted from the parent.
· Point of Production: The Location is formatted from the Component.
· The Relief Stock Location may be changed on the detail screen. If the transaction quantity for the Location is zero, the Location is not validated. The Relief Stock Location must exist as a Multiple Location record or exist as a Valid Location.
(4) The Reason Code is formatted from the value entered on the select screen. If the Reason Code is not entered on the select screen, the Reason Codes on the detail screen have an initial value of blanks. The reason codes may be changed on the detail screen and are validated the same as the reason code on the select screen.
(5) The Component Lot Number field is validated on the detail screen. Only Lot controlled parts will have input-capable lot control number fields. The validation of the Lot Number entered is the same as the Lot Number validation on the select screen.
(6) After the detail screen is validated, the Record Locking and file update procedures begin for each subfile record with a non-zero Transaction Quantity.
3. For EDC transactions, similar select validation is performed; however, the Stock Location is also validated. If no location was entered, then the Relief Stock Location is formatted, just as it is in online mode. The transaction date is also validated. The date should be numeric and should have both a valid month and a valid day for the month. The Transaction Date must not be later than the system date, and it must not be blank. If no errors occur, the record locking and file update procedures begin. Otherwise, the EDC error flag is set, and the transaction file is updated.
4. Record Locking Sequence: The following is the order in which the files to be updated are locked:
1) IC130M - Multiple Location
2) DE140M - Location Validation
3) IC150M - Lot Control
4) IC140M - Warehouse Balance
5) DE100M - Part Master
After the record locking sequence completes successfully, the update procedures can begin.
5. Update Processing:
a. If the transaction is a Reversal: The Transaction Quantity is added to the On-Hand Multiple Location Quantity, the On-Hand Warehouse Balance Quantity, and the Lot Control Quantity (if the part is lot-controlled).
b. If the transaction is not a Reversal: The Transaction Quantity is subtracted from the On-Hand Multiple Location Quantity, the On-Hand Warehouse Balance Quantity, and the Lot Control Quantity (if the part is lot-controlled).
6. When updating or adding inventory balance quantities to the Multiple Location and Warehouse Balance files, two conditions are monitored for each file:
a. If the resulting balance quantity is less than zero, a warning message is written to the transaction register file.
b. If the resulting balance quantity caused an overflow, the balance quantity is not updated and a MAC-PAC error occurs.
7. The Audit Trail record is written to the Flow Issues Audit trail file (JT120BP2). The transaction record is written to the Flow Issues Transaction Register (JT120CP2). The scrap record is written to the JIT Scrap Transaction file (JT170BP1).
8. In online mode, when the user exits the program, END is moved to the Program Status field and windup processing is performed.
In EDC mode, windup processing is performed at the completion of the transaction processing.