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: 

function module

Former Member
0 Kudos

hi experts,

what is the use of MD_CONVERT_MATERIAL_UNIT function module.

pl , give me with small ex.

thanks.

4 REPLIES 4

bpawanchand
Active Contributor
0 Kudos

Hi

A function module to convert many types of quantities

(EG: barrels to gallons, gallons to liters)

Regards

Pavan

Former Member
0 Kudos

hi

Plz refer to the link.

Regards

Sumit Agarwal

vinod_vemuru2
Active Contributor
0 Kudos

Hi,

This is used to convert the quantity from one unit to other. All these units(Source and target) must be specified in the material master(U can check in MM03).

Sample code


  DATA:
    LD_MENGE_IN        LIKE ACCIT-MENGE,
    LD_MENGE_OUT       LIKE ACCIT-MENGE,
    LD_FACTOR          TYPE I VALUE 1.

  LD_MENGE_IN = ABS( I_MENGE_IN ).
  CLEAR E_MENGE_OUT.
  LD_FACTOR = SIGN( I_MENGE_IN ).
  CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
       EXPORTING
            I_MATNR  = I_MATNR
            I_IN_ME  = I_MEINH_IN
            I_OUT_ME = I_MEINH_OUT
            I_MENGE  = LD_MENGE_IN
       IMPORTING
            E_MENGE  = LD_MENGE_OUT
       EXCEPTIONS
            OTHERS   = 4.
  E_SUBRC = SY-SUBRC.
  IF E_SUBRC IS INITIAL.
    E_MENGE_OUT = LD_MENGE_OUT * LD_FACTOR.
  ENDIF.

Thanks,

Vinod.

Former Member
0 Kudos

Hi Shirish.

This is a function module for conversion of a material unit.

I would like to suggest you a couple of references relating to your case,

[SDN - Reference for Function module for Unit of material - MD_CONVERT_MATERIAL_UNIT|;

[SDN - Reference for Material Unit of Conversion|/thread/443393 [original link is broken];

Hope that's usefull.

Good Luck & Regards.

Harsh Dave