Application Development and Automation 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: 
Read only

Funtion module for weight conversion

former_member227810
Participant
0 Likes
1,576

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
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,484

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

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
Read only

Former Member
0 Likes
1,484

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

Read only

brunobex
Active Participant
0 Likes
1,484

Hi Sadeq,

You can also try the function: MD_CONVERT_MATERIAL_UNIT

Regards

Bruno Xavier.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,485

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

Read only

former_member227810
Participant
0 Likes
1,484

Got the result via unit_conversion_simple