CostingCalculateCoByProductCosts

Costing Calculate CoBy Product Costs

Major Business Rule

Object Name: B3001620

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose

        This function is used to calculate CoBy Product costs.



1.2Setup Notes and Prerequisites

• This function is performed once per Routing Operation if the CoByProducts are being rolled and 
CoByProductsFound. 

If PO CoByProduct = '1'
If CoByProductFound = '1'

• This function is performed only if the Routing is a process.
ProcessItem = '1'
• CoByProductTotalCost is initialized to 0 for each Process.
• This business function is called after all costs for the routing operation have been calculated.
• B3001660 - stores Outside Operation Costs are stored in a Linked list.
• B3001610 - stores the CoByProducts into Cache.

1.3Special Logic

None


2.Technical Specifications


2.4Processing 


Work fields

WK Cost Type

WK AmountCostType

WK AccumCoByOperation

WK AccumCoByAmount  


0.0.  WK AccumCoByOperation = 0


1.0.  Read CoByProducts from cache where Cache Process Branch = DS Process Branch, Cache Process 
Item = DS Process Item, and Cache Operation Sequence = DS Operation Sequence, and DS JOBS. until fetch 

fails.. (BF B3001650)  (LOOP)

1.1. If the Cache CoByProductCostPercent is not equal to zero, continue; else read next record 
from cache.

1.2. Process Cost Type B1

1.2.1. Set WK Cost Type = B1
1.2.2. Set WK AmountCostType = DS B1AccumAmount

1.2.3. Call Internal function - AddUpdateCostComponent

1.3. Process Cost Type B2
1.3.1. Set WK Cost Type = B2
1.3.2. Set WK AmountCostType = DS B2AccumAmount

1.3.3. Call Internal Function - AddUpdateCost/Component

1.4. Process Cost Type B3
1.4.1. Set WK CostType = B3
1.4.2. Set WK AmountCostType = DS B3AccumAmount

1.4.3. Call Internalfunction - AddUpdateCostComponent

1.5.  Set WK Cost Type = B4
1.5.1. Set WK CostType = B4
1.5.2. Set WK AmountCostType = DS B4AccumAmount

1.5.3. Call Internalfunction - AddUpdateCostComponent

1.6. Process Cost Type C1
1.6.1. Set WK CostType = C1
1.6.2. Set WK AmountCostType = DS C1AccumAmount

1.6.3. Call Internal function - AddUpdateCostComponent

1.7.Process cost Type C2 
1.7.1. Set WK CostType = C2
1.7.2. Set WK AmountCostType = DS C2AccumAmount

1.7.3. Call Internalfunction - AddUpdateCostComponet

1.8.Process Cost Type C3
1.8.1. Set WK CostType = C3
1.8.2. Set WK AmountCostType = DS C3AccumAmount

1.8.3. Call Internalfunction - AddUpdateCostComponent

1.9. Process Cost Type C4
1.9.1. Set WK CostType = C4
1.9.2. Set WK AmountCostType = DS C4AccumAmount

1.9.3. Call Internalfunction - AddUpdateCostComponent

1.1. Process OutsideOperationCosts (LOOP)
1.10.1. Read from OutsideOperationCosts Linked list until fetch fails.
1.10.2. Set WK CostType = Cache CostType

1.10.3. Set WK AmountCostType = Cache TotalCostAmount

1.10.4. Call Internal Function - AddUpdateCostComponent.

2.0.  Roll CostAmountOperation into CostAmount in the CoByAccumCosts Cache.  Read each record in 

Cache and Assign Cache CostAmount = Cache CostAmount + Cache CostAmountOperation.  Assign Cache 

CostAmountOperation = 0.



Internal Function:  AddUpdateCostComponent 

1.0. Retrieve CoByAccumCosts Cache using B3003010 where Cache Cost Type = WK Cost.  Assign WK 
AccumCoByAmount = Cache Cost Amount.  Assign WK AccumCoByOperation = Cache CostAmountOperation.

1.1. Fetch Cost Component record from F30026 

Index:
Where:  ITM = Cache CoByItemNumber

MMCU= Cache CoByProductBranch

LOCN= blank

LOTN= blank

LEDG= DS Cost Method

COST= WK Cost

2.0. If Fetch is not successful, initialize F30026 fields for add.
Assign F30026 LITM = Cache CoByProductItem2nd
F30026 AITM = Cache CoByProductItem3rd
F30026 PFLG = '1'

3.0. If WK AmountCostType is not equal to zero and Cache FeatureCostPercent is not equal to zero, 
accumulate amount of Co/By cost for this operation.

3.1. WK CoByNetAdded = ((WK AmountCostType - WK AccumCoByAmount) * (Cache FeatureCostPercent / 
100)).

3.2. WK AccumCoByOperation = WK AccumCoByOperation + WK CoByNetAdded.

3.3. If WK CoByNetAdded is not equal to zero and Cache FeatureCostPercent is not equal to 

