WS01000105 & WS01000108

David Weston weston at clockwork.ca
Tue Oct 9 19:14:53 EDT 2001


Hi there
 
We have just completed this workflow at my latest client and experienced
this issue.
 
I created a new attribute to see if the workflow was started for the
appraisal business object. Then checked this in a workflow start condition.
 
The code is as follows:
 
GET_PROPERTY WORKFLOWSTARTED CHANGING CONTAINER.
 
 
DATA:
    lt_worklist_part   TYPE swr_wihdr OCCURS 10 WITH HEADER LINE,
    lt_worklist        TYPE swr_wihdr OCCURS 10 WITH HEADER LINE,
    ls_por             TYPE swotobjid,
    lt_pors            TYPE swotobjid,
    ls_object_info     TYPE swlobjects.
 
data: begin of appraisal_key,
         planversion like objec-plvar,
         appraisal like objec-objid,
      end of appraisal_key.
 
appraisal_key-planversion = OBJECT-KEY-planversion.
appraisal_key-appraisal = OBJECT-KEY-appraisalid.
lt_pors-objtype = 'BUS7026'.
lt_pors-objkey  = appraisal_key.
 
CLEAR lt_worklist_part[].
CALL FUNCTION 'SAP_WAPI_WORKITEMS_TO_OBJECT'
     EXPORTING
          objtype                  = lt_pors-objtype
          objkey                   = lt_pors-objkey
          top_level_items          = 'X'
          selection_status_variant = 0000
      TABLES
           worklist                 = lt_worklist_part[].
 
 APPEND LINES OF lt_worklist_part[] TO lt_worklist[].
 SORT lt_worklist BY wi_id.
 DELETE ADJACENT DUPLICATES FROM lt_worklist COMPARING wi_id.
 
 SWC_SET_ELEMENT CONTAINER 'Workflowstarted' 'S'.
 loop at lt_worklist.
   if lt_worklist-wi_stat ne 'COMPLETED   '.
     SWC_SET_ELEMENT CONTAINER 'Workflowstarted' 'X'.
     exit.
   endif.
 endloop.
 
 
 END_PROPERTY.
 
Hope this helps
 
Dave
 
----- Original Message -----
From: "Branco Marcina" <Branco_Marcina at national.com.au>
To: <SAP-WUG at MITVMA.MIT.EDU>
Sent: Tuesday, October 09, 2001 7:02 PM
Subject: Re: WS01000105 & WS01000108
 
 
> Himanshu,
> I'm grappling with this workflow as we speak. I don't think it will win
the
> 'SAP Workflow of the year award'.  I'm in 4.6C.
>
> I cloned both the workflows to get around that problem.
>
> The CAUSE
> ------------------
> When the appraisee rejects the appraisal it gets sent back to the
> appraiser. They ultimately would 'complete' the appraisal that in their
> inbox. Because WS01000108 loops until the appraisal is 'A'  for Approved
or
> 'C' for Cancel (See 'Check Parameters' step), the loop continues because
> the Approval Parameter is set to 'R' for Reject which creates a workitem
> again for the appraisee
>
> Setting an appraisal to 'complete' status creates the event
> 'CompletedAppraisal' for object BUS7026 from within the transaction (See
> the call to SWE_EVENT_CREATE in RHPA_APPRAISAL_HISTORICIZE). Therefore as
> well as the above loop creating a workitem, so does setting the 'Complete'
> status in the transaction itself.
>
> SOLUTION
> -----------------
> I didn't wan't to repair the function module RHPA_APPRAISAL_HISTORICIZE,
as
> this would be tricky to do and repairs aren't a good idea.
> Instead I cloned WS01000105 and WS01000108. I added a loop termination
> condition into the cloned version of WS01000108 step 'Check Parameters'.
> The loop now terminates for the additional condition of 'Approval
> Parameters = 'R' '.
>
> As a result only the transaction to 'Complete' the appraisal triggers the
> event, and the loop no longer comes into play when an employee rejects the
> appraisal.
>
>
> I hop this helps.
>
> Regards
> Branco Marcina
>
>
>
>
>
>
> "Thatte, Himanshu" <Himanshu.Thatte at KPMG.co.uk>@MITVMA.MIT.EDU> on
> 09/10/2001 22:28:30
>
> Please respond to SAP Workflow Users' Group <SAP-WUG at MITVMA.MIT.EDU>
>
> Sent by:  SAP Workflow <Owner-SAP-WUG at MITVMA.MIT.EDU>
>
>
> To:   SAP-WUG at MITVMA.MIT.EDU
> cc:
> Subject:  WS01000105 & WS01000108
>
>
> I'm in the process of implementing the standard workflow WS010000105 and
> WS01000108 for the Appraisal approval process. So far everything works
> fine,
> i.e., triggering the workflow, routing to the right person, approval
> decision, follow-up activities if approved. However, in case the appraisal
> is rejected by the appraisee, and when the appraiser makes the changes and
> completes the appraisal again, this time via his inbox, where the workitem
> was routed to on rejection, along with the original workflow, a new
> workflow
> is triggered, resulting in 2 workitems (one of the old WF and one of the
> new
> one) in the inbox of the appraisee.
>
> I have not created any start condition for this workflow, and have not
> tweaked it since it's the SAP standard workflow. Has anyone else come
> across
> this problem and what was the solution to this.
>
> Thanks in advance,
>
> Himanshu Thatte
>
>
>
>
>
>                 Email Disclaimer
>
> The information in this email is confidential and may be legally
> privileged.
> It is intended solely for the addressee.  Access to this email by anyone
> else
> is unauthorised.
> If you are not the intended recipient, any disclosure, copying,
> distribution
> or any action taken or omitted to be taken in reliance on it, is
prohibited
> and may be unlawful.  When addressed to our clients any opinions or advice
> contained in this email are subject to the terms and conditions expressed
> in
> the governing KPMG client engagement letter.
>
>
 


More information about the SAP-WUG mailing list