UpdWOStdCostVarianceforCfgdParts

Update WO Standard Cost Variance for Configured Parts

Major Business Rule

Object Name: B3100840

Parent DLL: CMFGBASE

Location: Client/Server

Language: C

1.Functional Description

1.1Purpose
This business function will create/update the Standard Cost Variances in the WO Variance table 
(F3102) for configured parts for a given Work Order.


1.2Setup Notes and Prerequisites

• None.

1.3Special Logic

• None.

2.Technical Specifications

2.4Processing 
The following actions will be performed by the Business Function.

If the Standard Cost Calculation Method (input) is equal to '2'


Load DOCO, ITM, into the keys for reading the Work Order Variance table (F3102).
Do until there are no more records,

Read a row from the F3102 table using the above keys and with COST>'B1 '
If the row is found,

COST=substring of IGCOST (first character only)
/*  'D' added as a valid Cost Type.  4/14/97.  */

If COST='B' or 'C' or 'D'

Set on a (variance records exist) flag
EndIf
EndIf
EndDo
EndIf

If the record exists flag is not on:


Initialize the following work fields to zero:  CTSvohm, CTSvohl, CTSfohm, CTSfohl, CTS1, CTS2, 

CTS3, CTS4, CTS5, CTS6, VOHM, FOHM, VOHL, FOHL, EFFH, WCEF, AMT, HRS.


Load DOCO into the key for reading the SFC Routing Instructions table (F3112).

Do until there are no more records,

If a row is found and WLOPSC='  ',
/*  New processing for outside operations (4/14/97):  */
If WLVEND <> 0,

Retrieve the primary item number based upon the input Short Item, Long Item, Third 
Item and Branch/Plant, using F4101 Get Primary Item Number(X4101).

If the Short Item Number is primary, remove the leading blanks.

Truncate the Primary Item Number to a length of twenty.

Concatenate the string, "*OP" to the Item Number.

Convert the Operations Sequence Number (WLOPSQ) to a left-justified string and 

concatenate the result to the Item Number.

Use Get Item Master Description UoM (B4001040) to validate the outside operation Item 

Number (wf-LITM) and return the Cost Level (IMCLEV).

Call F4105 Get Item Cost (XF4105) to retrieve the Unit Cost (COUNCS).

Load the audit information.

Read the variance file (F3102) by DOCO, ITM, and Cost ('D1').

If a record is found,

Update the row
Else,
IGPART = 'P'
IGDOCO = ds-DOCO

IGITM = ds-ITM

IGLITM = ds-LITM

IGAITM = ds-AITM

IGCOST = 'D1'

Write a new F3102 row

End If
End If
/*  End new processing for outside operations.  */


If WLMCU<>IWMCU,

Read a row in the Work Center Master table (F30006) by WLMCU
IWLEDG='07'

Read a row in the Work Center Rates table (F30008) by IWMCU and IWLEDG

Calculate efficiency variance: WORE = WLWORE / 100. 

EndIf
EndIf

If a record is found in the Work Center Rates table (F30008),

Accumulate hours into CTS1 through CTS3
CTS1=CTS1+WLRUNL
CTS2=CTS2+WLSETL
CTS3=CTS3+WLRUNM

Calculate run costs for Setup, Labor & Machine
ARUNL= IWSTLF * WLRUNL
ASETL = IWSTFF * WLSETL

ARUNM = IWMSFR * WLRUNM
Accumulate run costs into CTS4 through CTS6

CTS4 = CTS4+ARUNL
CTS5 = CTS5+ASETL

CTS6 = CTS6+ARUNM


Calculate B4, Labor Efficiency Cost
If MWCE (input) = 'Y' and WORE<>0,
(Efficiency Hours) EFFH=WLRUNL-(WLRUNL * WORE)
(B4 Efficiency Cost) WCEF=IWSTLF * EFFH

WCEF is rounded to the 4th decimal position

Accumulate WCEF into CTSwcef

EndIf

Calculate C1, Machine Variable Overhead
If IVMO (input) = 'Y'
When overhead is expressed in percentage of machine cost:
VOHM = IWMSTF * ARUNM / 100
When overhead is expressed as an hourly rate:
VOHM=IWMSTF * WLRUNM

