Skip to Content
avatar image
Former Member

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Sep 01, 2008 at 12:57 PM

    Hi,

    First get the data from mara then compare and convert.

    IF NOT itab1[] IS INITIAL.

    SELECT matnr meins INTO table i_uoms FROM mara

    FOR ALL ENTRIES IN itab1

    WHERE matnr EQ itab1-matnr.

    ENDIF.

    LOOP AT itab1 INTO wa.

    READ TABLE i_uoms INTO wa1 WITH KEY matnr = wa-matnr.

    IF wa-uom NE wa1-uom.

    CALL FM mentioned by AMIT to convert quantity to base unit.

    ELSE.

    Proceed.

    ENDIF.

    ENDLOOP.

    Thanks,

    Vinod.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Priyanka,

      For this question u could have pressed F1 key of ur key board:-). If u post this question here u get ans only for this question. But If u press F1 u come to many things about MODIFY statement.

      Anyways ans for ur question is...

      LOOP AT itab1 INTO wa.

      l_tabix = sy-tabix.

      the logic i told.

      wa-quantity = FM output quantity(Converted value).

      MODIFY itab1 FROM wa TRANSPORTING quantity INDEX l_tabix.

      ENDLOOP.

      Thanks,

      Vinod.

  • Sep 01, 2008 at 12:53 PM

    MD_CONVERT_MATERIAL_UNIT

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 01, 2008 at 12:59 PM

    Hello

    select single * from MARM where matnr = ITAB1-matnr and meins = ITAB1-meins.
    if sy-subrc = 0.
      call function 'MD_CONVERT_MATERIAL_UNIT' ......
    endif.
    

    Add comment
    10|10000 characters needed characters exceeded