2013 Oct 28 4:44 PM
Hi All,
For sales doc having UoM other than EA(each) it should be converted to EA.
For sales doc 900807278 the Quantity(FKIMG) has value 0.120 and Sales UoM(VRKME) as SP.
call function 'MD_CONVERT_MATERIAL_UNIT'
exporting
i_matnr = it_vbrk-matnr
i_in_me = it_vbrk-vrkme
i_out_me = 'EA'
i_menge = it_vbrk-fkimg "Quantity
importing
e_menge = it_vbrk-fkimg1 "Converted Qty
exceptions
error_in_application = 1
meinh_not_found = 2
others = 3.
After this FM, the quantity is not converting. Is this due to the quantity in decimals.
How to convert to EA and the quantity(FKIMG). Please give me the solution.
Thanks,
Haritha
2013 Oct 28 6:14 PM
Hi,
I few things:
it_vbrk is suppost to be the header table, so you dont matnr and others fields..check your code.
Second,
you can use write, sth like this
write it_vbrk-fkimg to l_quantity unit it_vbrk-vrkme.
Regards
Miguel
2013 Oct 28 5:24 PM
You Ask:
"Is this due to the quantity in decimals."
I would have to say no. Is the FM perhaps returning sy-subrc = 2?
Neal
2013 Oct 29 4:34 AM
2013 Oct 29 11:57 AM
So do you understand that this is the whole answer to your problem? If EA is not in MARM, then your can't convert to it...
Neal
2013 Oct 28 6:03 PM
Hi Haritha,
I have not used the MD_CONVERT_MATERIAL_UNIT, but I have used UNIT_CONVERSION_SIMPLE and I have not had any issues.
Give it a try.
Regards,
Steve
2013 Oct 28 6:14 PM
Hi,
I few things:
it_vbrk is suppost to be the header table, so you dont matnr and others fields..check your code.
Second,
you can use write, sth like this
write it_vbrk-fkimg to l_quantity unit it_vbrk-vrkme.
Regards
Miguel