cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

function modules for unit conversion

Former Member
0 Likes
32,554

hai gurus.

what is the function module to make one qty to the same unit as other qty.

if one is in kg and other in pounds

i want to make both in pounds.

pls help me with this

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi

Use the fun Module

UNIT_CONVERSION_SIMPLE or

MD_CONVERT_MATERIAL_UNIT

<b>Reward points for useful Answers</b>

Regards

Anji

Former Member
0 Likes

Hi

chk UNIT_CONVERSION_SAMPLE

also chk this

CF_UT_UNIT_CONVERSION

Some Insights-

Unit conversions

with NW2004s the HOW-TO GUIDE for qty conversion is obsolete.

http://help.sap.com/saphelp_nw2004s/helpdata/en/27/b65c42b4e05542e10000000a1550b0/content.htm

As of SAP NetWeaver 2004s you can create quantity conversion types using transaction RSUOM.

The business transaction rules of the conversion are established in the quantity conversion type. The conversion type is a combination of different parameters (conversion factors, source and target units of measure) that determine how the

conversion is performed.

In terms of functionality, quantity conversion is structured similarly to currency translation.

Quantity conversion allows you to convert key figures with units that have different units of measure in the source system into a uniform unit of measure in the BI system when you update them into InfoCubes

http://help.sap.com/saphelp_nw04s/helpdata/en/27/b38c4284a8c353e10000000a1550b0/content.htm

It is entered in ODS table linked to info object (0material)

What you need to do basically is-

1 ) Goto your infoobject for eg- 0material

2 ) In Info object Maintenance- Tab page- Bex Explorer

3 ) Enter 0BASE_UOM in Base unit of measure

4 ) Generate UOM ODS (System generates it with prefix UOM)

It is made of 4 fields (1 more in case of compounding) with SID for them. This is the place where you enter numerator and

denominator to calculate conversion factor

5 ) Load the UOM ODS with conversion from 0MAT_UNIT_ATTR or flat file

6 ) Define conversion type

7 ) In the conversion type, then you can select 0Material in the dynamic determination of conversion factor

8 ) Select source unit and target unit

For more help refer SAP help file on NW2004s. It is comprehensive and even explain - How to do unit conversion in

transformation rule?

http://help.sap.com/saphelp_nw04s/helpdata/en/4f/707242df019c60e10000000a1550b0/content.htm

Check this sample code,


  CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
    EXPORTING
*     CLIENT                  = SY-MANDT
      DATE                    = pdate
      FOREIGN_AMOUNT          = p_amt1
      FOREIGN_CURRENCY        = p_curr1
      LOCAL_CURRENCY          = p_curr2
*     RATE                    = 0
*     TYPE_OF_RATE            = 'M'
*     READ_TCURR              = 'X'
    IMPORTING
      EXCHANGE_RATE           = w_rate
      FOREIGN_FACTOR          = w_fact1
      LOCAL_AMOUNT            = w_amt
      LOCAL_FACTOR            = w_fact2
*     EXCHANGE_RATEX          =
*     FIXED_RATE              =
*     DERIVED_RATE_TYPE       =
    EXCEPTIONS
      NO_RATE_FOUND           = 1
      OVERFLOW                = 2
      NO_FACTORS_FOUND        = 3
      NO_SPREAD_FOUND         = 4
      DERIVED_2_TIMES         = 5
      OTHERS                  = 6.
  IF SY-SUBRC <> 0.
    write: / 'Conversion to loc.curr. failed:',
             p_curr1, '->', p_curr2, 'err.code=', sy-subrc.
  ELSE.
    write: / 'to Loc.curr:', p_amt1 currency p_curr1, p_curr1, '->',
           w_amt currency p_curr2, p_curr2,
           '(', w_rate, ')', w_fact1, w_fact2.
  ENDIF.

http://www.geocities.com/victorav15/sapr3/examples/currconv.txt

Check this

CONVERSION_FACTOR_GET

Measurement unit conversion: Get measurement unit conversion factor Not for Dimensionless Units of Measure

UNIT_CONVERSION_SIMPLE Measurement unit conversion by table T006, with rounding

UNIT_OF_MEASURE_SAP_TO_ISO

UNIT_OF_MEASURE_ISO_TO_SAP

MATERIAL_UNIT_CONVERSION Material quantity conversion from Base Unit of Measure to Alternative Unit of Measure and vice versa. For Dimensionless Units of Measure (Each, Piece, Box etc.) conversion depends on the given Material (see table MARM). For other Units of Measure (Length, Weigth etc.) conversion can be calculated from the T006 table or via CONVERSION_FACTOR_GET.

CONVERSION_EXIT_CUNIT_INPUT Conversion exit for commercial (3-char) measurement unit INPUT

CONVERSION_EXIT_CUNIT_OUTPUT Conversion exit for commercial (3-char) measurement unit OUTPUT

CONVERSION_EXIT_LUNIT_INPUT Conversion exit for technical (6-char) measurement unit INPUT

CONVERSION_EXIT_LUNIT_OUTPUT Conversion exit for technical (6-char) measurement unit OUTPUT

UNIT_OF_MEASUREMENT_HELP Input help for measurement units of a predefined dimension

http://www.geocities.com/victorav15/sapr3/abapfun.html

Reward all helpfull answers

Regards

Pavan

Answers (5)

Answers (5)

Former Member

Hi,

Use UNIT_CONVERSION_SIMPLE or MATERIAL_UNIT_CONVERSION.

CF_UT_UNIT_CONVERSION

MATERIAL_UNIT_CONVERSION

<b>

Reward points</b>

Regards

Former Member

CF_UT_UNIT_CONVERSION Convert units

Regards,

Pavan P.

Former Member
0 Likes

thanks for this

but i think u all ddnt get my problem fully. i will explain it,

i am writing a start routine for updating a cube. in that i have to make a calculation with quantity from two feilds. for that i have to make the unit of measurement standard to that of standard data in material master data.

my feild is 0qty and the master data feild is BaseUom. so my task is to,

Get the Base UoM from the 0MATERIAL Master data (0BASE_UOM).Convert 0QTY to the BaseUom (QTYBOM).

Former Member
0 Likes

thanks gurus

but i want to convert the unit of one feild to another unit from some other feild in masterdata

Former Member
0 Likes

thanks for u'r help.

also pls show me the syntax for this operation