<div dir="ltr">Dear Friends,<br>
I simulated the two level ESS leave request scenario and found that the
issue is: even after the first level approver approves the leave
request, the leave request is still appearing in his Work list(not as a
workitem in UWL, but when he clicks other leave request work item, the
old leave which he approved before still appears in the
table(worklist)) and he is able to approve it again, In this case what
is happening is the leave request status is again changed from
SENT(which was previously changed by WF_BATCH) to APPROVED. Please
advice how to resolve it.<br><br><div class="gmail_quote">On Thu, Feb 11, 2010 at 3:19 PM, Ibrahim <span dir="ltr">&lt;<a href="mailto:ikhansap@gmail.com">ikhansap@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Dear Friends,<br>
  We have copied the standard leave request workflow WS12300111 and enhanced it with two levels of approval.<br>
As per the Workflow design of the leave Approval, the Status of the
leave request will be in SENT Status when the employee sends the leave
request for approval. When the Manager approves the leave request the
status of the leave request will be changed to APPROVED. The <b>workflow system will then change this again to SENT for second level approval(this is not available in standard)</b>
and when the second level approver approves the leave request the
status is again changed to APPROVED(part of standard). The background
job which posts the leave requests RPTARQPOST will pick the all leave
request which has a status APPROVED and create a leave request in R/3
and finally change the status as POSTED. For changing the leave request
status from APPROVED to SENT(intermediate step) we have created a
method inside the class CL_PT_REQ_WF_ATTRIBS and call that method
inside a task in workflow and we are using the following code to change
the status. The issue we are facing is the leave request are getting
posted without the second level approval, means the worklfow is in
ready status(for second level approval) but the leave request is having
the status as &quot;Posted&quot;, and because of this when the second level
approver opens his work item from UWL, he cannot see those leave
request. Please advice what could be the issue and how to trouble shoot
this problem. I tried to simulate the same issue in Quality system and
its working fine.<br>
<p>
  </p><pre><code>DATA: request TYPE REF TO if_pt_req_request,<br>              event   TYPE tim_req_xfer_event VALUE cl_pt_req_const=&gt;c_reqtrans_send.<br> <br>    CALL METHOD cl_pt_req_badi=&gt;get_request<br>
    EXPORTING<br>      im_req_id  = me-&gt;req_id<br>    IMPORTING<br>      ex_request = request.<br> <br>  CALL METHOD cl_pt_req_badi=&gt;initiate_state_transition<br>    EXPORTING<br>      im_request    = request<br>      im_event      = event<br>

*    IM_RET_VALUE  = 0<br>    IMPORTING<br>      ex_new_status = me-&gt;status.<br></code></pre></div>
</blockquote></div><br></div>