InitializeCoByProductCache

Costing, Initialize CoBy Product Cache

Major Business Rule

Object Name: B3001610

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose

Determine if there are CoByProducts for the process.  Calculate the CoByProduct Cost Percent.  Store 

the CoByProducts in memory.


1.2Setup Notes and Prerequisites

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

If PO CoByProduct = '1'
• This function is performed only if the Routing is a process.
• The CoByProduct Cache must be created in ER prior to calling this business function.
• The CoByProduct Cache must be cleared or deleted after processing each Process.

1.3Special Logic

• Calculate Ratio Percent should be passed a '1' when called from the Current Level Update Section of 
P30820.


2.Technical Specifications


2.4Processing 


WorkFields

ProcessBranch

ProcessNumber

ProcessType

ProcessBatchQty

ProcessUOM

ProcessTotalAmt(P30820)

CoByExtraCost(P30820)

CoByAmount(P30820)


1.0.  Initialize DS CoByProductFound = '0', WK CoByProductAmount = 0,

2.0. Convert Batch Quantity to Transaction UOM.
BF Batch Quantity, Format for File and Display (B3000160)

Mode= '1'
Branch= DS Process Branch

Item Number= DS Process Item

Batch Quantity File= DS Process Batch Qty Prim

Display UOM= DS Process UOM

Batch Quantity Display = DS Process Batch Qty Trans

F4101Genlngx

Primary UOMx

Suppress Error Messages= '1'

Error Message Idx

ConversionFactor= DS Process UOM Conv Factor




4.0. Search selected Bill of Material for CoByProducts save any CoByProducts into memory.
4.1. Fetch CoByProducts from F3002 until fetch fails.  (LOOP)
Index:

where:  ITM = DS Process Item

CMCU = DS Process Branch
TBM = 'M'

QNTY = DS ProcessBatchQtyTrans

UM = DS ProcessUOM

return:  EFFF, EFFT, COBY, KIT, KITL, KITA, MMCU, OPSQ, F$RP


4.1.1. Check Date Effectivity Range.
4.1.2. Check F3002 CoByProduct(COBY) = 'C' or 'B'.

4.1.3. initialize Cache to blank/zero.

4.1.4. assign DS CoByProductFound = '1'

4.1.5. Save CoByProduct in Cache.

Cache ProcessBranch= DS ProcessBranch

Cache Process= DS Process Item

Cache CoByProduct  = F3002 COBY
Cache CoByProductItem= F3002 KIT

Cache CoByProductItem2nd= F3002 KITL

Cache CoByProductItem3rd= F3002 KITA

Cache CoByProductBranch= F3002 MMCU

Cache CoByProductOperation= F3002 OPSQ

Cache CoByFeatureCostPercent= F3002 F$RP

Cache CoByQuantityPrimary= F3002 BQTY

4.1.6.  Determine Cache CoByProductCostPercent.
4.1.6.1.  Read from F3404 until fetch fails using '85.

Where F3404 ParentBranch = DS ParentBranch
F3404 ParentItem = DS ParentItem
4.1.6.2.  Check Date Effectivity Range.
4.1.6.3. If F3404 Item Number = F3002 Item Number, 

and F3404 Component Branch = F3002 component Branch, 
assign Cache CoByProductCostPercent = F3404 Feature Cost Percent (F$RP).
Exit 4.1.5.

4.1.6.4.  If F3404 Item Number /= F3002 Item Number 
or F3404 Component Branch /= F3002 Component Branch, 
sub F3404 Feature Cost Percent from Cache CoByProductCostPercent.

4.1.6.5.  If Cache CoByProductCostPercent is less than 0, assign Cache 
CoByProductCostPercent = 0.


4.1.7.  Determine Cache CoByQuantityTransaction and Cache CoByConversionFactor.
Assign Cache CoByQuantityTransaction = F3002 BQTY
Retrieve Primary UOM from the Item Master using F3002 KIT, F3002 MMCU.

