CalculateRoutingBucketTotals

Calculate Routing Bucket Totals

Major Business Rule

Object Name: B3000630

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose

This function will calculate the routing costs for a particular routing record (F3003).  The costs 

will be retrieved for all cost types in UDC table 30/CO.  They will be accumulated in one of two ways.  

In total mode the values will be returned by cost bucket.  The cost bucket is determined by the value 

in the first description of the cost type in the UDC table.  In this mode the costs for buckets #1-#6 

will be returned from one call.  The total of the costs of buckets #1-#6 will be returned in bucket 

#7.  When this function is called in detail mode, the costs will be returned one by one for each cost 

type which belong in buckets #3-#6.  A flag will be returned when the last cost for the routing record 

has been retrieved.  The calculations may be performed in Frozen ('1') and Simulated ('0') mode.  The 

mode sent in will determine values used in the cost calculations. 


The costs will use values returned from other business functions to determine the costs.


1.2Setup Notes and Prerequisites

This function calls other functions that will calculate the costs.  The purpose of this function is 

primarily to return the data by cost bucket as opposed to by cost type.  The values required to send to 

other functions will be handled within this function and do not need to be calculated.  However, the 

following are parameters that need to be retrieved or values that need to be determined before calling 

the function:

• Need Routing Master Pointer (F3003)
• Need Manufacturing Constants Pointer (F3009)
• Send in Mode of Processing.  '1' - Totals will be returned. '2' - Build detail array.  '3' - 
Retrieve one detail line.  '4' - Free memory.

• Send in Frozen/Simulated Mode.  '1' equals Frozen and '0' equals Simulated.
• Cost Methods represents the values to be used when retrieving records from F4105, F30026, and 
F30008.  The default for Cost Method_1 is '07'.  If Cost Method_2 (used for Purchased Item calculations) or 

Cost Method_3 (used for Outside Operations calculations) does not contain a value, then Cost Method_1 

will be used.

• The parameters that retrieve cost bucket costs will return the individual costs calculated.  When in 
Processing Mode '1', the detail cost will be returned in cost bucket '1'.

• When calculating costs in detail mode, then cost type from UDC table 30/CO will be returned in 
parameter Cost Type Calculated.  It's associated cost bucket will be returned as well.

• When Include1&2 is set to a '1', the amounts calculated for Cost Buckets #1 & #2 will be included in 
the total accumulated in Bucket #7.  Otherwise the total will only include Buckets #3-#6.


1.3Special Logic

If this business function is called, ultimately this function should be called a final time to clean 

up the memory..


2.Technical Specifications


2.4Processing 


A.  Load link list with all UDC items from table 30/CO with Cost Type (DRKY) and Bucket Number        

  

     (DRDL01).  The link list will be sorted by Bucket Number.


B.  This function is called to calculate the costs for one F3003 record at a time. For each record, 

the link list previously built will be used to accumulate the costs in the appropriate buckets.


1.  Call Convert Batch Quantity (B3000160) for IRBQTY.  Save returned value as PBQTY.


2.  Retrieve Time Basis Units by calling Convert Time Basis Code To Quantity (B3000330).  

Save returned value in TIMB.


3.  Call Calculate First Op Cost Buckets (B3000650) first time in mode '1' to load arrays and

retrieve the costs for A1.  The next call will send a mode = ' ', and will 

retrieve the costs for A2.       The last call will destroy the arrays 

that were built in the previous call.  If Cost Method_2 sent into

this function is blank or Purchased/Manufactured is equal to 'M' send 

Calculate First Op Cost Buckets (B3000650) Cost Method_1.  

If Cost Method_2 is not blank and Purchased/Manufactured

is equal to 'P', use Cost Method_2. (Added 10/6/95)


     The call to this function should retrieve IXBQTY (Batch Quantity) associated with the BOM 

records used by the function along with IXUOM (Unit of Measure as Input). 

Convert Batch Quantity (B3000160) should be called to convert the 

quantity into its display unit of measure.


     If Include1&2 is a '1' and A1 or A2 is in Bucket #1 or Bucket #2, then the costs

calculated should be included in Bucket #7.  Other wise they should not be 

added to Bucket #7.

 

4.  Call Get Item UoM Conversion Factor (B4000520) for a quantity of  '1' and save conversion 
factor.


5.  Call Check For Operation Resources (B3000060) to check for intermediate items.  If a '1' is 
returned from VC01A, then an intermediate item exists and Calculate Intermediate Qty With 

Shrink (B3000290) should be called with PBQTY sent in the requested quantity field.


6.  Call Calculate Machine or Labor Hours (B3000220) should be called to retrieve the Machine 
and Labor hours that will be sent to  B3000470.  The requested quantity sent into function 

B3000470 should be a '1' or the value retrieved from B300290 if there is an intermediate item.  Divide 

the returned value for RUNL and RUNM by the unit of measure conversion factor retrieved above.  

