Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Funtion module for weight conversion

former_member227810
Participant
0 Kudos
446

Hi,

i need to convert fetch quantity into metric tonnes

there are so many function modules

which function module is better for this approach

i tried with

CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
  EXPORTING
    INPUT                      = WA_VBRKP-NTGEW
   NO_TYPE_CHECK              = 'X'
*   ROUND_SIGN                 = ' '
   UNIT_IN                    = WA_VBRKP-GEWEI
   UNIT_OUT                   = 'TO'
 IMPORTING
*   ADD_CONST                  =
*   DECIMALS                   =
*   DENOMINATOR                =
*   NUMERATOR                  =
   OUTPUT                     = WA_VBRKP-NTGEW
* EXCEPTIONS
*   CONVERSION_NOT_FOUND       = 1
*   DIVISION_BY_ZERO           = 2
*   INPUT_INVALID              = 3
*   OUTPUT_INVALID             = 4
*   OVERFLOW                   = 5
*   TYPE_INVALID               = 6
*   UNITS_MISSING              = 7
*   UNIT_IN_NOT_FOUND          = 8
*   UNIT_OUT_NOT_FOUND         = 9
*   OTHERS                     = 10
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

<Added code tags>

Thanks & regards

Sadeq

Edited by: Suhas Saha on Jan 27, 2012 9:17 PM

1 ACCEPTED SOLUTION

SuhaSaha
Advisor
Advisor
0 Kudos
354

Hello Sadeq,

UNIT_CONVERSION_SIMPLE is released, well documented whereas the other FMs mentioned are not released!

Are you facing any problems using it? If yes, please elaborate it.

BR,

Suhas

4 REPLIES 4

Former Member
0 Kudos
354

Hi,

You can Try "CF_UT_UNIT_CONVERSION"

Example:

Import parameters Value

MATNR_IMP

MEINS_IMP

UNIT_NEW_IMP KG

UNIT_OLD_IMP TO

VALUE_OLD_IMP 10.000

Export parameters Value

VALUE_NEW_EXP 10,000.000

Regards,

Anil

brunobex
Active Participant
0 Kudos
354

Hi Sadeq,

You can also try the function: MD_CONVERT_MATERIAL_UNIT

Regards

Bruno Xavier.

SuhaSaha
Advisor
Advisor
0 Kudos
355

Hello Sadeq,

UNIT_CONVERSION_SIMPLE is released, well documented whereas the other FMs mentioned are not released!

Are you facing any problems using it? If yes, please elaborate it.

BR,

Suhas

former_member227810
Participant
0 Kudos
354

Got the result via unit_conversion_simple