MAC-PAC Homecontact ussupport login 
Documentation > MAC-PAC Technical Library > Manufacturing > Just-in-Time > Programs > Flow Receipts to FA - Async - Purpose > Flow Receipts to FA - Async - Calculations

Flow Receipts to FA - Async - Calculations

JT125E

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.   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) are retrieved and moved into the appropriate fields.  If the file access codes are not found, the program terminates.

b.   The Date Format (category 049) is retrieved.  If this record is not found, the date format defaults to MMDDYY.

c.   The quantity field sizes (category 446) are retrieved.  If they are not found, the program terminates.

d.   The Assign Lots option is retrieved from Reference File category Y34, Lot System Defaults.   If not found, lots are not assigned automatically.

e.   The Multiple Location Priority Code Default is retrieved from Reference File category Y34, Lot System Defaults. 

4.   The following information is retrieved from the System Control file (CT100M).

a.   The Inventory Control Record One (ICCTL1) is retrieved for the System Lot Control Option.  If this record is not found, the program terminates. 

b.   The Inventory Control control record two (ICCTL2) is retrieved for the valid balance types.  If this record is not found, the program terminates.

B.   Mainline

1.   The transaction is retrieved from the Flow Receipts Asynchronous Transaction file (JT120DP).  If the record is not found, the program terminates.

2.   All fields are validated.  This validation is similar to the validation performed in the Flow Receipts/Issues Component Data Entry program (JT120E).  It is performed again here in case the files have changed or to validate EDC input.  See the validation rules in the Just-in-Time User Manual.  Additional validation is explained below.

a.   Transaction date:  A blank transaction date is invalid.  If entered, it must be numeric  and a valid date.  If it is a valid date, it cannot be greater than today's date, because it is not possible to receive against production scheduled for the future. If the date is a non-working date, then it is changed to the previous working day. 

b.   Location:  For parts whose relief type on the Part/Production Center Relationship file is point of use and whose CONBON Control Code indicates use of one or both CONBON cards, either the relief location or the producing location must be entered on the Part/Production Center Relationship file.  During validation of the location, both the receiving location and the issuing location are formatted as shown below:

Relief
Type

CONBON Control Code


Receiving Location
(based on parent relief type)


Issuing Location
(based on component relief type)

Pt of Use

Single-card or no cards

Using stock location entered on the screen or via EDC.

 

Parent's relief location on Part/Production Center Relationship file (or producing location if relief location is blank).

Pt of Use

Dual-card

Producing location on Part/Production Center Relationship file.

 

Pt of Prod

Single-card
Dual-card
No cards

Producing location on Part/Production Center Relationship file.

JIT Component
Producing location on Part/Production Center Relationship file.

MRP Component
Primary location on Part Master file.

c.   For reversal transactions, if the Allow Flow Receipt Over-Reversal flag on Reference File category K03 for the plant is 'Y', the transaction reversal quantity can be greater than the original receipt quantity.  If this flag is 'N' and the transaction reversal quantity is greater than the original receipt quantity, the transaction will end in error.  For reversal transactions, if the Receipt Over-Reversal flag is not equal to 'Y', the reversal quantity cannot be greater than the total quantity received on the FA.  A critical error message "Reversal quantity exceeds quantity received" will be sent.

3.   If the transaction is valid, the receipt is processed.  If no critical errors occurred in processing the receipt, the issues for that part's components are performed.  (See the section below for an explanation of receipt and issue processing.)

4.   If the receipt and issues were successfully processed, the Receipt Audit Trail (JT120BP1) is written and the message SUCCESSFUL FLOW RECEIPT is sent back to the workstation that entered the receipt or to the EDC message queue.

5.   If the transaction terminates before the parent receipt is processed (e.g., a validation error occurs during parent part processing) an UNSUCCESSFUL RECEIPT TRANSACTION message will be sent back to either the workstation or the EDC message queue.  If the transaction terminates after at least a portion of the parent is received, a PARTIAL RECEIPT TRANSACTION message will be sent back to either the workstation or the EDC message queue.

