UpdateCurrentLevelCosts

Update Current Level Costs

Major Business Rule

Object Name: B3001460

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

1.Functional Description
This function will calculate the current level costs for the items selected in the cost rollup 

program (P30820). Current level costs are the costs for the item alone.  At this point no cost rollup of 

component items is done.  The single level costs calculated will be updated in the cost component file 

F30026.


1.1Purpose

The purpose of this business function is to calculate the manufactured or net added cost for the item 

to process.  The cost rollup or total cost for item is also effected by the cost calculated.  The 

cost calculated will be moved to the cost rollup cost for purchased items, but for manufactured items, 

the cost will be added to the cost rollup cost.


1.2Setup Notes and Prerequisites

This business function will be called for each item in the F30UI007, and for each branch in the 

branch/plant array. No pre-requisites exist for this business function, although this business function 

acts as a prerequisite to B3000670.C (update where used) and B3000680.C (update total cost information)


1.3Special Logic

This business function will build the following link list:

Current Level Costs Link List

COSTcost type (i.e. A1,B1)

XSCRCost Amount

XSMCManufactured Cost   

XSCRRolled Costs 


2.Technical Specifications


2.4Processing 


A.  Business function Setup:

Destroy Current Level Link List - if it exists.


Work Fields 

WK Factor 29.9

WK Rate 29.9

WK Manufacturing Costs29.9

WK Amount Simulated Cost 15.0

WK Cost Rollup15.0

WK Time Of Day

WK Update Date

WK Job Number

WK User Id

WK Program Id

WK Delete FlagEV01

WK Customer Item ShortITM


0.0  BF Get Audit Info 


1.0.  Fetch a record from the Item Cost Component Table (F30026) where MMCU=DS Branch, ITM=DS Item 
Number, LOCN = blanks, LOTN = blanks, and LEDG = DS Cost Method until fetch fails.



1.1.  Locate link list node where COST = F30026 COST.

