‎2008 Jul 16 1:44 PM
hi experts,
what is the use of MD_CONVERT_MATERIAL_UNIT function module.
pl , give me with small ex.
thanks.
‎2008 Jul 16 1:45 PM
‎2008 Jul 16 1:46 PM
‎2008 Jul 16 1:48 PM
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.
‎2008 Jul 16 1:52 PM
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