zero, determine cost per unit.

3.3.1. Multiply cost by Cost Percent .  
If PO CoByProducts = '1' and Cache CoByCostPercent is not equal to 1, WK CoByNetAdded = 

WK CoByNetAdded * Cache CoByCostPercent.


SAR 2809743: 

Do the following, except for B2. (Since B2 is Setup cost, we don't need to extend the 

cost)

If  (strcmp (szCostType, "B2")! = 0)

 










3.4. Assign F30026 XSMC = F30026 XSMC + WK CoByNetAdded.

4.0. Update CostAmountOperation in CoByAccumCostCache using B3003010 where Cost Type = WK Cost.  
Assing Cost AmountOperation = WK AccumCoByOperation. 

5.0.  If fetch of F30026 was successful, update the F30026 record.

6.0.  If fetch of F30026 was unsuccessful, add a record to F30026.

Data Structure

D3001620 - Costing Calculate CoBy Product Costs

Parameter NameData ItemData TypeReq/OptI/O/Both
mnOperationSequenceOPSQMATH_NUMERICNONENONE

A number used to indicate an order of succession. In routing instructions, a number that sequences the fabrication or assembly steps in the 
manufacture of an item. You can track costs and charge time by operation. In bills of material, a number that designates the routing step in the 
fabrication or assembly process that requires a specified component part. You define the operation sequence after you create the routing 
instructions for the item. The Shop Floor Management system uses this number in the backflush/preflush by operation process. In engineering 
change orders, a number that sequences the assembly steps for the engineering change. For repetitive manufacturing, a number that 
identifies the sequence in which an item is scheduled to be produced. Skip To fields allow you to enter an operation sequence that you want to begin 
the display of information. You can use decimals to add steps between existing steps. For example, use 12.5 to add a step between steps 
12 and 13.

mnCoByProductTotalMN29D9MATH_NUMERICNONENONE

This is a generic field used as a work field in Everest.

mnB1AccumCostMN29D9MATH_NUMERICNONENONE

This is a generic field used as a work field in Everest.

mnB2AccumCostMN29D9MATH_NUMERICNONENONE

This is a generic field used as a work field in Everest.

mnB3AccumCostMN29D9MATH_NUMERICNONENONE

This is a generic field used as a work field in Everest.

mnB4AccumCostMN29D9MATH_NUMERICNONENONE

This is a generic field used as a work field in Everest.

mnC1AccumCostMN29D9MATH_NUMERICNONENONE

This is a generic field used as a work field in Everest.

mnC2AccumCostMN29D9MATH_NUMERICNONENONE

This is a generic field used as a work field in Everest.

mnC3AccumCostMN29D9MATH_NUMERICNONENONE

This is a generic field used as a work field in Everest.

mnC4AccumCostMN29D9MATH_NUMERICNONENONE

This is a generic field used as a work field in Everest.

szCostMethodLEDGcharNONENONE

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.

mnProcessBatchQtyTransBQTYMATH_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.

idOutsideOperPointerGENLNGIDNONENONE

General purpose ID variable.

cSuppressErrorMessagesEV01charNONENONE

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

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.

mnProcessItemKITMATH_NUMERICNONENONE

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.

szProcessBranchMMCUcharNONENONE

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.

szProgramIDPIDcharNONENONE

The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry 
interactive program is P4210, and the number of the Print Invoices batch process report is R42565. The program ID is a variable length value. 
It is assigned according to a structured syntax in the form TSSXXX, where: T The first character of the number is alphabetic and identifies the 
type, such as P for Program, R for Report, and so on. For example, the value P in the number P4210 indicates that the object is a 
program. SS The second and third characters of the number are numeric and identify the system code. For example, the value 42 in the number P4210 
indicates that this program belongs to system 42, which is the Sales Order Processing system. XXX The remaining characters of the numer are 
numeric and identify a unique program or report. For example, the value 10 in the number P4210 indicates that this is the Sales Order Entry 
program.

mnJobNumberJOBSMATH_NUMERICNONENONE

The job number (work station ID) which executed the particular job.

mnProcessUOMFactorQTYMATH_NUMERICOPTNONE

The number of units associated with an asset.

szWorkCenterMCUcharOPTNONE

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.

cCostByWorkCenterCWCcharOPTNONE

A code, maintained in the Manufacturing Constants program (P3009), that indicates whether the system tracks cost variances for discrete 
and process items on a summarized level in the Item Cost Component Add-Ons table (F30026) or on a detailed level in the Item Cost 
Component Detail table (F300261). Valid values are: Y Yes. Maintain costs on a detailed level by cost component and work center. N No. Maintain costs 
on a summarized level by cost component only.

Related Functions

B3001650 Cache, Process CoBy Product
B3001660 Costing Process Outside Operation
B3003010 Cache Process Co By Accum Costs
B3003900 F300261 Cost Components Detail Cache
B9800100 Get Audit Information

Related Tables

F30026 Item Cost Component Add-Ons