VOHM is rounded to the 4th decimal position
Accumulate VOHM into CTSvohm

EndIf

Calculate C2, Machine Fixed Overhead
If IFMO (input) = 'Y'
When overhead is expressed in percentage of machine cost:
VOHM = IWMSSF * ARUNM / 100
When overhead is expressed as an hourly rate:
VOHM=IWMSSF * WLRUNM
FOHM=FOHM rounded to the fourth decimal position
Accumulate FOEM into CTSfohm

EndIf
Calculate C3, Variable Labor Overhead

If IVO (input) = 'Y'

WKHR=0
WKAT=0

Run Labor is used in overhead calculation

If CVDL (input) = 'Y'

WKHR = WKHR + WLRUNL (Hours)
WKAT = WKAT + ARUNL (Cost)

EndIf
Setup Labor is used in overhead calculation

If CVSL (input) = 'Y'

WKHR = WKHR + WLSETL (Hours)
WKAT = WKAT + ASETL (Cost)

EndIf
Efficiency is included in overhead calculation

If CVDS (input) = 'Y'

WKHR = WKHR + EFFH (Add efficiency hours from the B4 calculation)
WKAT = WKAT + WCEF (Add efficiency cost from the B4 calculation)

EndIf
When overhead is expressed as percentages of labor cost

VOHL = WKAT * IWSTRF / 100
When overhead is expressed as rates per labor hour 
VOHL = WKHR * IWSTRF
VOHL is  rounded to the fourth decimal position
VOHL is accumulated into CTSvohl

EndIf
Calculate C4, Fixed Labor Overhead

If FVO (input) = 'Y'

WKHR=0
WKAT=0

Run Labor is used in overhead calculation

If CFDL (input) = 'Y'

WKHR = WKHR + WLRUNL (Hours)
WKAT = WKAT + ARUNL (Cost)

EndIf
Setup Labor is used in overhead calculation

If CFSL (input) = 'Y'

WKHR = WKHR + WLSETL (Hours)
WKAT = WKAT + ASETL (Cost)

EndIf
Efficiency is included in overhead calculation

If CVDS (input) = 'Y'

WKHR = WKHR + EFFH (Add efficiency hours from the B4 calculation)
WKAT = WKAT + WCEF (Add efficiency cost from the B4 calculation)

EndIf
When overhead is expressed as percentages of labor cost

FOHL = WKAT * IWSTRZ / 100
When overhead is expressed as rates per labor hour 
FOHL = WKHR * IWSTRZ
FOHL is  rounded to the fourth decimal position
FOHL is accumulated into CTSfohl

EndIf
EndIf(F30008)
EndDo(F3112)
Build a string array for the following cost types:  'B1 ', 'B2 , 'B3 ', 'B4 ', 'C1 ', 'C2 ', 

'C3 ', 'C4 '

For each cost type, perform the following:
IECOST = aryszCOST[current cost type]

Read a variance row (F3102) by DOCO, ITM, and aryszCOST
IGOPUN=UORG (input)

If IECOST = 'B1 '

IGOPAT=CTS4
EndIf
If IECOST = 'B2 '

IGOPAT=CTS5
EndIf
If IECOST = 'B3 '

IGOPAT=CTS6
EndIf
If IECOST = 'B4 '

IGOPAT=CTSwcef
EndIf
If IECOST = 'C1 '

IGOPAT=CTSvohm
EndIf
If IECOST = 'C2 '

IGOPAT=CTSfohm
EndIf
If IECOST = 'C3 '

IGOPAT=CTSvohl
EndIf
If IECOST = 'C4 '

IGOPAT=CTSfohl
EndIf

/*  NOTE: The following logic was added 10/13/96 for Configurator */

Add IGOPAT to Total Standard Cost field (OPAT); this accumulated value will be passed 
back to the calling program.    

/* End 10/13/96 changes */


IGUOM=UOM (input)
Load audit information with PID = "ER31410"

If a row (F3102) was found

Update the row
Else
IGPART='P'
IGDOCO=Input DOCO

