<div dir="ltr"><div>Hi,</div><div>This issue is limited to one workflow and also to one task. The code works fine when an approver rejects the TRIP, however for few trips, even after Approver clicks on Reject button, it shows Approved in Log.</div>
<div>This is the code which is executed when we reject a workitem for travel and expense workflow from UWL . This code gets exceuted everytime an approver clicks on reject button.</div><div> </div><div>

<span><span>INCLUDE </span>&lt;cntn01&gt;.<br>
  <span>DATA: </span>l_rc <span>TYPE </span>sysubrc.<br>
<br>
  swc_container c_cont.<br>
<br>
  swc_create_container c_cont.<br>
<br>
  swc_set_element c_cont <span>&#39;_Result&#39; </span><span>&#39;0002&#39;.</span><br>
  swc_set_element c_cont <span>&#39;_WI_Result&#39; </span><span>&#39;0002&#39;.</span><br>
<br>
<br>
  <span>IF </span>i_dropdown <span>IS </span><span>NOT </span><span>INITIAL.</span><br>
    swc_set_element c_cont <span>&#39;REJ_REASON&#39; </span>i_dropdown.<br>
    <span>IF </span>i_dropdown <span>= </span><span>&#39;Other McCain Policy Violations&#39;.</span><br>
      swc_set_element c_cont <span>&#39;REJ_REASON_AUDIT&#39; </span><span>&#39;X&#39;.</span><br>
    <span>ENDIF.</span><br>
  <span>ENDIF.</span><br>
<br>
  swc_set_table c_cont <span>&#39;COMMENTS&#39; </span>i_line.<br>
<br>
  <span>CALL </span><span>FUNCTION </span><span>&#39;SWW_WI_CONTAINER_MODIFY&#39;</span><br>
    <span>EXPORTING</span><br>
      wi_id                      <span>= </span>i_wi_id<br>
     do_commit                  <span>= </span><span>&#39;X&#39;</span><br>
<span>*   DELETE_OLD_CONTAINER       = &#39; &#39;</span><br>
<span>*   MERGE_OLD_CONTAINER        = &#39;X&#39;</span><br>
<span>*   WI_CONTAINER_HANDLE        =</span><br>
<span>* IMPORTING</span><br>
<span>*   EXCEPTION                  =</span><br>
   <span>TABLES</span><br>
     wi_container               <span>= </span>c_cont<br>
<span>* CHANGING</span><br>
<span>*   WI_HEADER                  =</span><br>
            .<br>
<br>
  <span>CALL </span><span>FUNCTION </span><span>&#39;SAP_WAPI_WORKITEM_COMPLETE&#39;</span><br>
    <span>EXPORTING</span><br>
      workitem_id <span>= </span>i_wi_id<br>
      do_commit   <span>= </span><span>&#39;X&#39;</span><br>
    <span>IMPORTING</span><br>
      return_code <span>= </span>l_rc.<br>
<span>*    TABLES</span><br>
<span>*      simple_container = c_cont.</span><br>
<br>
<span>ENDFUNCTION.</span></span></div><div><span><span></span></span> </div><div><span><span> </span></span></div><div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 30, 2014 at 11:49 AM, Kjetil Kilhavn <span dir="ltr">&lt;<a href="mailto:list.sap-wug@vettug.no" target="_blank">list.sap-wug@vettug.no</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Torsdag 29. mai 2014 14.16.07 skrev Sangvir Singh:<br>
<div>&gt; Hi Folks,<br>
&gt; We are using webdynpro application to approve the workitem in UWL. This is<br>
&gt; a standard decision step and we have made a custom screen in webdynpro with<br>
&gt; approve and reject buttons Once approver clicks on approve or reject<br>
&gt; button, we are populating container fields  _WI_Result  and _Result as<br>
&gt; &#39;0001&#39; for approved and &#39;0002&#39; for rejected.<br>
&gt;<br>
&gt; The issue that  we are facing is , for some scenarions, even though the<br>
&gt; value in container is populated as &#39;0002&#39;, but in workflow log it is<br>
&gt; showing decision step as approved. As a result of this, despite rejection ,<br>
&gt; worklow is going to next step approval. Please provide your inputs how to<br>
&gt; tackle this.<br>
&gt;<br>
&gt; Please note we are facing this issue for some scenarios only, for rest of<br>
&gt; instances, the decision is populated correctly for both approved and<br>
&gt; rejected workitems.<br>
</div>When you say &quot;some scenarios&quot;, would that be some workflow templates or &quot;code<br>
paths&quot;, or is it only the data that vary? You are not saying what you have<br>
checked and eliminated as possible sources of the problem, so I will assume<br>
you have done nothing (which is probably not true). Start by checking if the<br>
error cases have attributes that would lead them through specific code paths,<br>
and check that there aren&#39;t any coding errors in the ABAP code or workflow<br>
template definition there.<br>
<br>
This is a vague answer, but if you want more to-the-point answers you must ask<br>
to-the-point questions with more background information.<br>
<span class="HOEnZb"><font color="#888888">--<br>
Kjetil Kilhavn / Vettug AS (<a href="http://www.vettug.no" target="_blank">http://www.vettug.no</a>)<br>
_______________________________________________<br>
SAP-WUG mailing list<br>
<a href="mailto:SAP-WUG@mit.edu">SAP-WUG@mit.edu</a><br>
<a href="http://mailman.mit.edu/mailman/listinfo/sap-wug" target="_blank">http://mailman.mit.edu/mailman/listinfo/sap-wug</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Sangvir Singh<br>9212019197<br><br>Before printing this e-mail, ask yourself whether you need a hard copy! 
</div>