If an error occurs while processing an EDC transaction, the EDC error flag is formatted with YES for both unsuccessful and partially successful transactions, and the transaction file is updated.

Flow Receipts

1.   The Flow Authorization file is read for update.  The program searches for the correct Flow Authorization (FA) to receive against. 

a.   For a non-reversal transaction.

If the FA Ad Hoc Creation option (category K03) is No: 

The program reads through the FAs for the part, production center and revision load, starting with the first one.  The program skips over closed FAs via a logical view (JT100L11).  If no open FAs exist, the last skipped FA is locked for receipt.  If an open FA exists and is past due, the program checks to see if it is fully received against.  If it is not fully received, this record is locked and searching stops.  If it is fully received, searching continues.

If a current FA is reached, the record is locked and searching stops.  This is the last FA that the program can receive against, so the FA will be over-received if necessary.

If the first FA for the part is dated in the future, or if no FAs exist for the part, the transaction is in error.  However, if the program reads a future FA or has run past the last FA for the part after having read closed or past due FAs, the program backs up to the previous FA and locks this record for receipt.  Again, this is the last FA that the program will be able to receive against, so an over-receipt will be made if necessary.

If the FA Ad Hoc Creation option (category K03) is Yes:

The program searches for an FA for the part, production center, revision level and today's date.  If it exists, the record is locked for receipt.  If it does not exist, the program attempts to create an ad hoc FA for today.  If the part status is not permitted to add flows (category D88), then the receipt terminates unsuccessfully; otherwise, the ad-hoc FA is created.

b.   For a reversal transaction, the program reads the current or last past-due FA for the part, production center, and revision level.  If this FA has receipts to reverse, then this record is locked and searching stops.  If this FA does not have any receipts, searching continues to the next previous FA until one is found that has receipts to reverse.  Even closed FAs are read (JT100L12) so that a reversal receipt may be done to correct inventories. 

2.   The Multiple Location file (IC130M) is read for update.  If the record exists, it is locked.  If the multiple location record does not exist, a flag is set to format and add the record at update time and the Location Validation file (DE140M) is read and locked to keep another program from deleting the location before updating the multiple location record.  If the location validation record does not exist, the transaction is rejected.

3.   The Lot Control file (IC150M) is read for update if the part is lot controlled.  If the record exists, it is locked.  The lot hold flag is checked whenever a receipt issue, or order for a lot is entered.  A message will be displayed if the lot hold flag equals 'Yes' and you will be unable to complete the transaction.  Lot Numbers will be created automatically if the lot number on the screen is blank.  The Reference File category Y34 stores the next available lot number.   If it is blank and the Assign Lots option (category Y34) is Yes, then the next available lot number is retrieved from category Y34, the lot is created, and the next available lot number is updated in category Y34. 

4.   The record on the Warehouse Balance file (IC140M) is read for update and locked.  If the record does not exist, IC825E is called to dynamically add it.

5.   The Part Master file (DE100M) is read for update.  If the record does not exist, the transaction is rejected.

6.   Calculations are performed to compute the old balance to be received, the new FA receipt quantity, and the new balance to be received.

a.   Old Balance to be Received = Daily FA Quantity (FAQTY) x

Number of Workdays (FAWDYS) - Old FA Receipt Quantity (FATQR)

b.   New FA Receipt Quantity (FATQR):

(1)  Non-reversal transaction:  If the transaction quantity is less than the old balance to be received, or if the FA is to be over-received, then the total receipt quantity for this FA (RCTQTY) is equal to the transaction quantity.  Therefore, the new receipt quantity is the old receipt quantity plus the transaction quantity.  The new receipt quantity is monitored for overflow.  If overflow occurs, a warning message is written to the Transaction Error Register (IC505AP).

(2)  However, if the transaction quantity is greater than the old balance to be received and the FA is not to be over-received, then the transaction will be processed against multiple FAs.  In this case, the total receipt quantity for this FA (RCTQTY) is equal to the outstanding balance.  Therefore, the new FA receipt quantity is the old receipt quantity plus the old balance to be received.

