Skip to Content

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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

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 a comment
    10|10000 characters needed characters exceeded

  • Posted on May 04, 2011 at 09:51 AM

    Solved.

    Regards,

    Madhu.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.