Hi all,
I am supposed to make an EP workflow for 2 level approval for absences or leaves. I am using a copy of workflow WS12300111. I am able to get the single level of approval, but not the second level. When the request goes to the second approver ( which is the supervisor of first approvar), it shows the leave requests of the first approvar and when I check the workplace of the employee who applied for the leave, his leave has the status 'approved'.
In other words, when the first supervisor or approvar approves the request, it gets approved and second approvar has no option to approve it again. Please suggest what to do?
In my tasks for approval, I am using the class - CL_PT_REQ_WF_ATTRIBS and the method APPROVE. Is that correct???
Is there any other standard workflow which I can refer to?
Well I have the solution for this as well - told to me by somebody on SDN itself, but I dont know how to go about it. Here it is....
Create a new BOR and create a new method - CHANGESTATUS.
Add one and only IMPORT parameter REQUEST of type PTREQ_HEADER-REQUEST_ID.
In the coding part, firstly lock your request using the FM - ENQUEUE_EPTREQ.
Then create an instance using the static method ca_pt_req_header=>agent->get_request which takes the REQUEST number as input and gives us the instance as OUTPUT.
Having the instance in hand, we can use the method initiate_state_transition to change the status of this method. Pass the SEND status as INPUT and get the new updated status as OUTPUT.
Unlock the leave request using the FM - DEQUEUE_EPTREQ.
Implement and release this method in your BOR.
And please make sure that your method is INSTANCE INDEPENDENT METHOD.
In your template create a Standard background task after your first approval step which calls this method.
___________________
Well what i did is
I have made that method change request and have defined the parameter.what will I write in importing and exporting parameters of the function module ENQUEUE_EPTREQ. In coding, what I have to do? I am not clear with that.....
And how to go about - creating the instance......
Thanks
Ribhu