Skip to Content
avatar image
Former Member

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Oct 16, 2008 at 02:53 PM

    try with warning message and see. instead of error message.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 17, 2008 at 02:54 PM

    I had some code in the process_item method also and it was retaining the error, so I changed everything to show up only when you hit the check button and it works fine now. Thanks for your help.

    Kumar.

    Add comment
    10|10000 characters needed characters exceeded