Decision Step Outcome

Kjetil Kilhavn list.sap-wug at vettug.no
Fri May 30 06:20:13 EDT 2014


Fredag 30. mai 2014 13.15.46 skrev Sangvir Singh:
> Hi,
> 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.
> 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.

My shot in the dark: the approver first clicks the "Approve" button, and then 
clicks the "Reject" button before the work item disappears from UWL. It seems 
you are not checking the work item status before you call 
SWW_WI_CONTAINER_MODIFY - so unless that function checks the status and 
prevents you from updating the container of a completed work item this 
scenario is a possibility (and I guarantee you that sooner or later users will 
visit every possible scenario).


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

-- 
Kjetil Kilhavn / Vettug AS (http://www.vettug.no)


More information about the SAP-WUG mailing list