08-30-2007 4:25 PM
I am using UNIT_CONVERSION_SIMPLE to convert my quantity from DRS to KG or DRS to Gallons and it always gives out an error Units of different dimensions cannot be converted. I debugged it and found that its because the Dimension Keys DIMID do not match for the unit in and out. I looked up MARM and there is a conversion for DRS to KG. How to use this FM
* Convert ATP value to Sales Unit entered
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
input = wa_wmdvex-com_qty
unit_in = gv_meins
unit_out = gv_vrkme
IMPORTING
output = wa_wmdvex-com_qty
EXCEPTIONS
conversion_not_found = 1
division_by_zero = 2
input_invalid = 3
output_invalid = 4
overflow = 5
type_invalid = 6
units_missing = 7
unit_in_not_found = 8
unit_out_not_found = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
08-30-2007 4:44 PM
08-30-2007 4:33 PM
Hi,
Please check this link for sample code perhaps it may help.
http://sap.niraj.tripod.com/id64.html
Regards,
Ferry Lianto
08-30-2007 4:38 PM
HI,
check if the uom DRS ,KG, GALLON exist in the table t006 and get the exact key .
and then use the function module accordinlgy.
Thansk
Mahesh
08-30-2007 4:44 PM