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: 

Back button bypass the Badi ME_PROCESS_PO_CUST-Check

Former Member
0 Kudos

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

2 REPLIES 2

VenkatRamesh_V
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.