Functional Description
Purpose
This function retrieves the unit of measure conversion factors for an item. It retrieves the
conversion between the From and To units of measure and can calculate the quantity to the unit of measure
specified for the item.
Setup Notes and Prerequisites
The Branch (MCU), From UOM (UOM), To UOM (UOM) and Short Item Number (ITM) are required input
parameters. The Branch is only used if the Distribution Constants Flag (F4009) has been set to indicate
conversions are performed at the Item and Branch level.
Conversion between the FROM uom and the To uom; the From uom and the Primary uom and the TO uom and
the Primary uom are always calculated. In order to calculate other conversions (secondary, pricing,
etc.), a flag must be set on.
If the Potency Mode (GFLG) is an 'S' or 'K', standard potency is used. Otherwise, if the lot is
blank, use standard potency. If the lot is not blank, the lot potency from the lot master is used. Sales
Order Processing needs to pass SDCOMM into this field and Purchase Order Processing needs to pass an
'S'.
Technical Specification
Initialize all the quantity fields to zero. These are :
QuantityToConvert
QuantityConvertedToPrimary
QuantityConvertedToSecondary
QuantityConvertedToPurchasing
QuantityConvertedToPricing
QuantityConvertedToShipping
QuantityConvertedToWeight
QuantityConvertedToVolume
Initialize the conversion factor fields to 1.0.
These are :
ConversionFactorFrom_to_To
ConversionFactorFrom_to_Primary
ConversionFactorTo_to_Primary
If InventoryInterfaceFlag is blank then set the value to 'Y'
Call the business function GetDistributionConstants to
retrieve the system constants flags. Retrieve the value for
BUMC (Process Units of Measure by Branch) flag.
For Inventory interface flag equal to 'D', 'Y', or B.
If UnitOfMeasureToPrimary is blank and ShortItemNumber is not blank, retrieve
UnitOfMeasureToPrimary and StandardUnitsofMeasure (TFLA) from F4101 table (Item Master).
For each of the following cases DO STEP A :
Conversion 'FROM UoM' to 'TO UoM'
If UnitOfMeasureToPrimary is not blank then process conversion 'FROM UoM' to Primary UoM.
If ConversionToSecondary flag is on the process conversion 'FROM' UoM to Secondary UoM.
If ConversionToPurchasing flag is on the process conversion 'FROM' UoM to Purchasing UoM.
If ConversionToPricing flag is on the process conversion 'FROM' UoM to Pricing UoM.
If ConversionToShipping flag is on the process conversion 'FROM' UoM to Shipping UoM.
If ConversionToWeight flag is on the process conversion 'FROM' UoM to Weight UoM.
If ConversionToVolume flag is on then process conversion 'FROM' UoM to Volume UoM.
Step A.
Check stack of conversion factors for previously retrieved conversions to see if the one needed
exists.
If it exists then use the conversion factor from the stack and go to retrieve next Unit of Measure
Also check the stack for the inverse conversion factor and use it if it exists.
(Note the stack is to cut down on the number of data retrieval fetches that are made in the program
to increase the efficency of the program).
If the Short Item Number is not equal to zero then
If TFLA (Standard Units of Measure Conversion) not equal '1'
If the 'TO' UoM is equal to items primary UoM (UOM1) then
'FROM' UoM from the file F41002. Use the field Conversion Factor To Primary for retrieved
conversion factor
Add the Conversion Factor to Primary to the ConversionFactorFrom_to_Primary field. Set
off ConversionToPrimary flag.
Unit of Measure, 'TO' Unit of Measure to retrieve the conversion factor from the file
F41002.
again. If the conversion factor is found with the switched Units of Measure then inverse
the conversion factor before use.
If TFLA (Standard Units of Measure Conversion) equals '1'
OR the ShortItemNumber is zero
OR no conversion factor has been found in F41002 then
conversion factor from the standard UoM file (F41003).
UnitOfMeasure<=From Unit Of Measure
RelatedUnitOfMeasure<=Primary Unit Of Measure
QuantityRelatedToUOM<=1
DisplayErrors<=N
ConversionFactor=>From to Primary Conversion Factor
if ( To UOM is not equal to Primary UOM)
GetStandardUOMConversionFactor must be called two more times.
UnitOfMeasure<=To Unit Of Measure
RelatedUnitOfMeasure<=Primary Unit Of
Measure
QuantityRelatedToUOM<=1
DisplayErrors<=N
ConversionFactor=>To UOM to Primary UOM Conversion
Factor
UnitOfMeasure<=From Unit Of
Measure
RelatedUnitOfMeasure<=To Unit Of Measure
QuantityRelatedToUOM<=1
DisplayErrors<=N
ConversionFactor=>From_UOM to To_UOM Conversion
Factor
end
Save the 'FROM' Uom and 'TO' UoM conversion factor found in stack.
If no conversion factor is found then set CONTINUE_GBR and error message 0269.
Calculate the extended quantities for each of the requested units of measure.
QuantityToConvert = Conversion Factor 'FROM' Uom -> 'TO' UoM * QuantityToConvert
QuantityConvertedToPrimary = Conversion Factor 'FROM UoM -> Primary UoM * QuantityToConvert.
If ConvertToSecondary is ON
QuantityConvertedToSecondary = Conversion Factor 'FROM UoM -> Secondary UoM
* QuantityToConvert
If ConvertToPurchasing is ON
QuantityConvertedToPurchasing = Conversion Factor 'FROM' UoM -> Purchasing UoM
* QuantityToConvert
If ConvertToPricing is ON
QuantityConvertedToPricing = Conversion Factor 'FROM' UoM -> Pricing UoM
* QuantityToConvert
If ConvertToShipping is ON
QuantityConvertedToShipping = Conversion Factor 'FROM' UoM -> Shipping UoM
* QuantityToConvert
If ConvertToWeight is ON
QuantityConvertedToWeight = Conversion Factor 'FROM' UoM -> Weight UoM
* QuantityToConvert
If ConvertToVolume is ON
QuantityConvertedToVolume = Conversion Factor 'FROM' UoM -> Volume UoM
* QuantityToConvert
For Inventory interface flag equal to 'A' or 'N'.
These are for non-stock line types.
The following return fields are zeroised for non-stock items
Quantity in Secondary Unit of Measure
Quantity in Purchasing Unit of Measure
Quantity in Pricing Unit of Measure
Quantity in Shipping Unit of Measure
Quantity in Weight Unit of Measure
Quantity in 100 Weight Unit of Measure
Quantity in Volume Unit of Measure
If 'FROM' and 'TO' Unit of Measure are equal then force the following to 1.0.
Conversion factor
Conversion factor 'FROM' UoM -> primary
Conversion factor 'TO' Uom -> primary
The conversion factor is retrieved directly from the Standard Unit of Measures file F41003. (Note
that a business function for this already exists called GetStandardUoMConversionFactor).
Retrieve Special Handling Codes for Units of Measure if doing potency processing
If OT1Y equals 'Y'
If the previous From Unit of Measure is different than the current From Unit of Measure
OR the previous To Unit of Measure is different than the current To Unit of Measure
Retrieve Special Handling Codes for the From and o Unit of Measure
If the previous Item Number is different than the current Item Number
Retrieve Special Handling Codes for UOM1, UOM2, UOM3, UOM4, UOM6,
UWUM, UVM1 and the From and To Unit of Measure.
Retrieve the Special Handling Code from the F0005 from the SPHD field for
SY = '00 '
RT = 'UM'
Store the first column of the Special Handling Code in a field for potency value
Store the second column of the Special Handling Code in a field for bulk
value
Save the current From, To and Item Number
Convert Potency
If potency mode (GFLG) equals 'S' or 'K'
Potency = STDP
else
/* If lot number is blank, use standard potency passed in.
If LOTN equals blanks
Potency = STDP
else
/* Retrieve lot potency from Lot Master
Call GetLotMasterByLotNumber(B4000610) with parms as follows:
Lot NumberLot Number
Short Item NumberShort Item Number
Branch/PlantBranch/Plant
Return: Lot Potency (LOTP)
If record found,
Potency = LOTP
Potency = Potency / 100
If Potency equals zero, go to bottom of potency processing
/* From potent/To not potent and To potency/From not potent for Quantity TO UOM
If Converting From to To
If From UOM is potent
AND To UOM is not potent
Quantity To UOM = Quantity To UOM / Potency
Conversion Factor = Conversion Factor / Potency
If To UOM is potent
AND From UOM is not potent
Quantity To Uom = Quantity To UOM * Potency
Conversion Factor = Conversion Factor * Potency
/* From potent/Primary not potent and Primary potent/From not potency for Quantity in
Primary
If Converting From to Primary
OR to Secondary, Purchasing, Pricing, Shipping, Weight, Hundred Weight or Volume
If From UOM is potent
AND Primary UOM is not potent
Primary Quantity = Primary Quantity / Potency
Conversion Factor From to Primary =
Conversion Factor From to Primary / Potency
If Primary UOM is potent
AND From UOM is not potenct
Primary Quantity = Primary Quantity * Potency
Conversion Factor From to Primary =
Conversion Factor From to Primary * Potency
/* To potent/Primary not potent and Primary potent/To not potent
If Converting To to Primary
If To UOM is potent
AND Primary UOM is not potent
Conversion Factor To to Primary = Conversion Factor To to Primary /
Potency
If Primary UOM is potent
AND To UOM is not potenct
Conversion Factor To to Primary = Conversion Factor To to Primary *
Potency
/* From potent/Secondary not potent and Secondary potent/From not potent
If Converting to Secondary
If From UOM is potent
AND Secondary UOM is not potent
Quantity in Secondary = Quantity in Secondary / Potency
If Secondary UOM is potent
AND From UOM is not potenct
Quantity in Secondary = Quantity in Secondary * Potency
/* From potent/Purchasing not potent and Purchasing potent/From not potent
If Converting to Purchasing
If From UOM is potent
AND Purchasing UOM is not potent
Quantity in Purchasing = Quantity in Purchasing / Potency
If Purchasing UOM is potent
AND From UOM is not potent
Quantity in Purchasing = Quantity in Purchasing * Potency
/* From potent/Pricing not potent and Pricing potent/From not potent
If Converting to Pricing
If From UOM is potent
AND Pricing UOM is not potent
Quantity in Pricing = Quantity in Pricing / Potency
If Pricing UOM is potent
AND From UOM is not potent
Quantity in Pricing = Quantity in Pricing * Potency
/* From potent/Weight not potent and Weight potent/From not potent
If Converting to Weight
OR Converting to 100 Weight
If From UOM is potent
AND Weight UOM is not potent
Quantity in Weight = Quantity in Weight / Potency
Quantity in 100 Weight = Quantity in 100 Weight / Potency
If Weight UOM i'1a
D4000520 - Get Item UoM Conversion Factor
^
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
szBranchPlant | MCU | char | NONE | NONE |
| ||||
szFromUnitOfMeasure | UOM | char | NONE | NONE |
A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box). | ||||
szToUnitOfMeasure | RUM | char | NONE | NONE |
A code (UDC table 00/UM) that indicates a secondary unit of measure. | ||||
mnQuantityToConvert | QTY | MATH_NUMERIC | NONE | NONE |
The number of units associated with an asset. | ||||
cInventoryInterfaceFlag | IVI | char | NONE | NONE |
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
| ||||
mnConversionFactorFromToPrim | CONV | MATH_NUMERIC | NONE | NONE |
The factor that the system uses to convert one unit of measure to another unit of measure. | ||||
mnConversionFactorFrom_to_To | CONV | MATH_NUMERIC | NONE | NONE |
The factor that the system uses to convert one unit of measure to another unit of measure. | ||||
mnConversionFactorTo_to_Primar | CONV | MATH_NUMERIC | NONE | NONE |
The factor that the system uses to convert one unit of measure to another unit of measure. | ||||
mnQuantityConvertedToPrimary | QTY | MATH_NUMERIC | NONE | NONE |
The number of units associated with an asset. | ||||
cConvertToSecondary | CVOB | char | NONE | NONE |
Conversion object (Y,N). | ||||
mnQuantityConvertedToSecondary | QTY | MATH_NUMERIC | NONE | NONE |
The number of units associated with an asset. | ||||
cConvertToPurchasing | CVOB | char | NONE | NONE |
Conversion object (Y,N). | ||||
mnQuantityConvertedToPurchasin | QTY | MATH_NUMERIC | NONE | NONE |
| ||||
cConvertToPricing | CVOB | char | NONE | NONE |
Conversion object (Y,N). | ||||
mnQuantityConvertedToPricing | QTY | MATH_NUMERIC | NONE | NONE |
The number of units associated with an asset. | ||||
cConvertToShipping | CVOB | char | NONE | NONE |
Conversion object (Y,N). | ||||
mnQuantityConvertedToShipping | QTY | MATH_NUMERIC | NONE | NONE |
The number of units associated with an asset. | ||||
cConvertToWeight | CVOB | char | NONE | NONE |
Conversion object (Y,N). | ||||
mnQuantityConvertedToWeight | QTY | MATH_NUMERIC | NONE | NONE |
The number of units associated with an asset. | ||||
cConvertToVolume | CVOB | char | NONE | NONE |
Conversion object (Y,N). | ||||
mnQuantityConvertedToVolume | QTY | MATH_NUMERIC | NONE | NONE |
The number of units associated with an asset. | ||||
cPotencyMode | GFLG | char | NONE | NONE |
A cash/accrual flag, which controls whether an expense participation class relates to ledger type AA (accrual) or AZ (cash). If the field
| ||||
szLotNumber | LOTN | char | NONE | NONE |
A number that identifies a lot or a serial number. A lot is a group of items with similar characteristics. | ||||
cPotencyControl | OT1Y | char | NONE | NONE |
A code that indicates whether you control the item by potency. | ||||
mnStandardPotency | STDP | MATH_NUMERIC | NONE | NONE |
The percentage of active ingredients normally found in an item. | ||||
szErrorMessageID | DTAI | char | NONE | NONE |
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
| ||||
cSuppressErrorMsg | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
cPotencyType | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
mnShortItemNumber | ITM | MATH_NUMERIC | NONE | NONE |
An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item
| ||||
cUOMByBranch | BUMC | char | NONE | NONE |
A code that indicates how the system uses the branch/plant within the Item Specific Unit of Measure Conversion tables. Valid values are:
Y
| ||||
szUOMToPrimary | UOM | char | NONE | NONE |
A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box). | ||||
szUOMToSecondary | UOM | char | NONE | NONE |
A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box). | ||||
szUOMToPurchasing | UOM | char | NONE | NONE |
A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box). | ||||
szUOMToPricing | UOM | char | NONE | NONE |
A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box). | ||||
szUOMToWeight | UOM | char | NONE | NONE |
A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box). | ||||
szUOMToVolume | UOM | char | NONE | NONE |
A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box). | ||||
szUOMToShipping | UOM | char | NONE | NONE |
A user defined code (00/UM) that indicates the quantity in which to express an inventory item, for example, CS (case) or BX (box). | ||||
szStandardUOMConversion | TFLA | char | NONE | NONE |
Allows you to bypass the item-specific unit of measure and use the standard unit of measure. Valid values are:
blank Use the item-specific
| ||||
mnQuantityConvertedFromtoTo | QTY | MATH_NUMERIC | NONE | NONE |
The number of units associated with an asset. | ||||
cExcludeFlag | EXSO | char | OPT | NONE |
An option that indicates whether a particular unit of measure is invalid for a sales order. Values are:
Blank, N, or 0
The System includes the
|
B4000390 Get Standard Unit of Measure Conversion Factor | ||||
B4000530 Get Distribution Constants | ||||
B9800150 Update and Right Justify User Defined Codes Value |
F0005 User Defined Codes | ||||
F41002 Item Units of Measure Conversion Factors | ||||
F4101 Item Master | ||||
F4108 Lot Master |