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

Two Level Leave Request workflow

49 Views

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'
exporting
mode_ptreq_header = 'S'
mandt = sy-mandt
request_id = Request_id
exceptions
foreign_lock = 1
system_failure = 2
others = 3.

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

call method lcl_request->set_next_processor
exporting
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.
endif.

*-- Dequeue the request
call function'DEQUEUE_EPTREQ'
exporting
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.

&YCL_PT_REQ_WF_ATTRIBS_HANOI& = &_WI_OBJECT_ID&
&REQ.REQ_ID& = &REQUEST_ID&

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,
Ashok.