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: 

can any one pls tell me the use of below fm

Former Member
0 Kudos
147

MD_CONVERT_MATERIAL_UNIT

1 ACCEPTED SOLUTION

Former Member
0 Kudos
95

hi,

used for Conversion of material units

Ensure same Material UOM for quantity comparison as follows

CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'

EXPORTING

i_matnr = l_matnr

i_in_me = l_meins_in

i_out_me = 'KG'

i_menge = l_gsmng

IMPORTING

e_menge = l_gsmng

EXCEPTIONS

error_in_application = 1

error = 2

OTHERS = 3.

IF sy-subrc <> 0.

WRITE:/ 'Material Unit conversion not maintained for ',

wa_tab-cell_0002.

regards

mahesh

3 REPLIES 3

Former Member
0 Kudos
95

Hi,

This FM is used for Conversion of material units.

e.g.

CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'

EXPORTING

i_matnr = l_matnr

i_in_me = l_meins_in

i_out_me = 'KG'

i_menge = l_gsmng

IMPORTING

e_menge = l_gsmng

EXCEPTIONS

error_in_application = 1

error = 2

OTHERS = 3.

You can also use FM MATERIAL_UNIT_CONVERSION

Some other FM are

CF_UT_UNIT_CONVERSION – Converts material unit quantities

MATERIAL_UNIT_CONVERSION – Converts base unit to alternative unit

UNIT_CONVERSION_SIMPLE – Converts measurement unit values and rounds

Former Member
0 Kudos
96

hi,

used for Conversion of material units

Ensure same Material UOM for quantity comparison as follows

CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'

EXPORTING

i_matnr = l_matnr

i_in_me = l_meins_in

i_out_me = 'KG'

i_menge = l_gsmng

IMPORTING

e_menge = l_gsmng

EXCEPTIONS

error_in_application = 1

error = 2

OTHERS = 3.

IF sy-subrc <> 0.

WRITE:/ 'Material Unit conversion not maintained for ',

wa_tab-cell_0002.

regards

mahesh

former_member156446
Active Contributor
0 Kudos
95

Hi sri with FM all u need to give is the quantity in one Unit of measure and give the target unit... it will automatically take the convertion factor and give you the output..

1 kg = X pounds.

if you give 1 and kg and pounds as input it will give you the X.