Skip to Content
author's profile photo
Former Member

Message if duplicate material entered in purchase order

Hi All,

Is there any possibility to give a message in me21n if we enter a material which in already maintained as one line item to create PO. To issue messages in sales order there is an exit. I tried with the badi ME_PROCESS_PO_CUST. I was struck here. Please suggest me good idea how to do this.Thanks to all.

In Sales order i resolved in this way.

LOOP AT xvbap

WHERE matnr EQ vbap-matnr

AND posnr NE vbap-posnr

AND kwmeng NE 0.

MESSAGE 'Material is already on the order' type 'I'.

ENDLOOP.

ENDFORM.

Regars,

Madhu.

Edited by: madhurao123 on May 2, 2011 8:40 PM

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Posted on May 03, 2011 at 07:26 AM

    Hi

    In badi ME_PROCESS_PO_CUST, in method CHECK try to do a coding as this:

      INCLUDE mm_messages_mac.
    
      DATA: header       TYPE mepoheader,
            items        TYPE purchase_order_items,
            po_line      TYPE mepoitem,
            line_item    TYPE purchase_order_item.
    
      header = im_header->get_data( ).
      items  = im_header->get_items( ).
    
      LOOP AT items INTO line_item.
    
        po_line = line_item-item->get_data( ).
       "here, you must have all data, so, check that matnr is not repeated.
       "after, with message 398(00) as example
        IF condition IS true.
           mmpur_message 'I' '00' '398'
               string1 string2 string3 string4.
        ENDIF.
      ENDLOOP.
    

    I hope this helps you

    Regards

    Eduardo

    Edited by: E_Hinojosa on May 3, 2011 9:28 AM

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on May 04, 2011 at 09:51 AM

    Solved.

    Regards,

    Madhu.

    Add comment
    10|10000 characters needed characters exceeded