If an intermediate item exists, divide the result from (5) by PBQTY and then multiply it times 

RUNL and RUNM.


7.  If the Work Center for the record being processed is different then the previous Work 
Center, then call Verify And Get Work Center Master (B3000400) to retrieve the pointer to file 

F30006.  Send in a call type of '1' and a '1' in the return pointer flag along with the work center.


8.  If the Work Center for the record being processed is different then the previous Work 
Center, then call Verify And Get WC Rates (B3000460) with the Work Center, Cost Method, Return 

Pointer = '1', and Call Type = '1'.  If a record is not found with these values and the Cost Method_1 

used is not equal to '07', call the function again with the Cost Method_1 equal to '07'.  This 

will return the pointer to the F30008 file.


9. Call Calculate Routing Costs (B3000470) to retrieve the costs for the following Cost Types 
if the are assigned to a bucket greater than 2:


If IRRUNL and TIMB ne zero:

B1 Call function B3000470 to retrieve the Direct Labor Cost.  Then multiply Direct Labor by 
Requested Qty and add to appropriate cost bucket.


If IRSETL ne zero:

B2 Call function B3000470 to retrieve the Setup Labor Cost.  Multiply returned value by 
Accounting Cost Quantity and add to appropriate cost bucket.

If IRRUNM and TIMB ne zero:

B3 Call function B3000470 to retrieve the Machine Labor Cost.  Then multiply Machine Labor 
by  Requested Qty and add to appropriate cost bucket.


If IRRUNL and IWWORE (from F30006) and TIMB ne zero and IAMWCE (from F3009) eq 'Y':

B4 Call function B3000470 to retrieve the Labor Efficiency Cost.  Then multiply Labor 
Efficiency by  Requested Qty and add to appropriate cost bucket.


If IRRUNM and Timb ne zero and IAIVMO eq 'Y':

C1 Call function B3000470 to retrieve the Variable Machine Overhead Cost.  Then Multiply 
Variable Labor Overhead by Requested Qty and add to appropriate cost bucket.


If IRRUNM ne zero and IAIFMO eq 'Y' and TIMB ne zero:

C2 Call function B3000470 to retrieve the Fixed Machine Overhead Cost.  Then Multiply 
Variable Labor Overhead by Requested Qty and add to appropriate cost bucket.


If IAIVO eq 'Y'and IACVDL eq 'Y' or IACVSL ne 'Y' and 

IRRUNL ne zero or IRSETL ne zero:

C3 Call function B3000470 to retrieve the Variable Labor Overhead Cost.  Then Multiply 
Variable Labor Overhead by Requested Qty and add to appropriate cost bucket.


If IAIFO eq 'Y' and IACFDL eq 'Y' or IACFSL eq 'Y' and 

IRRUNL ne zero or IRSETL ne zero:

C4 Call function B3000470 to retrieve the Fixed Labor Overhead Cost.  Then multiply Fixed 
Labor Overhead by  Requested Qty and add to appropriate cost bucket.


If the mode is '1' and  a cost type's bucket is equal to '1' or '2', then Calculate First Op 
Cost Buckets (3000650) should be called with the cost type to calculate the proper cost.  

Inclue1&2 should be checked to see if the quantities should be accumulated in Bucket#7.


If Mode is '1'  Accumulate the Totals for each bucket and return after all buckets have been 

calculated.


If Mode is '2' calculate all costs and save them in a link list.  The link list for the detail 
costs will contain the cost type, calculated cost, and cost bucket.  The nodes will be sorted by 

cost bucket.  Each successive call will retrieve one node at a time from the link list.  During 

the call when the final node has been retrieved, a '1' will be returned in LastDetailLineSent.  

All three items from the link list need to be returned.  Once all of the nodes have been 

retrieved, the function will be called a final time to free the memory for the detail link list.


10.  If IRCOST NE blank
Call Calculate Outside Operations (B3000640) using IRCOST as the Cost Type and save 
returned value in the appropriate cost bucket.  Send in Cost Method_3 if it is not blank.  If 

it is blank, use Cost Method_1.   Inclue1&2 should be checked to see if the quantities 

should be accumulated in Bucket#7 if the cost bucket is equal to '1' or '2'.  If mode is not 

'1' and the Cost Bucket for IRCOST is '1' or '2', then this function does not need to be 

called.


Data Structure

D3000630 - Calculate Routing Bucket Totals

Parameter NameData ItemData TypeReq/OptI/O/Both
idPointerToRoutingMasterGENLNGIDNONENONE

General purpose ID variable.

mnBatchQuantityBQTYMATH_NUMERICNONENONE

The quantity of finished units that you expect this bill of material or routing to produce. You can specify varying quantities of components 
based on the amount of finished goods produced. For example, 1 ounce of solvent is required per unit up to 100 units of finished product. 
However, if 200 units of finished product is produced, 2 ounces of solvent are required per finished unit. In this example, you would set up batch 
quantities for 100 and 200 units of finished product, specifying the proper amount of solvent per unit.