IGITM=Input ITM

IGLITM=Input LITM

IGAITM=Input AITM

IGCOST=IECOST

Write a new row if IGOPAT is not zero

EndIf
EndDo(Cost Types)

Load ITM, MMCU, LOCN (=blanks), LOTN (=blanks), LEDG (='07').
Do until there are no more records:
Read a record from the Cost Component table (F30026) using the above keys with 
COST>'C4 '

If row found,

IGOPAT=TRQT (input)xIESTDC
IGOPUN=TRQT/WO Conversion factor (input)

IGUOM=UOM (input)


/*  NOTE: The following logic was added 10/13/96 for Configurator */

Add IGOPAT to Total Standard Cost field (OPAT); this accumulated value will be passed 
back to the calling program.    

/* End 10/13/96 changes */


Load audit information

Read the variance file (F3102) using DOCO, ITM, and COST (=IECOST) as keys

If a record is found

Update the row
Else
IGPART='P'
IGDOCO=Input DOCO

IGITM=Input ITM

IGLITM=Input LITM

IGAITM=Input AITM

IGCOST=IECOST

Write a new row

EndIf
EndIf
EndDo
EndIf(Variance Record Exists Flag is On)

If any errors occur,  the function will return '1' in the Error Code field, and '0' if there are no 

errors.


^

Data Structure

D3100840 - Update WO Standard Cost Variance for Configured Parts

Parameter NameData ItemData TypeReq/OptI/O/Both
mnOrderNumberDOCOMATH_NUMERICNONENONE

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

mnShortItemNumberITMMATH_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

szSecondItemNumberLITMcharNONENONE

A number that identifies the item. The system provides three separate item numbers plus an extensive cross-reference capability to 
alternative item numbers. The three types of item numbers are: Item Number (short) An 8-digit, computer-assigned item number. 2nd Item Number A 
25-digit, user defined, alphanumeric item number. 3rd Item Number  Another 25-digit, user defined, alphanumeric item number. In addition to 
these three basic item numbers, the system provides an extensive cross-reference search capability. You can define numerous 
cross-references to alternative part numbers. For example, you can define substitute item numbers, replacements, bar codes, customer numbers, or 
supplier numbers.

szThirdItemNumberAITMcharNONENONE

The system provides three separate item numbers plus an extensive cross-reference capability to alternate item numbers. These item 
numbers are as follows: 1.  Item Number (short) - An 8-digit, computer-assigned 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.  In addition to 
these three basic item numbers, an extensive cross-reference search capability has been provided (see XRT). Numerous cross references to 
alternate part numbers can be user defined, such as substitute item numbers, replacements, bar codes, customer numbers, or supplier 
numbers.

szBranchMMCUcharNONENONE

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.

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

mnPrimaryOrderQtyTRQTMATH_NUMERICNONENONE

A value that represents the available quantity, which might consist of the on-hand balance minus commitments, reservations, and 
backorders. You enter this value in the Branch/Plant Constants program (P41001).

mnOrderQuantityUORGMATH_NUMERICNONENONE

The quantity of units affected by this transaction.

cStandardCalculationMethodEV02charNONENONE

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

cModifyCostbyWorkCenterEffMWCEcharNONENONE

An option that determines whether the cost rollup creates cost component B4  (for labor efficiency) based on the direct labor value (cost 
component B1) and the Work Center Efficiency percent from the Work Center Master table (F30006). For World: Valid values are:    Y Yes. Create 
cost component B4.    N No. Do not create cost component B4. For OneWorld: To create cost component B4, click the Modify cost by Work 
Center Efficiency option under the Costing Options heading.

cIncVarMachOverheadInCostIVMOcharNONENONE

An option that determines whether the cost rollup creates cost component C1  (for variable machine overhead) in the Cost Components 
table (F30026). For World: Valid values are:    Y Yes. Create cost component C1.    N No. Do not create cost component C1. For OneWorld: To 
create cost component C1, click the Include Var. Machine Overhead in Cost option under the Costing Options heading.

cOverheadAsPerOrRatesPORRcharNONENONE

