‎2008 Mar 24 4:00 PM
I am tryng to run this FM in test mode and I put an amount in the Input and it says it needs to be in a numeric format, which it isn/ Does anyone know how this works. Also what value should i be putting in for MEINH and MEIN fields? Is one the UOM I want it converted to?
‎2008 Mar 24 5:12 PM
You cannot run function module MATERIAL_UNIT_CONVERSION in test mode (in transaction SE37). This is because the parameter INPUT, OUTPUT, UMREN and UMREZ do not have a data type assigned to them.
The only way to test this is calling this function module in a test program. Here is a sample code:
CONSTANTS: C_QUANT TYPE I VALUE 1.
DATA: P_MATNR LIKE MARA-MATNR,
P_FROM_UOM like MARA-MEINS,
W_FR_CONV_QUANT TYPE F.
CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'
EXPORTING
INPUT = C_QUANT
KZMEINH = ' ' "Base UoM
MATNR = P_MATNR
meinh = p_from_uom "Alternative UoM
MEINS = MARA-MEINS "Base UoM
EXTENDED_CONV = ' '
TYPE_UMR = ' '
NO_OUTPUT = ' '
IMPORTING
OUTPUT = W_FR_CONV_QUANT
EXCEPTIONS
CONVERSION_NOT_FOUND = 1
INPUT_INVALID = 2
MATERIAL_NOT_FOUND = 3
MEINH_NOT_FOUND = 4
MEINS_MISSING = 5
NO_MEINH = 6
OUTPUT_INVALID = 7
OVERFLOW = 8
‎2008 Mar 24 5:32 PM