UoMConversion

UoMConversion

Define formula for convert from a unit to another

Allow to calculate this by length/width/height and density

 

 

Property

Description

Table

BEAS_ME_UMR

Primary key

FromUoMId/c,ToUoMId/c

$transaction

no

$branch

no

$mask

no

 

Fields

Name

Type

Description

FromUoMId

Edm.String(20)

Database: rtrim("BEAS_ME_UMR"."ME1_ID")

ToUoMId

Edm.String(20)

Database: rtrim("BEAS_ME_UMR"."ME2_ID")

Formula

Edm.String(20)

Define the formula

Example: length x width x height / 1000000

calculate pcs to qm�, based on length, width and height

Database: "BEAS_ME_UMR"."UMRFORMEL"

 

Functions

Function

Parameter

Description

Conversion

FromUnitId/c,ToUnitId/C,Length/i,Width/i,Height/i,Density/i,UnitGroupId/i

Return object with factor based on quantity 1

return object with follow properties

factor

formula

quantity (based on source quantity=1)

code (200=ok)

QtyConversion

FromUnitId/c,ToUnitId/C,Length/i,Width/i,Height/i,Density/i,UnitGroupId/i,Quantity/i

Convert Quantity from first UoM to Quantity in second UoM

return object with follow properties

factor

formula

quantity

code (200=ok)

ItemConversion

ItemCode/c,FromUnitId/c,ToUnitId/C


 

example for Conversion from one to another unit

Note: The system calculate always from FromUnitId to ToUnitId

if you work with Factor, the target quantity is

toQuantiy=fromQuantity * Factor

 

beasscript-logo-small

// work with QtyConversion
instance bsl b
b.get=UoMConversion/QtyConversion(<dw_1.item.me_verbrauch.value,bsl>,<dw_1.item.me_lager.value,bsl>,<dw_1.item.abm1.value,num(6)>,<dw_1.item.abm2.value,num(6)>,<dw_1.item.abm3.value,num(6)>,<dw_1.item.dichte.value,num(6)>,<bslitem.UnitGroupId>,<dw_1.item.menge_verbrauch.value,num(6)>)
dw_1.item.me_umr.value=<b.factor,#0.000000>
dw_1.item.menge_lager.value=<b.quantity,#0.000000>
 
// work with only Conversion
instance bsl b
b.get=UoMConversion/QtyConversion(<dw_1.item.me_verbrauch.value,bsl>,<dw_1.item.me_lager.value,bsl>,<dw_1.item.abm1.value,num(6)>,<dw_1.item.abm2.value,num(6)>,<dw_1.item.abm3.value,num(6)>,<dw_1.item.dichte.value,num(6)>,<bslitem.UnitGroupId>)
dw_1.item.me_umr.value=<b.factor,#0.000000>
// Note: in %() functions: don't work with < and >, only the variable name.
dw_1.item.menge_lager.value=%mul(dw_1.item.menge_verbrauch,b.factor)

 

 

 

 

Compatibility

Old scripts compatible. But need more time, because not all Infomations available and the system need additional select commands.

Old Syntax (beas 2020/11 and older):

object=ue_artikelstamm=umrechnung=itemcode:unit_material

New (BeasScript):

dec ProdutionUnitQty
dec StockUnitQty
ProdutionUnitQty=10
b.get=UoMConversion/ItemConversion("unit_material","Pcs","m")
WhsUnitQty = <ProdutionUnitQty,dbnum> * <b.factor,dbnum>