Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

cheking the material for base unit or convert it to base unit.

Hi friends,

I have a requirement asa follows.

I Have an internal table ITAB1 in that i have some 200 records. In that ITAB1 i have

MATNR and MEINS field and iam selecting those fields from MSEG table.

Now my requirment is i have to check for base unit of that particular.

example :

now let us say iam getting in my ITAB1.

MATNR MEINS

M-123 EA

now i have to check the base material for that material. if both the base unit and what i got i same then its ok. or if the both are not same then it should convert to the base unit.

how can i do that.

Regards,

Priyanka.

Tags:
Former Member
Former Member replied

Hi Priyanka,

To this FM u have to pass the material number, Input unit(itab1-meins), Output unit(Base unit-mara-meins), Quantity. In Importing parameter E_MENGE pass one variable. After FM call u will receive the converted value in this variable.

Just check the where used list of the FM to see the sample code.

    CALL FUNCTION 'MD_CONVERT_MATERIAL_UNIT'
         EXPORTING
              I_MATNR              = P_MATNR
              I_IN_ME              = P_MEEHT "Input unit
              I_OUT_ME             = P_AUSME "Base unit
              I_MENGE              = P_MENGE "Input Quantity
         IMPORTING
              E_MENGE              = I_AUMENGE "Quantity in base unit.
         EXCEPTIONS
              ERROR_IN_APPLICATION = 1
              OTHERS               = 2.

Thanks,

Vinod.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question