1.Functional Description
1.1Purpose
This function loads the Rated and/or Gross Capacity Arrays with data from the Resource Units table
(F3007) corresponding to the bucket dates in the Bucket Date Array.
1.2Setup Notes and Prerequisites
The calling application must call B3300140 (RRP, Initialize Bucket Dates) or B3300200 (CRP,
Initialize Bucket Dates) before calling this function. The Bucket Date Array pointer returned by these
functions must be passed as input to this function.
During the first call to this function, memory is allocated for the Rated and/or Gross Capacity
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 (RatedCapacityArrayPtr is NULL) or (GrossCapacityArrayPtr = NULL and LoadGrossCapacity = '1')
Allocate memory for the RatedCapacityArray to hold NumberOfPeriods math numeric values
If LoadGrossCapacity = '1'
numeric values
If either allocation fails
ErrorMessageID = "4374"
Exit the function with an error return code
End
End
Declare array ResourceUnitsArray of 31 math numerics
Clear the ResourceUnitArray
Clear the RatedCapacityArray
If LoadGrossCapacity = '1'
Clear the GrossCapacityArray
End
If PastDueDates > 0
WorkDate = BucketDateArray[PastDueDates]
Else
WorkDate = BucketDateArray[1]
End
Fetch the F3007 record using key values WUMCU = WorkCenter, WUMMCU = Branch, WUUM = UnitOfMeasure,
WUYR = year from WorkDate, WUMT = month from WorkDate.
Copy the Resource Units fields from the F3007 record into the ResourceUnitsArray
If LoadGrossCapacity = '1'
WUWORU = WUWORU / 100
Do X = 2 to NumberOfPeriods
If BucketDateArray[X] > 0
If (month from WorkDate < month from BucketDateArray[X]) or
(month from WorkDate = 12 and month from BucketDateArray[X] = 1)
If day from BucketDateArray[X] > 14
Fetch the F3007 record using key values WorkCenter, Branch,
UnitOfMeasure, year from
the ResourceUnitsArray
If LoadGrossCapacity = '1'
WUWORU = WUWORU / 100
If LoadGrossCapacity = '1'
GrossCapacityArray[X] = RUTotal
RUTotal = RUTotal * WUWORE * WUWORU
End
RatedCapacityArray[X] = RUTotal
RUTotal = 0
If the previous F3007 fetch was successful and WorkDate is not
the last day of the month
Add 1 day to WorkDate
Do I = day from WorkDate to 31
RUTotal = RUTotal + ResourceUnitsArray[I]
End
Round RUTotal to 9 decimals
GrossCapacityArray[X] = GrossCapacityArray[X] +
RUTotal
RUTotal = RUTotal * WUWORE * WUWORU
End
End
Fetch the F3007 record using key values WorkCenter, Branch,
UnitOfMeasure, year from BucketDateArray[X], month from BucketDateArray[X].
RUTotal = 0
the ResourceUnitsArray
If LoadGrossCapacity = '1'
WUWORU = WUWORU / 100
Do I = 1 to day from BucketDateArray[X]
RUTotal = RUTotal + ResourceUnitsArray[I]
End
Round RUTotal to 9 decimalsIf LoadGrossCapacity = '1'
GrossCapacityArray[X] = GrossCapacityArray[X] + RUTotal
RUTotal = RUTotal * WUWORE * WUWORU
End
End
End
Else
RUTotal = 0
If the previous F3007 fetch was successful
Add 1 day to WorkDate
Do I = day from WorkDate to day from BucketDateArray[X]
RUTotal = RUTotal + ResourceUnitsArray[I]
End
Round RUTotal to 9 decimals
RUTotal = RUTotal * WUWORE * WUWORU
End
End
WorkDate = BucketDateArray[X]
End
D3300150 - CRP, Calculate Rated Capacity
Data Item Data Structure DescriptionI/ORequiredNotes
MCU Work Center IY
MMCU Branch IY
UM Unit Of Measure IY
GENLNG Bucket Date Array Ptr IY From B3300140 or B3300200
INT01 Past Due Periods IY
INT01 Number Of Periods IY
GENLNG Rated Capacity Array Ptr I/OY Used by R3380 and R3382
GENLNG Gross Capacity Array Ptr I/O Used only by R3382
EV01 Load Gross Capacity IY ' ' = only load Rated
Capacity Array '1' = load both arrays
SUPPS Suppress Error Message I '1' = Suppress runtime error
message ' ' = Allow runtime
error message
DTAI Error Message ID O ' ' = Success
'3143' = Table access error
'4374' = Memory allocation failed
^
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,
| ||||
idBucketDateArrayPtr | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
idRatedCapacityArrayPtr | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
idGrossCapacityArrayPtr | GENLNG | ID | NONE | NONE |
General purpose ID variable. | ||||
cLoadGrossCapacity | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
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
| ||||
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. |
None |
F3007 Work Center Resource Units |