Skip to Content
Former Member
Jun 05, 2013 at 01:01 PM

Two Level Leave Request workflow


Dear Experts,

I am working on the Two Level Leave Request Workflow.

I copied the standard workflow WS21500001 and added two background activity steps.

Activirty1. Change the Status to SENT. This Is working fine.

Activity2. Get the Next Approver Details.

For this i have created the custom class by coping the standard class CL_PT_REQ_WF_ATTRIBS.

In the custom class i have added the method 'Next_approver'. Importing parameter as REQUEST_ID.

In the Method I have written the below mentioned code.

DATA: lcl_request type ref to if_pt_req_request.

*--Enqueue the request
call function'ENQUEUE_EPTREQ'
mode_ptreq_header = 'S'
mandt = sy-mandt
request_id = Request_id
foreign_lock = 1
system_failure = 2
others = 3.

*-- Get the request object instance
call method cl_pt_req_badi=>get_request
im_req_id = Request_ID
ex_request = lcl_request.

call method lcl_request->set_next_processor
im_actor_type = 'P'
im_plvar = '01'
im_otype = 'P'
im_objid = N_PROCESSOR. " PERNR of Next Approver
if sy-subrc = 0.
commit work and wait.

*-- Dequeue the request
call function'DEQUEUE_EPTREQ'
mode_ptreq_header = 'S'
request_id = Request_id.

In the task 'Get Next Approver' I assigned the custom class and assigned the method 'Next_approver'.

Below I provide my binding.


After doing this i executed the workflow.

After first level approver Approves the workflow the the workflow is going to the Error.

The Error happened in the Get Next Approver Method.

Please validate whether i have done anything wrong.

Could anyone help me to solve this error.

Thanks & Regards,