Business Function Specification
General Logic - Flow
Source NameB7602030DesignerMiriam Kato
Data Structure D7602030ProgrammerMiriam Kato
Function Name Update Average CostSystem Code76
Function CategoryUpdate
Function UseUPD
Revisions Log
DateProgrammerSAR NumberDescription
06/17/98Miriam Kato1844117Created
1.Functional Description
1.1Purpose
This Business Function updates the Cost Ledger, Average Cost for the a given amount passed as parameter.
1.2Setup Notes and Prerequisites
1.3Special Logic
2 Technical Specifications
2.1 Parameters:
Data Item Data Structure DescriptionI/ORequiredNotes
IVI cInventoryInterfaceIYFrom F40205, used to define if calculate Costs or not
ITMmnShortItem IYFrom F43121 or other file, key field
LOCNszLocation IYFrom F43121 or other file, key field
LOTNszLotNumber IYFrom F43121 or other file, key field
MCUszBusinessUnitIYFrom F43121 or other file, key field
AAszInventoryAmountIYAmount for costing
UOMszUnitOfMeasureIYFrom F43121 or other file, for UOM Conversion
UOM3szUnitOfMeasurePOIYFrom F43121 or other file, for UOM Conversion
UOPNmnUnitsOpenQuantityIYFrom F43121 or other file, for Average Costing
URECmnUnitsReceivedIYFrom F43121 or other file, for Average Costing
PIDszProgramID IYCalling Program Name, to check in 40/AV
LOTPmnLotPotency IYFrom F43121 or other file; used for UOM Conversion
ARECmnAmountReceivedIYFrom F43121 or other file, for Last-In Cost
ECSTmnExtendedCostsIYFrom F43121 or other file, for Last-In Cost
CRYRcCurrencyConverYNARIYFrom initialization
CNVcCurrencyConversionFlagIYFrom initialization
CRCDszCurrencyCodeIYFrom report initialization, for X4181 (Update Average Cost) and X4078 (Update Base Price for
Margin)
EV01cReturnStatus Oif 1, error; otherwise, no error
2.2Related Tables
Table Table Description
2.3Related Business Functions
Source NameFunction Name
X4101 F4101 Get Item Master Row
XF4105 F4105 Get Item Cost / Update Item Cost
B4100210Get Item Branch Row
B4000520F41002 Get Item UOM Conversion
X4181 Calculate Average Cost
X4078 Update Base Price for Margin
2.4Processing
Main
// Bypass updates if additional costs are zero or if not full inventory interface
If LFIVI <> Y
//Get Average Cost Flag in 40/AV, key = PID
//Get Item Master Row X4101
Call "F4101 Get Item Master Row" to read Inventory Cost Level CLEV (for X4105) and Price Level PLEV (for Price Recalculation if Margin Maintenance) ,
LITM and AITM (for Update Cost XF4105)
//Retrieve Inventory Costing Method
Call "Get Item Cost" (XF4105) to read Cost Method LEDG (for Price Recalculation if Margin Maintenance and Update Item Cost) and get the Item Cost
Row (for Update Item Cost)
// Retrieve Item Branch Information
Call "Get Item Branch Row" (B4100210) to read Potency Control OT1Y , Standard Potency STDP (for Perform Unit of Measure Conversion) and Margin
Maintenance MMPC (for Price Recalculation if MM)
//Perform Unit of Measure Conversion
If (Quantity Open not equal zero)
Primary Unit Cost) and Conversion Transaction to Primary for Quantity Open (UOPN)
//Calculate Additional Unit Cost
Unit Cost = Inventory Amount / Qty Received (PRUREC)
If (Conversion PO to Primary not zero)
//Calculate Extended Cost
If (Average Cost Flag equal to 1)
// Write Average Cost Transaction
If ((Margin Maintenance IBMMPC not equal zero) and (Price Level IMPLEV equal Cost Level IMCLEV) and (Cost Method is equal to 02))
Call "Update Average Cost" (XF4181) to update Costs
//Perform Unit of Measure Conversion
If (Quantity Received not equal zero)
Unit Cost) and Conversion Transaction to Primary for Quantity Received (UREC) using Lot Potency from F43121
//Calculate new Last-In Cost (Add additional cost to amount received and taxes)
Amount Unit Cost (CSTL) = (PRAREC + PRECST)/Qty Received in Primary Uom + Unit Cost
//If margin maintenance, recalculate unit price; perform change if Cost Level = Price Level and the Cost Method is type 1 or 6
If ( (Margin Maintenance IBMMPC not equal zero) and (Price Level IMPLEV equal to Cost Level IMCLEV) )
//Update Lot Cost (Cost Level = 06)
If Cost Method == 06
Call Get Item Cost depending on Cost Level IMCLEV
Update field UNCS = Amount Unit Cost (CSTL)
Call Update Item Cost depending on Cost Level IMCLEV
//Update Last In Cost (Cost Level = 01)
Cost Level = 01
Call Get Item Cost depending on Cost Level IMCLEV
Update field UNCS = Amount Unit Cost (CSTL)
Call Update Item Cost depending on Cost Level IMCLEV
================================================================================
Reminder:
H40/CL
Cost LevelItem Only (1)
Item/Branch/Location/Lot (3)
40/CM
Cost MethodLast In (01)
Lot (06)
Weighted Average (02)
^
D7602030 - Update Average Cost - Brazil - 43A
D7602030 - Update Average Cost - Brazil
Data Item Structure DescriptionI/ORequiredNotes
IVIcInventoryInterfaceIYFrom F40205, used to define if calculate Costs or not
ITMmnShortItem IYFrom F43121 or other file, key field
LOCNszLocation IYFrom F43121 or other file, key field
LOTNszLotNumber IYFrom F43121 or other file, key field
MCUszBusinessUnitIYFrom F43121 or other file, key field
AAszInventoryAmountIYAmount for costing
UOM3szUnitOfMeasurePOIYFrom F43121 or other file, for UOM Conversion
UOPNmnUnitsOpenQuantityIYFrom F43121 or other file, for Average Costing
URECmnUnitsReceivedIYFrom F43121 or other file, for Average Costing
PIDszProgramID IYCalling Program Name, to check in 40/AV
LOTPmnLotPotency IYFrom F43121 or other file; used for UOM Conversion
ARECmnAmountReceivedIYFrom F43121 or other file, for Last-In Cost
ECSTmnExtendedCostsIYFrom F43121 or other file, for Last-In Cost
CRYRcCurrencyConverYNARIYFrom initialization
CNVcCurrencyConversionFlagIYFrom initialization
CRCDszCurrencyCodeIYFrom report initialization, for X4181 (Update Average Cost) and X4078 (Update Base Price for
Margin)
EV01cReturnStatus Oif 1, error; otherwise, no error
UOM1szUnitOfMeasurePrimaryIYFrom F43121 or other file, for UOM Conversion
^
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
cInventoryInterface | IVI | char | OPT | INPUT |
A code that identifies the type of interface to the Inventory Management system. Valid values are:
Y The dollar or unit value of any activity
| ||||
mnIdentifierShortItem | ITM | MATH_NUMERIC | OPT | INPUT |
An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item
| ||||
szLocation | LOCN | char | OPT | INPUT |
The storage location from which goods will be moved. | ||||
szLot | LOTN | char | OPT | INPUT |
A number that identifies a lot or a serial number. A lot is a group of items with similar characteristics. | ||||
szCostCenter | MCU | char | OPT | INPUT |
An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit
| ||||
mnAmountField | AA | MATH_NUMERIC | OPT | INPUT |
A number that identifies the amount that the system will add to the account balance of the associated account number. Enter credits with a
| ||||
szUnitOfMeasurePurchas | UOM3 | char | OPT | INPUT |
A code (table 00/UM) that identifies the unit of measure in which you usually purchase the item. | ||||
mnUnitsOpenQuantity | UOPN | MATH_NUMERIC | OPT | INPUT |
The original quantity for the order detail line, plus or minus any changes to that quantity, minus all quantities shipped, received, and
| ||||
mnUnitsLineItemQtyRe | UREC | MATH_NUMERIC | OPT | INPUT |
The original quantity of the order line, plus or minus any changes to that quantity, less all quantities shipped, received and/or vouchered to
| ||||
szProgramId | PID | char | OPT | INPUT |
The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry
| ||||
mnLotPotency | LOTP | MATH_NUMERIC | OPT | INPUT |
A code that indicates the potency of the lot expressed as a percentage of active or useful material (for example, the percentage of alcohol
| ||||
mnAmountReceived | AREC | MATH_NUMERIC | OPT | INPUT |
The value of the goods received to date against the original order line. | ||||
mnAmountExtendedCost | ECST | MATH_NUMERIC | OPT | INPUT |
For accounts receivable and accounts payable, the invoice (gross) amount. For sales orders and purchase orders, the unit cost times the
| ||||
cCurrencyConverYNAR | CRYR | char | OPT | INPUT |
A code that specifies whether to use multi-currency accounting, and the method of multi-currency accounting to use:
Codes are:
N Do not
| ||||
cCurrencyConversionFlag | EV01 | char | OPT | INPUT |
An option that specifies the type of processing for an event. | ||||
cReturnStatus | EV02 | char | REQ | OUTPUT |
An option that specifies the type of processing for an event. | ||||
szUnitOfMeasurePrimary | UOM1 | char | OPT | INPUT |
A user defined code (00/UM) that identifies the unit of measure that the system uses to express the quantity of an item, for example, EA
|
None |
None |