(Amount - Simulated Manufacturing Costs (XSMC))
1.2.  If Multi-level Costing (DS Single Level != '1') or Item selected was selected for costing 
(DS Item Component Flag is != '#"), calculate Amount - Simulated Manufacturing Cost (XSMC).


1.2.1.  If F30026 Cost Type (COST) is equal to 'A1', DS Purchased Item Cost is not equal to 
blanks, and DS Purchased Item is equal to 'P', Calculate costs for 'A1' purchased items.  


1.2.1.1.  Get F30026 Amount - Simulated Manufacturing Cost from Cost Ledger File (F4105).

a.  If DS Item Cost Level is equal to '3', retrieve the primary location from the 
Item Location Table (F41021).


Fetch from F41021 where ITM = DS Item Number, MMCU = DS Branch, PBIN = 'P'.  
Return LOCN and LOTN.


b.  Retrieve Unit Cost from the Cost Ledger Table (F4105).

If DS Item Cost Level is equal to '1', fetch from F4105 where ITM = DS Item 
Number, LEDG = DS Cost Method.  Return unit Cost (UNCS).


If DS Item Cost Level (CLEV) is equal to '2', fetch from F4105 where ITM = DS Item 
Number, LEDG = DS Cost Method, MCU = DS Branch.  Return unit cost (UNCS).


If DS Item Cost Level (CLEV) is equal to '3', fetch from F4105 where ITM = DS Item 
Number, LEDG = DS Cost Method, MCU = DS Branch, LOCN = F41021 LOCN, LOTN = F41021 

LOTN.


c.  F30026 Amount Simulated Manufacturing Cost (XSMC) = F4105 Unit Cost. 

1.2.2.  If F30026 Cost Type (COST) is equal to 'A1' and DS ManufacturedPurch is equal to 'M', 
zero simulated cost for 'A1' manufactured items.


F30026 Amount Simulated Manufacturing Cost = 0

SAR 1138036

1.No add on's (factor and rates) are allowed for Cost types Ax - Dx
If first character of cost type is an 'A' or 'B' or 'C' or 'D' 
move blanks to factor code
move blanks to rate code

zero out factor

zero out rate

SAR 1321324
1.Must check to see if factor or rate exists in addition to just checking the factor code 
and rate code.


1.2.3.  If F30026 Factor Code (XSFC) is not equal to blanks or F30026 Rate Code (XSRC) is not 
equal blanks, recalculate Factor/Rate Code costs.  Check Factor != zeros, and Check Rate != 

Zeros.



1.2.3.1.  Call BF CalculateFactorandRate (B3001470)
F30026 XSFC>DS Factor Code Sim

F30026 XSF>DS Factor Sim

F30026 XSRC>DS Rate Code Sim

F30026 XSR>DS Rate Sim

CurrentLevelCostLL>DS Current Level Costs LL

'0'>DS Suppress Error Messages

XDS Error Message ID

WK Factor<DS Factor

WK Rate<DS Rate


Initialize WK Manufacturing Costs to Zero. 

1.2.3.2.  Determine Manufacturing Costs (WK Manufacturing Costs).
If WK Factor is equal to 0 and WK Rate is NOT equal to 0, 
WK Manufacturing Costs = WK Rate.


If WK Rate is equal to 0 and WK Factor is NOT equal to 0,

WK Manufacturing Costs = WK Factor.


If WK Factor is not equal to 0 and WK Rate is not equal to 0, WK Manufacturing Costs 

= WK Rate * WK Factor.


1.2.3.3.  F30026 Factor (XSF)   = WK Factor
F30026 Rate (XSR)     = WK Rate
SAR 1321324 Only apply the F3404 % if the cost is not a based on cost because then, the  % 
would have already been applied.

SAR 1147653 Chameleon Characters (change '#' to '&')

1.2.3.4.     If Process CoBy Products, decrease Material cost for cost% in the F3404.
If DS Process CoByProducts = '1', DS ProcessItem not equal 'R', WK Manufacturing 
Cost not equal 0, and DS Parent Cost Percent is not equal to 1.0,

and first character of factor code != '&'

and first character of factor code != '*'

and first character of rate code != '&' 

and first character of rate code != '*'

WK Manufacturing Costs = WK Manufacturing Costs * DS Parent Cost Percent
else if parent cost percent = zero
WK Manufacturing Costs = WK Manufacturing Costs * DS Parent Cost Percent
end

If DS Parent Cost Percent != 1.00

and Rate != zero

and Factor != zero

and first character of factor code != '&'
and first character of factor code != '*'

and first character of rate code != '&' 

and first character of rate code != '*'

Add F30026 XSMC + WK Manufacturing Costs
else
F30026 Amount Simulated Manufacturing Cost(XSMC) = WK Manufacturing 
Costs

end

1.2.4.  WK Manufacturing Costs = F30026 Amount Simulated Manufacturing cost.
WK Cost Rollup = WK Manufacturing Costs

(Amount - Simulated Cost Rollup (XSCR)
1.3. Calculate Amount Simulated Cost Rollup (XSCR).


1.3.1.  If Single Level Costing (DS SingleLevel = '1') and the Item was not selected  (DS 

ItemComponentFlag = '#'), 

WK Amount Simulated Cost  = F30026 Amount Simulated Cost Rollup.

1.3.2.  If Multi-level Costing (DS Single Level != '1') or Item was selected  (DS Item 
Component Flag is != '#"), 


1.3.2.1.  If DS ManufacturedPurch = 'P', 
F30026 Amount Simulated Cost Rollup = WK Cost Rollup.
WK Amount Simulated Cost Rollup = F30026 Amount Simulated Cost Rollup (XSCR)


1.3.2.2.  If DS ManufacturedPurch != 'P',
F30026 Amount Simulated Cost Rollup = F30026 Amount Simulated Cost Rollup + WK Cost 
Rollup. 

WK Amount Simulated Cost Rollup = LL Cost Amount + F30026 Amount Simulated Cost 

Rollup (XSCR).



1.4.  Save Cost Type (COST), Amount Simulated Cost Rollup (XSCR), Manufacturing Cost, and Rolled 
Cost into link list by cost type.


Cost Type = F30026 Cost Type (COST

Cost Amount= WK Amount Simulated Cost Rollup

Manufactured Costs= WK Manufacturing Costs

Rollup Costs= F30026 Amount Simulated Cost Rollup (XSCR)


1.5. Update or Delete Cost Component record.
Initialize WK Delete Flag = ' ' 


SAR 1343671 add last four tests to this if statement because entire record must be blanks for 

deletion. 

1.5.1. If F30026 Amount Frozen Cost (STDC) = 0, F30026 Amount Frozen Cost Rollup (CSL), 
F30026 Amount Simulated Mfg. Cost (XSMC) = 0, and F30026 Amount Simulated Cost Rollup (XSCR) = 0, 

and factor code = blank, and rate code = blank, and rate = zero, and factor = zero. delete the 

F30026 record.

1.5.1.1. Set WK Delete Flag = '1'
1.5.2.  Else...
Assign values to UPMJ, USER, PID, JOBN, TDAY and update F30026.

SAR 2383685 add the test to see if the costs between the simulated & frozen are 

different. 

If (Compare F30026 Amount - Simulated Mfg. Cost to F30026 Amount - Frozen Cost not = 0 or 

(compare F30026 Amount - Simulated Cost Rollup to F30026 Amount - Frozen Cost Rollup not 

= 0), set cCostChangedFlag = 2.



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


1.6. Update Cost Component Records for CoByProducts
1.6.1. If DS CoByProductFound = '1'
1.6.1.1.If WK Delete Flag ='1' or
the first character of F30026 COST cost type NE 'A' and NE 'B'and NE 'C'


1.6.1.1a. Check to see if the cost type being processed is an outside operation.
Call B.F. Check for Outside Operation (B3000770):
DS Branch>DS Branch

DS CurrentProcessItem >DS Item Number

 'M'>DS Routing Type

DS Process Batch Qty >DS Batch Quantity

 '1'>Select Batch Quantity

DS As of Date>DS As Of Date

F30026 CostType(COST)>DS Cost

 '0'>DS Return Pointer

WK OutsideOperationExists<DS OutsideOperationExists



1.6.1.1b. If WK OutsideOperationExists != '1'
Call B.F. Costing, Process Current Level (B3001630)
WK ManufacturedCost > DS Manufactured Costs

DS CostMethod> DS Cost Method

DS ProcessBatchQuantity> DS ProcessBatchQuantity

DS ProcessConvFactor > DS ProcessConv.Factor

WK Delete Flag> DS Delete Flag

F30026 Cost Type(COST)> DS Cost Type

DS Job Number> DS Job Number


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

For B733.3, we changed:

• Replace lpDS->cProcessItem variable with lpDS->cPurchasedItem
• Validate lpDS->cPurchaseItem with values:
'P' - Purchased Item
'0'1a'1a

Data Structure

D3001460 - Update Current Level Costs

Data Item  Description           I/O  Required  Notes
ITM       Item Number Short     I    Y      used for F30026 key

MCU       Branch                 I    Y      "    "

LEDG       Cost Method           I          Y      "    ", from processing options

ASDE1       As of Date                 I     Y      From Processing Options

VC01A        Single Level Costing        I    Y      '1' = not explode BOM from P.O. any other 

                                                                                                      

                  value = exlpode BOM.

ORDW       Item Component flag         I    Y      from F4101 for item to process

CLEV       Item Cost Level           I    Y      From F4101 for item to process

EV01       PurchasedItem           I    Y      STKT from F4102, UDC 2nd Desc. 

LEDG       Purchased Item Cost Method  I    Y      from processing options

GENLNG CostRollupLinkedList     I/O        Y

ITM       CurrentProcessItem     I    O      From F3003, (for Xref item #)  Value      

                                                                                                      

             retrieved in P30820 ER.

EV01       Process CoByProducts     I          O  From Processing Options P30820

EV01       CoByProductFound           I     O      Indicates if CoBy Products exist for the  

                                                                                                      

                  Process.  Set in BF B3001610

SPHD       ProcessItem           I    O 'R' = Process

MN29D9 ParentCostPercent     I          O      F3404% - retrieved in BF ???, in P30820   

                                                          ER

BQTY       Process Batch Quantity     I     O      Determined from Rtg. for Process Costing 

in                                                             P30820 ER

CBUP       Process Conv. Factor     I    O      Saved Process values from setup. Value    

                                                         retrieved in BF3001610

JOBS       Job Number                 I          Y  Required for Cache Processing

UM           Unit  of  Measure     I          Y      Require for convert UOM to Primary

EV01       CostChangedFlag           O          N      Return from BF if there is changes 

between Simulated Cost Rollup and Frozen cost.Rollup or between Amount - Simulated Mfg. Cost to Amount - 

Frozen Cost


^

Parameter NameData ItemData TypeReq/OptI/O/Both
mnItemNumberShortITMMATH_NUMERICNONENONE

An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
numbers (see data item XRT) to accommodate substitute item numbers, replacements, bar codes, customer numbers, supplier numbers, and 
so forth. The item numbers are as follows:   o Item Number (short) - An eight-digit, computer-assigned item number     o 2nd Item Number - The 
25-digit, free-form, user defined alphanumeric item number     o 3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item 
number

szBranchMCUcharNONENONE

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.

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.

cSingleLevelCostingVC01AcharNONENONE

This is a generic field used for video constants display.

cItemComponentFlagORDWcharNONENONE

Future use. The Order With code determines if work order generation (P31410) will explode this items bill of material to create orders for this 
items components.

cItemCostLevelCLEVcharNONENONE

A code that indicates whether the system maintains one overall inventory cost for the item, a different cost for each branch/plant, or a 
different cost for each location and lot within a branch/plant. The system maintains inventory costs in the Inventory Cost table (F4105). Valid codes 
are:    1   Item level    2   Item/Branch level    3   Item/Branch/Location level

cPurchasedItemEV01charNONENONE

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

szPurchasedItemCostMethodLEDGcharNONENONE

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.

idCurrentLevelCostsLLGENLNGIDNONENONE

General purpose ID variable.

cProcessItemEV01charNONENONE

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

mnParentCostPercentMN29D9MATH_NUMERICNONENONE

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

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.

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.

mnCurrentProcessItemITMMATH_NUMERICNONENONE

An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
numbers (see data item XRT) to accommodate substitute item numbers, replacements, bar codes, customer numbers, supplier numbers, and 
so forth. The item numbers are as follows:   o Item Number (short) - An eight-digit, computer-assigned item number     o 2nd Item Number - The 
25-digit, free-form, user defined alphanumeric item number     o 3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item 
number

cProcessCoByProductsEV01charNONENONE

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

cCoByProductFoundEV01charNONENONE

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

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

mnProcessConvFactorCONVMATH_NUMERICNONENONE

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

mnJobNumberJOBSMATH_NUMERICNONENONE

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

szUnitOfMeasureUMcharOPTNONE

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.

cCostChangedFlagEV01charOPTNONE

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

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.

szOutsideOpCostMethodLEDGcharOPTNONE

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.

Related Functions

B3000770 Check For Outside Operation
B3001470 Calculate Factor And Rate
B3001630 Costing Process Current Level
B3003770 Cache Process Cost Item Information
B4000520 Get Item UoM Conversion Factor
B4001040 Get Item Master Description UOM
B9800100 Get Audit Information
B9800181 Environment List Business Functions
B9800420 Get Data Dictionary Definition
X0005 Get User Defined Codes

Related Tables

F30026 Item Cost Component Add-Ons
F300261 Item Cost Component Detail
F41021 Item Location File
F4105 Item Cost File