Skip to Content
0
Jan 27, 2012 at 02:38 PM

Funtion module for weight conversion

89 Views

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