RRPAnalyzeCapacityArrays

RRP, Analyze Capacity Arrays

Major Business Rule

Object Name: B3300170

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose

This function reads the Rated and Loaded Capacity arrays to calculate the gross capacity.  If the 

gross capacity is outside the range specified in the input percent parameters, the function writes 

Over/Under Capacity messages to F3311.  The function also creates capacity load records in F3313.


1.2Setup Notes and Prerequisites

• The calling application must call B3300140, RRP, Initialize Bucket Dates, before calling this 
function.  The Bucket Date Array pointer returned by B3300140 must be passed as input to this function.

• The calling application must call B3300150 (RRP, Calculate Rated Capacity) and B3300160 (RRP, 
Calculate Loaded Capacity) to allocate and load the Rated and Loaded Capacity arrays.


1.3Special Logic


2.Technical Specifications

// Read Rated and Loaded Capacity arrays to calculate gross capacity and write capacity load and 
message records

CummTotal = 0

CNCAPM = '1'

CNMCU = WorkCenter

CNUM = UnitOfMeasure

CNHCLD = 'A'

CNPID = "R3380"

Call B9800100 to get the current date (CNUPMJ), time (CNTDAY), workstation ID (CNJOBN), and user 

ID (CNUSER).

Do X = 1 to NumberOfPeriods

If BucketDateArray[X] > 0

If PastDuePeriods <> 0 or X > 1

If RatedCapacityArray[X] <> 0

PCT = LoadedCapacityArray[X] / RatedCapacityArray[X]

PCT = PCT * 100

Else

PCT = 0

End


// If percentage is outside the processing option range, write a 

message to F3311

If PCT <= UnderCapacityPercent and RatedCapacityArray[X] <> 0 and

PastDuePeriods < X

Call B3100490 to get the next Unique ID (CNUKID) value

Write a message to F3311 with field values CNCMSG = 'U', 

CNDRQJ = BucketDateArray[X], CNSTRT = 0, CNTRQT = 
LoadedCapacityArray[X],

CNUORG = RatedCapacityArray[X].

End

If (PCT >= OverCapacityPercent and PastDuePeriods < X) or
    (PCT = 0 and LoadedCapacityArray[X] <> 0 and  PastDuePeriods < X)
CallB3100490 to get the next Unique ID (CNUKID) value
Write a message to F3311 with field values CNCMSG = 'O', 

CNDRQJ = BucketDateArray[X], CNSTRT = 0, CNTRQT = 
LoadedCapacityArray[X],

CNUORG = RatedCapacityArray[X].

End


// Calculate the cumulative resource available

If PastDuePeriods < X

Diff = RatedCapacityArray[X] - LoadedCapacityArray[X]

CummTotal = CummTotal + Diff

End


// Write capacity load F3313 records

CRCAPM = '1'

CRMCU = WorkCenter

CRUM = UnitOfMeasure

CRSTRT = BucketDateArray[X]

If PastDuePeriods >= X

If PastDuePeriods = 1

CRSTRT = 0

End

If PastDuePeriods = 2

If X = 1

CRSTRT = 1/1/1900  // Used for Past Due Date 

1. Equal to Julian date value 1

Else

CRSTRT = 1/2/1900  // Used for Past Due Date 

2. Equal to Julian date value 2

End

End

End

If UnitOfMeasure = 'HR'

If PrimeLoadCode = 'L' or 'B'

CRUNTY = '1'

End

If PrimeLoadCode = 'M' or 'C'

CRUNTY = '3'

End

Else

CRUNTY = '9'

End

Do CQT = 10 to 50 incrementing by 10

CRCQT = CQT

CRTRQT = 0

If CQT = 10 and PastDuePeriods < X

CRTRQT = RatedCapacityArray[X]

End

If CQT = 20

CRTRQT = LoadedCapacityArray[X]

End

If CQT = 30 and PastDuePeriods < X

CRTRQT = PCT

End

If CQT = 40 and PastDuePeriods < X

CRTRQT = Diff

End

If CQT = 50 and PastDuePeriods < X

CRTRQT = CummTotal

End

If CRTRQT <> 0 or CQT = 10

Write a new record to F3313 using the assigned 

field values

End

End

End

End

  End


Data Structure

D3300170 - RRP, Analyze Capacity Arrays


Data Item Data Structure DescriptionI/ORequiredNotes

MCU            Work Center                        IY

UM            Unit Of Measure                  IY

GENLNG      Bucket Date Array Ptr            IY      From B3300140

GENLNG      Rated Capacity Array Ptr      IY      From B3300150

GENLNG      Loaded Capacity Array Ptr      IY      From B3300160

INT01            Past Due Periods                  IY

INT01            Number Of Periods                  IY

PILC            Prime Load Code                  IY

PCT            Over Capacity Percent            IY

PCT            Under Capacity Percent            IY

SUPPS            Suppress Error Message            I      '1' = Suppress runtime error 

message                                                                                                

                                                             handling 

                                                                        ' ' = Allow runtime error 

message                                                                               handling

DTAI            Error Message ID                  O      ' ' = Success 

                                                                        '3143' = Table access error


^

Parameter NameData ItemData TypeReq/OptI/O/Both
szWorkCenterMCUcharNONENONE

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

szUnitOfMeasureUMcharNONENONE

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, 
cubic meter, liter, hour, and so on.

idBucketDateArrayPtrGENLNGIDNONENONE

General purpose ID variable.

idRatedCapacityArrayPtrGENLNGIDNONENONE

General purpose ID variable.

idLoadedCapacityArrayPtrGENLNGIDNONENONE

General purpose ID variable.

iPastDuePeriodsINT01integerNONENONE

Number of Days in Future to Query for Responses Due. 

iNumberOfPeriodsINT01integerNONENONE

Number of Days in Future to Query for Responses Due. 

cPrimeLoadCodePILCcharNONENONE

A code that determines if a work center is machine or labor intensive. The system also uses prime load codes in Resource Requirements 
Planning and Capacity Requirements Planning calculations to develop load profiles. Valid codes are:    L Run labor hours only    M Machine 
hours only    B Run labor plus setup labor hours    C Machine plus setup hours    O Other (will not generate resource units)

mnOverCapacityPercentPCTMATH_NUMERICNONENONE

An abbreviation for percentage.

mnUnderCapacityPercentPCTMATH_NUMERICNONENONE

An abbreviation for percentage.

cSuppressErrorMessageSUPPScharNONENONE

A flag indicating whether or not runtime error messaging will occur when an error message is issued from a business function.        0 = allow 
runtime error message handling.        1 = suppress runtime error message handling.

szErrorMessageIDDTAIcharNONENONE

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 
special characters such as %, &, or +. You create new data items using system codes 55-59. You cannot change the alias.

mnF3311UniqueIDUKIDMATH_NUMERICOPTBOTH

This field is a unique number used to identify a record in a file.

szCostCenterAltMMCUcharOPTNONE

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 
represent lower-level business units, subordinate to it. For example:     o Branch/Plant (MMCU)     o Dept A (MCU)     o Dept B (MCU)     o Job 123 
(MCU) Business unit security is based on the higher-level business unit.

szWorkcenterBranchWMCUcharOPTNONE

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 
(F41001).

Related Functions

B9800100 Get Audit Information

Related Tables

F3311 Capacity Message File
F3313 Capacity Load Table