01-06-2015 5:48 AM
Hi
I have write one code to stop PO creation without PR, and for the same i have write the code in IF_EX_ME_PROCESS_PO_CUST~CHECK. This is working fine if i have tried to save the PO without PR but i was shocked when i have checked that user is bypassing this error by pressing BACK button at the time error and save the PO without PR.
Please give me some solution.
Regards
Ajay Goel
01-08-2015 6:21 AM
Hi,
Method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM
if SY-UNAME NE 'BC01'. "AND SY-UNAME NE 'MM12'.
IF ls_mepoitem-banfn IS INITIAL.
mmpur_metafield mmmfd_preq_no.
mmpur_message_forced 'E' 'ME' '083' text-005 '' '' ''.
ENDIF.
Hope it helpful.
Regards,
Ramesh.V
01-08-2015 6:32 AM
Hello Ajay,
As Venkat Suggested, Make use of Metafields, Metafields Error message and call the invalidate Method.
If ls_mepoitem-banfn is initial
mmpur_metafield mmmfd_preq_no.
mmpur_message_forced 'E' 'ME' '083' '' '' '' ''.
* invalidate the object
CALL METHOD im_item->invalidate( ).
endif.