Skip to Content
0
Former Member
Nov 02, 2010 at 07:26 PM

BADI ME_REQ_POSTED in Transaction ME55

539 Views

Hi all,

I'm trying to implement BADI ME_REQ_POSTED to prevent users releasing purchase requisitions in transaction ME55 which they created themselves.

I've got the code below to work to a certain extent, an error will be displayed when you click on one of your own requisitions, however, if you then click the 'release' button of a requisition which wasn't created by you, both documents are released.

I have a feeling that this is due to the releasing function not being complete when the error message is shown, so it continues when the second requisition is clicked, validating both documents. I'm very new to ABAP so open to any suggestions!

 
method IF_EX_ME_REQ_POSTED~POSTED. 
  if sy-tcode = 'ME55'. 
    DATA: ls_header TYPE UEBAN. 
    loop at im_eban into ls_header. 
    endloop. 
    if ls_header-ernam = sy-uname. 
      MESSAGE ID 'ZVAL' TYPE 'E' NUMBER '010'. 
    endif. 
  endif. 
endmethod. 

Thanks,

Richard