Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

kEEP GETTING INPUT ERROR WHEN RUNNING material_unit_conversion

Former Member
0 Likes
2,755

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?

2 REPLIES 2
Read only

Former Member
0 Likes
1,207

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

Read only

Former Member
0 Likes
1,207

thanks for the help. i will test this out