(3)  Reversal transaction:  If the reversal quantity is less than or equal to the old FA receipt quantity, then the transaction will be processed against this FA only.  Therefore, the new FA receipt quantity is the old FA receipt quantity minus the reversal quantity.

(4)  However, if the reversal quantity is greater than the old FA receipt quantity, then the transaction will be processed against multiple FAs.  Therefore, all receipts on this FA will be reversed, and the new FA receipt quantity will be zero.  If the Receipt Over-Reversal flag on Reference File category K03 is 'N' and there are no more FA's to be processed for the remaining reversal quantity, a critical error message "Reversal quantity exceeds quantity received" will be sent.  If this flag is 'Y' and there are no more FA's to be processed for the remaining reversal quantity, the reversal will be processed against the first FA for the plant/part number/production center/revision level combination.

(5)  For over-reversal transactions, FA receipts read may not cover all of the transaction reversal quantity.  A chain will be made to the first FA satisfying the plant, part, cell, and revision level combination so that the remaining reversal quantity is accounted for in the FA.  The new FA receipt quantity for this FA will also be zero.

c.   New Balance to be Received = Daily FA Quantity (FAQTY) x

Number of Workdays (FAWDYS) - New FA Receipt Quantity (FATQR)

7.   The requirements planning net change flag (PMNCFL) on the parent part's part master record is updated when an over-receipt occurs.  This is determined from the Old and New Outstanding Balances calculated above.  The net change flag will be set only for reanalysis (1) if it is not already set for replanning (2).

a.   Old balance and new balance to be received are greater than or equal to zero--net change flag unchanged.

b.   Old balance to be received is positive or equal to zero and new balance is negative (over-receipt)--net change flag set to 1.

c.   Old balance to be received is negative (previously over-received but now may or may not be)--net change flag set to 1.

8.   All new quantities are calculated.  For the Multiple Location and Warehouse Balance files, the receipt quantity for this FA (RCTQTY) is added to the correct balance type.  (The receipt quantity is negative for reversals.)  For lot-controlled parts, the receipt quantity is added to the lot quantity on the Lot Control file.  For non-reversal transactions, the Activity Since Last Count field on the Multiple Location file and the YTD Activity field on the Warehouse Balance file are incremented with the receipt quantity.  Overflow is monitored for all of these fields.  If overflow occurs, the field is updated with all nines and a warning message is written to the transaction error register.  A warning message is also written if the balance fields are driven negative.

9.   Master File date fields are updated.  On the Multiple Location file and the Warehouse Balance file, the current date is moved into the Date of Last Transaction field.  Also, on the Warehouse Balance file, the date of last receipt and last maintenance date are updated with the current date.  The Last Maintenance Operator field is updated with the user ID.  On the Flow Authorization file, the date of last receipt and the date of last update are updated with the current date.

10.  The master files are then updated in the reverse order in which they were read.

11.  The Flow Receipts Transaction Register and Flow Receipts Audit Trail are written.

12.  Issues are then performed for the FA just processed (see the following section for a description of issues processing).  If a receipt is being processed against multiple FAs, the next FA is then processed, as well as its issues.  The program continues to process FAs until the total transaction quantity has been received (or reversed), or until a critical error occurs.

Flow Issues

1.   The Flow Requirements file (JT120M) is read for update.  The program finds the first FR for the FA being processed.  If there are no FRs for the given FA, issue processing is skipped and a message is written to the transaction error register.

2.   The issue quantity (ISSQTY) is initially calculated by multiplying the receipt quantity (RCTQTY) by the quantity of component/parent (FRQTYP).  The issue quantity is monitored for overflow.  If overflow occurs, the transaction is rejected.  If no overflow occurs, then the quantity-not-yet received (FRQNYR) and the quantity-received-to-date (FRQRTD) is calculated for the FR.

3.   The Part Master file is read to find the component record.  If the record is not found, the transaction is rejected.  If the lot control flag on the part master record is NO and if no deduct point operations are indicated on the FR (FROPNO = blanks), then a flag is set on to indicate that the component is to be backflushed (i.e., inventory balances will be updated).

