Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BADI - ME_PROCESS_PO_CUST

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

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

4 REPLIES 4

former_member188685
Active Contributor
0 Kudos

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

0 Kudos

@Vijay

But I dont want it to be just a warning message which the user can ignore and create a PO with 2 different plants.

Kumar.

0 Kudos

check any function or method to remove the error from log.since you said the error is coming again and again. try to debug how the error handling happening in ME21n

Former Member
0 Kudos

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.