10-15-2008 10:49 AM
Hi Expert,
I have to make a control to avoid the deletion of an item of purchase order.
In other word, when the user press the delete button in the item of purchase order, I have to check variable A.
If A = 'X' --> avoid delete item, and pop for info
else.
delete item
endif.
How I can make it ? There's a BADI, or an user exit ?
Tks a lot.
10-15-2008 10:56 AM
10-15-2008 11:49 AM
Tks Gautham,
I've implemented the BADI ME_PROCESS_PO_CUST-PROCESS_ITEM
And, now how to avoid the deletion ? How to write inside to avoid the deletion ?
tks
10-15-2008 12:15 PM
Hello,
Please implement the Badi "ME_PROCESS_PO" in that go to
if_ex_me_process_po_cust~process_item.
Write the code
DATA : re_data TYPE mepoitem.
DATA : mmmfd_preq_no TYPE mmpur_metafield VALUE 003. "Banfnummer
INCLUDE mm_messages_mac. "useful macros for message handling
CALL METHOD im_item->get_data
RECEIVING
re_data = re_data.
IF re_data-lokez ne space.
CALL METHOD im_item->invalidate( ).
mmpur_metafield mmmfd_preq_no.
mmpur_message_forced 'E' 'ME' '083' text-003 'Deletion not allowed' '' ''. ENDIF.
10-15-2008 12:42 PM
Hello Suresh,
Tks for your reply, You solved my question !
Anyway there's a little problem:
If the user delete the item, my BADI avoid this operation, but after
the user is blocked, I mean that the error message is always present.
There's a way to restore the situation ?
tks a lot,