An option that determines whether values for overhead fields (cost components C1 through C4) in the Work Center Rates table (F30008) are 
expressed as percents or rates. For World: Valid values are:    R Express overhead values as rates (currency values).    P Express overhead 
values as percents. For OneWorld: To specify whether the system expresses the overhead fields as percents or rates, click either Percents 
or Rates under the Overheads heading.

cIncFixMachOverheadInCostIFMOcharNONENONE

An option that determines whether the cost rollup creates cost component C2  (for fixed machine overhead) in the Item Cost Component 
Add-Ons table (F30026). For World: Valid values are:    Y Yes. Create cost component C2.    N No. Do not create cost component C2. For 
OneWorld: To create cost component C2, click the Include Fixed Machine Overhead in Cost option under the Costing Options heading.

cIncVarLaborIVOcharNONENONE

An option that determines whether the cost rollup creates cost component C3  (for variable labor overhead) in the Item Cost Component 
Add-Ons table (F30026). For World: Valid values are:    Y Yes. Create cost component C3.    N No. Do not create cost component C3. For 
OneWorld: To create cost component C3, click the Include Variable Labor Overhead in cost option under the Costing Options heading.

cCalcVarOnDirectLaborCVDLcharNONENONE

An option that determines whether the cost rollup includes direct labor expenses (cost component B1) in the total used to calculate variable 
labor overhead (cost component C3). For World: Valid values are:    Y Yes. Include direct labor expenses.    N No. Do not include direct labor 
expenses. For OneWorld: To include direct labor expenses, click the Calculate Var. on Direct Labor option under the Costing Options 
heading.

cCalcVarOnSetupLaborCVSLcharNONENONE

An option that determines whether the cost rollup includes setup labor expenses (cost component B2) in the total used to calculate variable 
setup overhead (cost component C3). For World: Valid values are:    Y Yes. Include setup labor expenses.    N No. Do not include setup labor 
expenses. For OneWorld: To include setup labor expenses, click the Calculate Var. on Setup Labor option under the Costing Options 
heading.

cIncWorkCenterEffCVDScharNONENONE

An option that determines whether the cost rollup includes work center efficiency when calculating overhead values, if you specified that 
you want to modify costs by work center efficiency. For World: Valid values are:    Y Yes. Include work center efficiency.    N No. Do not include 
work center efficiency. For OneWorld: To include work center efficiency, click the Include Work Center Eff. in Overhead option under the Costing 
Options heading.

cIncFixedLaborOverInCostIFOcharNONENONE

An option that determines whether the cost rollup creates cost component C4  (for fixed labor overhead) in the Item Cost Component 
Add-Ons table (F30026). For World: Valid values are:    Y Yes. Create cost component C4.    N No. Do not create cost component C4. For 
OneWorld: To create cost component C4, click the Include Fixed Labor Overhead in cost option under the Costing Options heading.

cCalcFixOrDirectLaborCFDLcharNONENONE

An option that determines whether the cost rollup includes direct labor expenses (cost component B1) in the total used to calculate fixed 
labor overhead (cost component C4). For World: Valid values are:    Y Yes. Include direct labor expenses.    N No. Do not include direct labor 
expenses. For OneWorld: To include direct labor expenses, click the Calculate Fixed on Direct Labor option under the Costing Options heading.

cCalcFixOnSetupCFSLcharNONENONE

An option that determines whether the cost rollup includes setup labor expenses (cost component B2) in the total used to calculate fixed 
setup overhead (cost component C4). For World: Valid values are:    Y Yes. Include setup labor expenses.    N No. Do not include setup labor 
expenses. For OneWorld: To include setup labor expenses, click the Calculate Fixed on Setup Labor option under the Costing Options heading.

cErrorCodeERRCcharNONENONE

This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document 
Set Server program (XT4914).

mnConversionFactorMN29D9MATH_NUMERICNONENONE

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

mnStandardamountOPATMATH_NUMERICNONENONE

The standard amount to produce a given amount of product.

Related Functions

B9800100 Get Audit Information

Related Tables

F30006 Work Center Master File
F30008 Work Center Rates File
F30026 Item Cost Component Add-Ons
F3102 Production Cost
F3112 Work Order Routing