1.Functional Description
1.1Purpose
This function loads the Released or Planned Load and Period Summary Arrays with data from the Routing
records for the input Work Center and Branch. It then creates Period Summary records (F3312) for
each Item.
1.2Setup Notes and Prerequisites
The calling application must call B3300200 (CRP, Initialize Bucket Dates) before calling this
function. The Bucket Date Array pointer returned by B3300200 must be passed as input.
During the first call to this function, memory is allocated for the Released Load and Planned Load
arrays and is returned to the calling application so that it can be reused on subsequent calls. The
calling application must call B4000460, FreePtrToDataStructure, to free the memory when processing is
complete.
1.3Special Logic
2.Technical Specifications
If (ReleasedLoadArrayPtr = NULL) or (PlannedLoadArrayPtr = NULL)
Allocate memory for the ReleasedLoadArray to hold NumberOfPeriods math numeric values
ErrorMessageID = "4374"
Exit the function with an error return code
End
End
Declare array PeriodSummaryArray of NumberOfPeriods math numerics
If PlannedOrders <> '1'
Clear the PeriodSummaryArray
Clear the PlannedLoadArray
SaveOrderNumber = 0
SaveOrderType = " "
SaveItem = 0
FirstPass = FALSE
// Read Routings for the Work Center
If PlannedOrders <> '1'
WLOPSC = ' '
Do while the F3112 or T3112W fetch is successful
If PlannedOrders <> '1'
Fetch the next T3112 record
End
If WLDOCO <> SaveOrderNumber or WLDOCO = 0 or the last F3112/T3112W fetch failed
If FirstPass = TRUE
If PlannedOrders <> '1'
F3312 Order Type = "FO"
Else
Else
F3312 Order Type = SaveOrderType
End
End
Do X = 1 to NumberOfPeriods
If BucketDateArray[X] > 0 and PeriodSummaryArray[X] > 0
F3312 CWDRQJ = BucketDateArray[X]
If PastDuePeriods >= X
If PastDuePeriods = 1
F3312 CWDRQJ = 0
End
If PastDuePeriods = 2
If X = 1
F3312 CWDRQJ = 1
Else
F3312 CWDRQJ = 2
End
End
End
CapacityMode, CWDOCO = SaveOrderNumber, CWMCU = WorkCenter, CWITM =
SaveItemNumber,
CWMMCU = Branch, CWUM = UnitOfMeasure, CWUNTY = 'R',
CWTRQT = PeriodSummaryArray[X]
End
Clear the PeriodSummaryArray
End
End
FirstPass = TRUE
SaveOrderNumber = WLDOCO
SaveOrderType = WLDCTO
SaveItem = WLKIT
// Retrieve the Work Order Header and check the Inclusion Rules
If F3112/T3112W Order Number (WLDOCO) <> 0
Fetch the F4801 record for the order number WLDOCO
to validate that
// Calculate the remaining machine, labor, and setup hours and the quantity
RemainingQty = 0
If PlannedOrders <> '1'
End
RemainingHours = WLRUNL - WLLABA
End
If PrimeLoadCode = 'M' or 'C'
RemainingHours = WLRUNM - WLMACA
End
If RemainingHours < 0 or RemainingQty <= 0
RemainingHours = 0
End
SetupHours = 0
If PrimeLoadCode = 'B' or 'C'
SetupHours = WLSETL - WLSETA
If RemainingQty <= 0 and PlannedOrders <> '1'
SetupHours = 0
End
End
If RemainingHours <> 0 or SetupHours <> 0
// Adjust Requested Date or Quantity if the order has been
Decreased, Deferred, Canceled,Increased, or Expedited.
Select F3411 records using key values WADOCO and WADCTO
Do while the F3411 fetch is successful
Fetch the next F3411 record
If the fetch was successful and the F3411 MMMSGT = 'L',
'G', 'E', 'D', or 'C'
IMUOM1 passing WAMMCU.
If WAUORG <> 0
Factor = RemainingHours / WAUORG
End
RemainingHours = F3411 MMTRQT * Factor
If MMMSGT = 'D' // defer message
SaveStartDate = MMRSTJ
SaveRequestedDate = MMRRQJ
End
If MMMSGT = 'C'
If F3411 MMMSGT = 'G' // increase message
Fetch the F4101 record for item number WAITM
IMUOM1 passing WAMMCU.
If WAUORG <> 0
RemainingHours = F3411 MMTRQT * Factor
If MMMSGT = 'E' // expedite message
SaveStartDate = MMRSTJ
SaveRequestedDate = MMRRQJ
End
WLSTRT = SaveStartDate
WLDRQJ = SaveRequestedDate
End
If SkipFlag = FALSE
Call B3300230 to spread the RemainingHours and SetupHours over the
period between
WLSTRT and WLDRQJ. Pass the following parameters:
WorkCenter = WorkCenter
Branch = Branch
Unit Of Measure = UnitOfMeasure
Requested Date = WLDRQJ
Start Date = WLSTRT
Load Hours = RemainingHours
Setup Hours = SetupHours
Bucket Date Array Ptr = BucketDateArrayPtr
Number Of Periods = NumberOfPeriods
Period Summary Array Ptr = PeriodSummaryArrayPtr
If PlannedOrders and WADOCO = 0
Load Array Ptr= PlannedLoadArrayPtr
Else
Load Array Ptr= ReleasedLoadArrayPtr
End
End
End
End
^
D3300220 - CRP, Calculate Released And Planned Load
Data Item Data Structure DescriptionI/ORequiredNotes
MCU Work Center IY
MMCU Branch IY
UM Unit Of Measure IY
CAPM Capacity Mode IY
PILC Prime Load Code IY
GENLNG Bucket Date Array Ptr IY From B3300140 or B3300200
INT01 Past Due Periods IY
INT01 Number Of Periods IY
GENLNG Released Load Array Ptr I/O Used if PlannedOrders = ' '
GENLNG Planned Load Array Ptr I/O Used if PlannedOrders = '1'
EV01 Planned Orders IY '1' = Read routing info from
T3112W
' ' = Read routing info from
F3112
JOBN Job Number IY Used when calling B3401300 to
validate against inclusion
rules cache
SUPPS Suppress Error Message I '1' = Suppress runtime error
message
handling
' ' = Allow runtime error
message
handling
DTAI Error Message IDO' ' = Success
'3143' = Table access error
'4374' = Memory allocation
failed
'017E' = Insert unsuccessful
^
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
szWorkCenter | MCU | char | NONE | NONE |
An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit
| ||||
szBranch | MMCU | char | NONE | NONE |
A code that represents a high-level business unit. Use this code to refer to a branch or plant that might have departments or jobs, which
| ||||
szUnitOfMeasure | UM | char | NONE | NONE |
A user defined code (00/UM) that identifies the unit of measurement for an amount or quantity. For example, it can represent a barrel, box,
| ||||
cCapacityMode | CAPM | char | NONE | NONE |
A code indicating which planning is being used. Valid values are:
1 Resource Requirements Planning
2 Rough Cut Capacity
| ||||
cPrimeLoadCode | PILC | char | NONE | NONE |
A code that determines if a work center is machine or labor intensive. The system also uses prime load codes in Resource Requirements
| ||||
idBucketDateArrayPtr | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
iPastDuePeriods | INT01 | integer | NONE | NONE |
Number of Days in Future to Query for Responses Due. | ||||
iNumberOfPeriods | INT01 | integer | NONE | NONE |
Number of Days in Future to Query for Responses Due. | ||||
idReleasedLoadArrayPtr | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
cPlannedOrders | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
szJobNumber | JOBN | char | NONE | NONE |
The code that identifies the work station ID that executed a particular job. | ||||
cSuppressErrorMessage | SUPPS | char | NONE | NONE |
A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.
0 = allow
| ||||
szErrorMessageID | DTAI | char | NONE | NONE |
A code that identifies and defines a unit of information. It is an alphanumeric code up to 8 characters long that does not allow blanks or
| ||||
idPlannedLoadArrayPtr | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
szComputerID | CTID | char | OPT | INPUT |
mnJobNumber | JOBS | MATH_NUMERIC | OPT | INPUT |
The job number (work station ID) which executed the particular job. | ||||
mnF3312UniqueID | UKID | MATH_NUMERIC | OPT | NONE |
This field is a unique number used to identify a record in a file. | ||||
szWorkcenterBranch | WMCU | char | OPT | NONE |
This is the branch/plant to which the work center belongs and must exist in the business unit master (F0006) and branch plant constants file
| ||||
szOperationStatusCodeWo | OPST | char | OPT | NONE |
User defined code system 31, type OS. The operation status code that identifies the current status of a work order or engineering change
|
B3300230 CRP, Spread Hours Over WO Period | ||||
B3401300 Cache, Process MRP Inclusion Rules | ||||
B4000520 Get Item UoM Conversion Factor | ||||
B9800420 Get Data Dictionary Definition |
F3112 Work Order Routing | ||||
F3312 Capacity Pegging | ||||
F33UI001 Shop Floor Control Routing Instructions | ||||
F3411 MPS/MRP/DRP Message File | ||||
F4801 Work Order Master File |