Convert F3002 BQTY from primary to transaction using F3002 UOM and F4101 UOM1.

Assign Cache CoByQuantityTransaction = result.

Assign Cache CoByConversionFactor = Conversion Factor for converting from F3002 Uom to 

F4101 UOM1.


4.1.8. Store CoByProduct along with CoByProductCostPercent in Cache.  BF Cache, 
ProcessCoByProduct (B3001650)

(This is only performed if called from P30820.)

5.0. If DS CalculateRatioPercent = '1', Get the CoByProduct Ratio Percent of Process

5.1. Initialize WK ProcessTotalAmt = 0       will hold sum of all B1-C4 costs for all CoBy 
products


5.2. Read Cache built in step 4 until end of cache using BF Cache, ProcessCoByProduct 
(B3001650).  (LOOP)

5.2.1. Retrieve all cost component records for the CoByProduct from the F30026. 
(LOOP)

  Index:
  Where:  

ITM = Cache CoByProductItem
MCU= Cache CoByProductBranch

LOCN = blanks

LOTN= blanks

LEDG= DS Cost Method (LEDG).


5.2.1.1. If F30026 XSF factor ,  F30026 XSR rate are not zeros, and Cache 
CoByProductCostPercent is not equal to 1, Calculate CoByProduct%Rate.
5.2.1.1.1.  Set F30026 XSMC = 0
5.2.1.1.2.  Cache CoByProduct%Rate =F30026 XSR * F30026 XSF
5.2.1.1.3.  Determine CoBy cost percent from F3404, until fetch fails.  (LOOP)

Set F3404 index:
F3404 KIT    = Cache CoByProductItem
F3404 MMCU= Cache CoByProductBranch

Check date effectivity range
If F3404 Item Number (ITM) = Cache CoByProductItem and 

F3404 Branch (CMCU) = Cache CoByProductBranch

set Cache CoByProduct%Rate = Cache CoByProduct%Rate *
F3404 F$RP, stop fetching to F3404.


5.2.1.2.  If first character of F30026 Cost Type (COST) = 'B' or 'C'
WK CoByAmount = WK CoByAmount + F30026 XSMC


5.2.2.  When done fetching F30026 records, If WK CoByAmount != 0
Cache CoByTotB1-C4 = WK CoByAmount

WK ProcessTotalAmt = WK ProcessTotalAmt + WK CoByAmount


5.2.3.  Update Cache with Cache CoByProduct%Rate and Cache CoByTotB1-  C4.

BF Cache, ProcessCoByProduct (B3001650)


5.3. Calculate the percent the CoBy is to the Process
5.3.1 Read through Cache built in step 4 using BF Cache, ProcessCoByProduct 
(B3001650).

5.3.1.1. If Cache CoByTotB1-C4 != 0
Cache CoBy%B1-C4 = Cache CoByTotB1-C4 / WK ProcessTotalAmt

Update Cache

Data Structure

D3001610 - Costing, Initialize CoBy Product Cache

Parameter NameData ItemData TypeReq/OptI/O/Both
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.

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

szProcessUOMUOMcharNONENONE

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

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.

szCostTypeLEDGcharNONENONE

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.

cCoByProductFoundEV01charNONENONE

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

mnProcessBatchQtyTransQNTYMATH_NUMERICNONENONE

The number of units that the system applies to the transaction.

mnProcessUOMConvFactorCONVMATH_NUMERICNONENONE

The factor that the system uses to convert one unit of measure to another unit of measure.

cCalculateRatioPercentEV01charNONENONE

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

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.

mnJobNumberJOBSMATH_NUMERICNONENONE

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

Related Functions

B3000160 Convert Batch Quantity
B3001650 Cache, Process CoBy Product
B3003870 Get Work Center By Operation Sequence

Related Tables

F3002 Bill of Material Master File
F30026 Item Cost Component Add-Ons
F3404 Co-Products Planning/Costing Table
F4101 Item Master