UpdateTotalCostInformation

Update Total Cost Information

Major Business Rule

Object Name: B3000680

Parent DLL: CMFG

Location: Client/Server

Language: C

1.Functional Description
This function will take the F3002 pointer passed in for a parent/component item combination and 
determine the quantity of the component needed to produce the parent item.  The component quantity will 

then be multiplied by the cost of the component item and that cost will be rolled up into the parent.  

Component scrap will also be calculated and rolled up into the parent.


1.1Purpose
This function will take a BOM record retrieved in Business Function B3000670 and roll the component 
cost into the cost of the parent item.


1.2Setup Notes and Prerequisites

This function is called from business function UpdateWhereUsed B3000670.C

1.3Special Logic


the structure for the two linked lists to be used in this business function.
Cost Rollup Linked List
COSTCost Type (i.e. A1,B1) (CT)
XSCRCost Amount  (CA)

XSMCManufactured Cost

XSCRRolled Costs



2.Technical Specifications

2.4Processing 


1.  Use business function VerifyAndGetItemMaster for ITM.  Get UOM1 for component item (F3002 ITM).


2.  Calculate Component Quantity 

Use Business function CalculateComponentQuantity call with

ITM from F3002pointer

CMCU from F3002pointer

QNTY from F3002pointer

UM from F3002pointer

UOM1 from step 1

FORQ from F3002pointer

BQTY from F3002pointer

DS CONV

STPP from F3002pointer

F_RP from F3002pointer

TRQT = '1'

you will get back QNTY

save QNTY into work field $$QNTY(9 decimals)


3.  Calculate Percent of Scrap

IF SCRP from F3002pointer NE zeros

divide SCRP by 100 and multiply by $$QNTY put into work field $$SCRP(9decimals)


4. If DS Process Item != 'R' and DS ProcessCoByProducts = '1'
Call BF Costing,CalculateCostPct (B3001670)
DS F3002Pointer KIT > DS Parent Item

DS F3002Pointer MMCU> DS Branch

DS AsOfDate> DS As of Date

'1'> DS Suppress Error Messages

WK Parent Cost Percent< DS Parent Cost Percent



4.  All items that are effected by this item must be updated to include cost rollup totals.


move zeros to $$AMT(29 big, 9 decimals)


Do While nodes exist in the CostRollupLinkedList

move KIT to ITM
move MMCU to MMCU

move blanks to LOCN

move blanks to LOTN

move LEDG to LEDG

move Cost Type from CostRollupLinkedList  to COST (you will walk through the linked list 

with the counter)


4.a  Fetch to F30026 with key set in step 4.

if(fetch was unsuccessful)

   move '1' to PFLG

end

4.b  Calculate cost

4.b.1 $$QTY(9dec) = XSCR (Cost Amount) from Cost RollupLinkedList * $$QNTY (cost x qty).
4.b.2 If DS ProcessCoByProducts = '1' and DS ProcessItem != 'R' and $$QTY != zeros, and WK 

ParentCostPercent != 1.00

$$QTY = WK Parent Cost Percent x $$QTY           (decrease cost x F3404%)
4.b 3 $$CC (15 decimals) = $$QTY

4.c  Update simulated cost rollup amount for A1

add $$CC to F30026 XSCR


4.d  Accumulate amount for scrap calculation A2

SCRP from F3002pointer if NE zeros

add XSCR (Cost Amount) from Cost RollupLinkedList  to $$AMT


4.e  Either Update or Create a new cost rollup record (F30026)

move KITA from F3002pointer to AITM of F30026

move KITL from F3002pointer to LITM of F30026

move MMCU from F3002pointer to MMCU of F30026

move blanks to LOCN of F30026

move blanks to LOTN of F30026

move DS LEDG to LEDG of F30026


if fetch in 4.a was successful then update F30026 table

if fetch in 4.a was unsuccessful then write F30026 table


