2007 Apr 07 12:32 PM
Hi all,
can any one help me how to covert the stock in qty to sctock in ltrs.
i have used to following code for that but it was showing zero values. can any one help me in this issue.
IF i_final-meins NE 'KG'.
i_bestand_bal_kg = 'KG'.
CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
EXPORTING
i_matnr = i_mara-matnr
i_in_me = i_final-meins
i_out_me = i_bestand_bal_kg
i_menge = i_final-menge3
IMPORTING
e_menge = i_final-menge4
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.
ENDIF.
ELSE.
i_final-menge4 = i_final-menge3.
ENDIF.
i_bestand_bal_lt = 'L'.
CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
EXPORTING
i_matnr = i_mara-matnr
i_in_me = i_final-meins
i_out_me = i_bestand_bal_lt
i_menge = i_final-menge3
IMPORTING
e_menge = i_final-menge5
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.
ENDIF.
Thanks in advance,
ramana prasad
2007 Apr 07 12:41 PM
Liters and kilograms do not belong to the same dimension, so are your material conversion units defined?
If the conversion between KG and L doesnt exist for each of your material, no conversion can be executed (so giving Zero)
Regards
2007 Apr 07 1:12 PM
See Entering Alternative Units of Measure in <a href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/LOMDMM/LOMDMM.pdf">Material Master (LO-MD-MM)</a>
Regards
2007 Apr 07 1:03 PM
Hi Rama,
The base unit of a material is maintained in MARA-MEINS, the alternative units for that material will be maintained in MARM-MEINH.
Please see whether alternative unit "KG " is maintained in MARM table for that material.If its maintained then only the function module will give correct values.
Regards
Avi...