Skip to Content
Jul 09, 2015 at 04:08 PM

Change approver on cancellation of a old leave request


Hi all,

so i'm having the following problem:

Employee requested leaves in the past. They are all approved. Then the manager got changed. Employee wants to cancel a old leave request. The cancellation is sent the the old manager.

The badi PT_GEN_REQ is already implemented and working fine and finds the correct and actual manager. But then when an employee sends a cancellation of old leave it gets redirected to the old manager.

Unfortunately as i found out, this is hardcoded in CL_PT_REQ_APPROVER_LIST->GET_REQ_APPROVERS. There is a SELECT statement in this method:

"get request approvers

SELECT * FROM ptreq_approver INTO TABLE lt_approver_backend

WHERE request_id = is_req_id AND version_no = lv_version_no.

Here the system reads the request and finds the old approver and then sets this one as the approver.

Is there a way to override this this behavior? I want the request to be redirected to the new manager.

Thanks in advance for your answers.