on 05-15-2007 7:11 AM
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?
Thanks
Hey Ribhu,
Well, why dont you reset the status of the Leave Request from APPROVED state to SENT state?
That should solve your problem.
Regards
<i><b>Raja Sekhar</b></i>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
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.
Hope this should close this thread.
Regards
<i><b>Raja Sekhar</b></i>
Hi Raja....
I am trying to get what you are saying..... and I am getting it slowly and slowly.....
Lets see what happens...... I will close the thread once I AM able to change the status again man. I hope I am not giving you less points every time????
Help me more if u can.....
Thanks
Message was edited by:
Ribhu Ahuja
Dear Raja Sekhar,
I create a sampel program with the following code in SE38 and put in the following code. However, it seem that it does not work and the status did not get updated.
Do you know what is the problem?
DATA:
request TYPE REF TO if_pt_req_request,
event TYPE tim_req_xfer_event VALUE cl_pt_req_const=>C_REQTRANS_APPROVE,
req_id TYPE PTREQ_HEADER-REQUEST_ID value '48561480F033007EE1008000C0A8D282',
status type TIM_REQ_STATUS.
CALL FUNCTION 'ENQUEUE_EPTREQ'
EXPORTING
mode_ptreq_header = 'E'
request_id = req_id
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
CALL METHOD ca_pt_req_header=>agent->get_request
EXPORTING
im_request_id = req_id
IMPORTING
ex_request = request.
CALL METHOD request->initiate_state_transition
EXPORTING
im_transfer_event = event
im_event = event
IM_RET_VALUE = 0
IMPORTING
ex_new_status = status.
CALL FUNCTION 'DEQUEUE_EPTREQ'
EXPORTING
request_id = req_id.
Thanks
Regards,
Bryan
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.