szTypeBillTBMcharNONENONE

A user defined code (40/TB) that designates the type of bill of material. You can define different types of bills of material for different uses. 
For example:    M     Standard manufacturing bill    RWK   Rework bill    SPR   Spare parts bill  The system enters bill type M in the work order 
header when you create a work order, unless you specify another bill type. The system reads the bill type code on the work order header to 
know which bill of material to use to create the work order parts list. MRP uses the bill type code to identify the bill of material to use when it 
attaches MRP messages. Batch bills of material must be type M for shop floor management, product costing, and MRP processing.

mnCostBucket1B1EV1MATH_NUMERICNONENONE

Work Amount field for the Manufacturing System.

mnCostBucket2B2EV1MATH_NUMERICNONENONE

Work Amount field for the Manufacturing System.

mnCostBucket3B3EV1MATH_NUMERICNONENONE

Work Amount field for the Manufacturing System.

mnCostBucket4B4EV1MATH_NUMERICNONENONE

Work Amount field for the Manufacturing System.

mnCostBucket5B5EV1MATH_NUMERICNONENONE

Work Amount field for the Manufacturing System.

mnCostBucket6B6EV1MATH_NUMERICNONENONE

Work Amount field for the Manufacturing System.

mnCostBucket7B7EV1MATH_NUMERICNONENONE

Work Amount field for the Manufacturing System.

cModeMODEcharNONENONE

The processing mode used in Purchase Order Consolidator to signify when specific orders are being processed.

cFrozenMODEcharNONENONE

The processing mode used in Purchase Order Consolidator to signify when specific orders are being processed.

szCostTypeCalculatedCOSTcharNONENONE

A code that designates each element of cost for an item. Examples of the cost object types are:   o  A1  Purchased raw material   o  B1  
Direct labor routing rollup   o  B2  Setup labor routing rollup   o  C1  Variable burden routing rollup   o  C2  Fixed burden routing rollup   o  Dx  Outside 
operation routing rollup   o  Xx  Extra add-ons, such as electricity and water  The optional add-on computations usually operate with the type 
Xx extra add-ons. This cost structure allows you to use an unlimited number of cost components to calculate alternative cost rollups. The 
system then associates these cost components with one of six user defined summary cost buckets.

cCostBucketEV01charNONENONE

An option that specifies the type of processing for an event.

mnRequestedQuantityRQTE1MATH_NUMERICNONENONE

The number of parent items that you want to process. The system calculates lower level values in quantity per the number of parent items 
requested. For instance, if it takes 3 components per a parent item, then with a requested quantity of 10, the system would plan and cost for 30 
components.

mnAccountingCostQtyACQMATH_NUMERICNONENONE

An amount that the system uses in the Cost Rollup program to determine the allocation of setup costs. The system totals the setup costs 
and divides the sum by this quantity to determine a unit setup cost. The default is 1.

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.

cSuppressErrorMessageEV01charNONENONE

An option that specifies the type of processing for an event.

idPointerToMfgConstantsGENLNGIDNONENONE

General purpose ID variable.

szCostMethod_1LEDGcharNONENONE

A user defined code (40/CM) that specifies the basis for calculating item costs. Cost methods 01 through 19 are reserved for J.D. Edwards 
use.

szCostMethod_2LEDGcharNONENONE

A user defined code (40/CM) that specifies the basis for calculating item costs. Cost methods 01 through 19 are reserved for J.D. Edwards 
use.

szCostMethod_3LEDGcharNONENONE

A user defined code (40/CM) that specifies the basis for calculating item costs. Cost methods 01 through 19 are reserved for J.D. Edwards 
use.

cLastDetailLineSentEV01charNONENONE

An option that specifies the type of processing for an event.

szUnitOfMeasureUOMcharNONENONE

A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box).

cInclude1and2EV01charNONENONE

An option that specifies the type of processing for an event.

jdAsOfDateASDE1JDEDATENONENONE

The date used for effectivity checking. Enter a specific date to display documents (orders, bills of material, routings, as applicable) that are 
effective on or after that date. The current system date is the default, but you can enter any future or past date.

cPurchased_ManufacturedEV01charNONENONE

An option that specifies the type of processing for an event.

cCalledFromCostedRoutingEV01charOPTNONE

An option that specifies the type of processing for an event.

mnItemNumberOriginalKITMATH_NUMERICOPTNONE

The system provides for three separate item numbers.    1.   Item Number (short) - An eight-digit, computer assigned, completely 
non-significant item number.    2.   2nd Item Number - The 25-digit, free form, user defined alphanumeric item number.    3.   3rd Item Number - Another 
25-digit, free form, user defined alphanumeric item number.

idListPointerGENLNGIDOPTNONE

General purpose ID variable.

idFirstOpListPtrGENLNGIDOPTNONE

General purpose ID variable.

Related Functions

None

Related Tables

None