Skip to Content

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

BADI - ME_PROCESS_PO_CUST

Hi Everyone,

I got a minor glitch when I am trying to implement this BADI. Below is my code. It works beautifully and gives out an error when the plant in line item 2 is different from plant in line item 1. But the problem is when we correct the error, it still retains the error and gives out the error message. So if someone commits an error and tries to change the plant after seeing the error, they still get the error. Anyway to rectify this?

method IF_EX_ME_PROCESS_PO_CUST~CHECK.


  DATA:
    lt_items      TYPE purchase_order_items,
    ls_item       TYPE purchase_order_item,
    ls_detail     TYPE mepoitem,
    lt_details    TYPE tab_mepoitem,
    v_Werks TYPE werks.

" Get the order items
  lt_items = im_header->get_items( ).

  REFRESH: lt_details.
  LOOP AT lt_items INTO ls_item.
    ls_detail = ls_item-item->get_data( ).
    break akumar.
    if ls_detail-ebelp = '0010'.
      v_werks = ls_detail-werks.
      endif.
      if ls_detail-ebelp ne '0010'.
        if ls_detail-werks ne v_werks.
       MESSAGE e000(ZAN) with text-010.

       endif.
       endif.

    ENDLOOP.

endmethod.

Thanks,

Kumar.

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question