on 06-05-2013 2:01 PM
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.
Why do you need to create a method to assign the second step approver? If you have the next processor (N_PERNR), you can directly assign it to the second approval step as an agent.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
What error you are getting?Can you please provide the screen shot of the error?.Meanwhile put a break point in your class method and debug the task.
Thanks
Naresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.