Deactivation Report for Event Handler
I also wrote a report to deactivate Event Handlers. First make your selection like for Tracking IDs or EH Creation date. You may can reuse some coding e.g. from /SAPTRX/ARCHIVE_A0_WRITE.
After you have selected your EH GUIDS you should use the standard method update_eh_hdr_status from class /saptrx/cl_eh_det_intf_cntrl. The method has the import parameter deactivate for deactivation your Event Handler. The advantage using this method is that things like lock the Event Handler etc. are handled by the system.
So the call can look like that.
- LOOP AT lt_guid INTO ls_guid.
- CALL METHOD /saptrx/cl_eh_det_intf_cntrl=>update_eh_hdr_status
- i_guid = ls_guid
- i_deactivate = ‘X’
- e_bapiret_tab = lt_return.