4.   If the component will be backflushed, the issue location must be formatted.  Refer to section B.2.b. above for an explanation of location formatting.  If the needed location is blank, the transaction is rejected and the program terminates.

5.   The Multiple Location file (IC130M) is read for update.  If the record exists, it is locked.  If the multiple location record does not exist, a flag is set to format and add the record at update time and the Location Validation file (DE140M) is read and locked to keep another program from deleting the location before updating the multiple location record.  If the location validation record does not exist, the transaction is rejected.

6.   The record on the Warehouse Balance file (IC140M) is read for update and locked.  If the record does not exist, the transaction is rejected.

7.   The Part Master file (DE100M) is read for update.  If the record does not exist, the transaction is rejected.

8.   Calculations are performed to compute the old balance to be issued, the new FR quantity issued, and the new balance to be issued.

a.   Old Balance to be Issued =  Daily FR Quantity (FRRQTY) x

Number of Workdays (FRWDYS) - Old FR Issue Quantity (FRIQTY)

b.   New FR Issue Quantity (FRIQTY) = Old FR Issue Quantity (FRIQTY) +

Transaction Issue Quantity (ISSQTY)

      The transaction issue quantity is negative for reversals.)  The new FR issue quantity is monitored for overflow.  If overflow occurs, the field is formatted with all nines and a warning message is written to the transaction error register.

c.   New Balance to be Issued = Daily FR Quantity (FRRQTY) x

Number of Workdays (FAWDYS) - New FR Issue Quantity (FRIQTY)

9.   The Requirements Planning net change flag (PMNCFL) on the component part's part master record is updated when an over-issue occurs.  This is determined from the old and new balances to be issued calculated above.  The net change flag will only be set for reanalysis (1) if it is not already set for replanning (2).

a.   Old balance to be issued and new balance are greater than or equal to zero--net change flag unchanged.

b.   Old balance to be issued is positive or equal to zero and new balance is negative (over-receipt)--net change flag set to 1.

c.   Old balance to be issued is negative (previously over-received but now may or may not be)--net change flag set to 1.

10.  For components that are to be backflushed, the new quantities are calculated.  For the Multiple Location and Warehouse Balance files, the issue quantity (ISSQTY) is subtracted from the correct balance type.  (The issue quantity is negative for reversals.)  For non-reversal transactions, the Activity Since Last Count field on the Multiple Location file and the YTD Activity field on the Warehouse Balance file are incremented by the issue quantity.  Overflow is monitored for all of these fields.  If overflow occurs, a critical message is written to the transaction error register.  A warning message is also written if the balance fields are driven negative.  (Non-stock FRs are processed but do not update warehouse balance or multiple location files since they do not possess these records.)

11.  For components that are to be backflushed, Master File date fields are updated.  On the Multiple Location file and the Warehouse Balance file, the current date is moved into the Date of Last Transaction field.  Also on the Warehouse Balance file, the date of last issue and last maintenance date are updated with the current date.  The Last Maintenance Operator field is updated with the user ID.  On the Flow Requirements file, the date of last issue and the date of last update are updated with the current date.

12.  For components that are not to be backflushed, (lot controlled and deduct point parts) the Work In Process Balance field on the Warehouse Balance file is updated by subtracting the issue quantity (ISSQTY) from the current balance.  Also on this file, the last maintenance date is updated with the current date, and the Last Maintenance Operator field is updated with the user ID.

13.  The Master files are then updated in the reverse order in which they were read.

14.  The Flow Issues Transaction Register is written.  The Flow Issues Audit Trail is then written for backflushed components only.  Processing continues with the next FR for the given FA.  If there are no more FRs for the FA, processing ends or continues with the next FA (if more of the transaction quantity remains to be received/reversed).

15.  If the component is consumed and is a multi-level backflushed part then the following occurs:

a.   If the part is a transfer part and no FA exists for today, a stock transfer will be processed from the sourcing plant.  A record is written to the Stock Transfer Asynchronous Transaction file and a message is sent to the monitor. 

b.         If the part is manufactured, a flow receipt will be processed; a record is written to the Flow Receipt Asynchronous Transaction file, and a message is sent to the monitor.

JT125E Program Menu