‎2007 Mar 06 9:12 PM
Hi experts,
Can you please give a sample code for the function module:
MATERIAL_UNIT_CONVERSION (function module documentation ddidnt help me!)
I want to convert material from one unit to others. For ex: from case to packs.
Please give your input.
Thank you.
‎2007 Mar 06 9:18 PM
Hi,
you can also use the FM MD_CONVERT_MATERIAL_UNIT.
Check this example..
PARAMETERS: P_MATNR TYPE MATNR OBLIGATORY.
PARAMETERS: P_IN_ME TYPE MEINS OBLIGATORY.
PARAMETERS: P_OP_ME TYPE MEINS OBLIGATORY.
DATA: V_MENGE TYPE EKPO-MENGE.
CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
EXPORTING
i_matnr = P_MATNR
i_in_me = P_IN_ME
i_out_me = P_OP_ME
i_menge = '1.000'
IMPORTING
E_MENGE = V_MENGE
EXCEPTIONS
ERROR_IN_APPLICATION = 1
ERROR = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
WRITE: / V_MENGE.
ENDIF.
Thanks,
Naren
‎2007 Mar 06 9:18 PM
Hi,
you can also use the FM MD_CONVERT_MATERIAL_UNIT.
Check this example..
PARAMETERS: P_MATNR TYPE MATNR OBLIGATORY.
PARAMETERS: P_IN_ME TYPE MEINS OBLIGATORY.
PARAMETERS: P_OP_ME TYPE MEINS OBLIGATORY.
DATA: V_MENGE TYPE EKPO-MENGE.
CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
EXPORTING
i_matnr = P_MATNR
i_in_me = P_IN_ME
i_out_me = P_OP_ME
i_menge = '1.000'
IMPORTING
E_MENGE = V_MENGE
EXCEPTIONS
ERROR_IN_APPLICATION = 1
ERROR = 2
OTHERS = 3
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
WRITE: / V_MENGE.
ENDIF.
Thanks,
Naren
‎2007 Mar 06 9:19 PM
Hi Krishen,
Please check this sample program perhaps it may help.
http://groupc.tripparty.com/html/intania/uploadprogram/1ss.txt
Regards,
Ferry Lianto