******Process******

4.f.  Update Cost Component records for CoByProducts
If CoByProductFound = '1'

Call BF B3001640.C ProcessCostingWhereUsed:
F3002 OperationSequence(OPSQ)>DS OperationSequence
DS CostMethod>DS CostMethod

WK IngredientCost>DS IngredientCost

CostType in COST (Step 4)>DS CostType

F3002BatchQuantity(BQTY)>DS ProcessBatchQty

UOM ConversionFactor>DS CONV

DS JOBSDS JOBS


******End Process****


increment counter for do while

end(to step 4 do while )


5.  If scrap, update/write scrap cost type record(A2)


if SCRP from F3002pointer NE zeros


5.a  Get cost component record

move blanks to LOCN

move blanks to LOTN

move DS LEDG to LEDG

move A2 to COST


fetch F30026 record

if(fetch was unsuccessful)

   move '1' to PFLG

end


5.b  Calculate Percent of Scrap

5.b.1. Multiply $$AMT from step 4.d  by $$SCRP from step 3 into $WK156(9 decimals)
5.b.2. If DS ProcessCoByProducts = '1', and DS ProcessItem = 'R', and $WK156 != 0, and WK 

Parent Cost Percent != 1.00

$WK156 = WK Parent Cost Percent x $WK156         (decrease cost x F3404%)
5.b.3 Set WK Scrap Cost = $WK156
5.b.4. Get $WK156 into 15.0 decimals and Add $WK156 to XSMC(F30026 table field) 


5.c  Either update or Create a new Cost Rollup Record (F30026)

move KITA from F3002pointer to AITM of F30026

move KITL from F3002pointer to LITM of F30026

move MMCU from F3002pointer to MMCU of F30026

move blanks to LOCN of F30026

move blanks to LOTN of F30026

move DS LEDG to LEDG of F30026


if fetch in 5.a was successful then update F30026 table

if fetch in 5.a was unsuccessful then write F30026 table


******Process******

5.d  Update Cost Component Records for CoByProducts 

If CoByProductFound = '1'

Call BF B3001640.C ProcessCostingWhereUsed:
F3002OperationSequence(OPSQ)> DS OperationSequence
DS CostMethod> DS CostMethod

WK Scrap Cost> DS Ingredient Cost

F30026 COST(step 5.a) > DS Cost Type

F3002BatchQuantity(BQTY)> DSProcessBatchQty

DS CONV> DS UOMConversionFactor

DS JOBS> DS JOBS

******End Process*****


end(to if in step 5)





^

Data Structure

D3000680 - Update Total Cost Information

Parameter NameData ItemData TypeReq/OptI/O/Both
idParentChildCachePointerGENLNGIDNONENONE

General purpose ID variable.

mnUOMConvertionFactorCONVMATH_NUMERICNONENONE

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

idCostRollupLinkedListGENLNGIDNONENONE

General purpose ID variable.

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.

cSuppressErrorMessageEV01charNONENONE

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.

cCoByProductFoundEV01charNONENONE

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

szProcessItemSPHDcharNONENONE

A code that indicates special processing requirements for certain user defined code values. The value that you enter in this field is unique 
for each user defined code type. The system uses the special handling code in many ways. For example, special handling codes defined for 
Language Preference specify whether the language is double-byte or does not have uppercase characters. Programming is required to 
activate this field.

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.

cProcessCoByProductsEV01charNONENONE

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

mnJobNumberJOBSMATH_NUMERICNONENONE

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

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

Related Functions

B3000580 Calculate Component Quantity
B3001470 Calculate Factor And Rate
B3001640 Costing Process Where Used
B3001670 Costing, Calculate Parent Cost Percent
B3003780 Cache Process Cost Parent And Child
B9800100 Get Audit Information

Related Tables

F3002 Bill of Material Master File
F30026 Item Cost Component Add-Ons
F300261 Item Cost Component Detail