10-16-2008 3:18 PM
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.
10-16-2008 3:53 PM
10-16-2008 3:53 PM
10-16-2008 3:56 PM
@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.
10-16-2008 4:07 PM
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
10-17-2008 3: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.