Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Requirement :

Many times we need to do a unit conversion in B-ex query designer which is a standard functionality in SAP Net weaver 2004s(BI 7.0). Now if the units involved in the unit conversion are in the same dimension(like Pound to KG or Gallon to liter) then we can use the standard table T006 to create a simple unit conversion type to use in query designer. But if the units are in different dimension(like CU to CS, CU to AS) then we can’t use the T006 table as the conversion factors for these units are not available in the T006 table. One way to solve this issue is to do the conversion in the info provider itself but this option is not flexible as for each new conversion we need a new key figure in the info provider.   

Solution :

For this type of scenario we need to create a more complex unit conversion type.

Lets take this below example.

 

 Material

Qty(CU) 

Conversion factor 

 QTY(CS)

 100010

120 

 12

 10

 100011

120

 10

 12


Here both the materials have different conversion factor from CU to CS. Now the question is how and from where the system will get this conversion info. The solution is explained in the below steps.


A. In the Business Explorer tab of the material info object change these settings

  1. Base unit of measure - Specify a base unit of measure like 0BASE_UOM. This should be a existing attribute of material info object.
  2. Units of measure for Chars - Click the "Create" button beside this setting to create a DSO. This DSO is automatically created by the system with the infoobjects material, 0unit,0base_uom,0uomz1d,0uomn1d and this can’t be maintain in the AWB. This DSO will be loaded with the conversion factors for each material.


B. Now we have to populate this DSO from the data source 0MAT_UNIT_ATTR - Material: Unit Conversion. The rules in the transformation should be as below

  • MATNR -> 0material
  • MEINH -> 0UNIT
  • UMREZ -> 0UOMZ1d
  • UMREN -> 0UOMN1d

No need to populate the 0base_uom field here. Now if we load this DSO then the conversion factors should be populated in the info objects 0UOMZ1d and 0UOMN1d with the target units of conversion in the object 0UNIT.


C. Then we need to create a conversion type. T-code : RSUOM

  1. Click create new. Under the conversion factors tab select the option Using Reference infoobject for the field "Dynamic determination of conversion factor" and select the info object 0material in the "reference info object" field.
  2. Under the UOM tab select the option unit of measure from datarecord for the field "source unit of measure" and the option selection of unit of measure during conv. for the field "Target unit of measure".

With the above selection the unit in the data record will be treated as base unit and the target unit to convert can be chosen during the query design in the B-ex.


D. Now in the query definition select the key figure and go to the conversion tab. in the unit conversion section choose the same unit conversion type that we have created in step C and the target unit to which the conversion is required. 

So this key figure will show the quantity values in the target unit. The same Key figure can be used for a different target unit by just changing the target unit option in the B-ex properties.

Things to remember:
 

  • 0material should be available in the query info provider. otherwise the unit conversion type won't appear in the properties of the query designer.
  • For each material the target unit should be available in the DSO with a conversion factor otherwise conversion won't happen.
  • If the conversion is being done in a calculated key figure(CKF) then don’t use NODIM function. if NODIM function is required then a new CKF can be created containing the first CKF with conversion.
  • The conversion type and the target unit must be specified for each nested CKF.