Triggering Events for HR

Sue Doughty Sue.Doughty at odfl.com
Tue May 26 14:43:42 EDT 2009


Lynne,

 

Yes.  Below is the code that I use in my method and I get only active
workflows.  Make sure that you loop the worklist[] and exclude the
current workflow ID when looking for duplicates.

 

SWC_GET_ELEMENT CONTAINER 'CURRENTWIID' CURRENTWIID.

SWC_GET_ELEMENT CONTAINER 'WFTASKID' WFTASKID.      (Current Workflow
Name - WS########)

 

I_OBJTYPE = 'APPLICANT'.                     

I_OBJKEY = OBJECT-KEY-APPLICANTNUMBER.


                                          

call function 'SAP_WAPI_WORKITEMS_TO_OBJECT' 

  EXPORTING                                  

    objtype                  = I_OBJTYPE     

    objkey                   = I_OBJKEY      

    top_level_items          = 'X'           

    selection_status_variant = '0001'        

    output_only_top_level    = 'X'           

  TABLES                                     

    worklist                 = worklist[].   

 

ACTIVE_WF_FOUND = 'N'.                               

                                                     

IF worklist[] IS INITIAL.                            

ELSE.                                                

  LOOP AT WORKLIST.                                  

    IF WORKLIST-WI_ID = CURRENTWIID.                 

      ACTIVE_WF_FOUND = 'N'.                         

    else.                                            

      IF WORKLIST-WI_RH_TASK EQ WFTASKID.            

        ACTIVE_WF_FOUND = 'Y'.                       

        DUPLICATEWIID = WORKLIST-WI_ID.              

        DUPLICATETASKID = WORKLIST-WI_RH_TASK.       

        EXIT.                                        

      endif.                                         

    endif.                                           

  ENDLOOP.                                           

 

Regards,

Sue T. Doughty

SAP Workflow Specialist

Old Dominion Freight Line, Inc.

500 Old Dominion Way

Thomasville, NC 27360

Phone:  (336) 822-5189

Toll Free (800 ) 432-6335, ext. 5189

Email:  sue.doughty at odfl.com

________________________________

From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of lynne.allen at kodak.com
Sent: Tuesday, May 26, 2009 1:47 PM
To: SAP Workflow Users' Group
Subject: RE: Triggering Events for HR

 


Thanks for all the responses to my question.  They are very helpful and
gives me an idea of what I can try. 

The  FM SAP_WAPI_WORKITEMS_TO_OBJECT does seem to be a good solution
since I am not raising my own event and using an SAP 
 supplied event. One question I have does this only bring back the
active workitems?

Lynne M. Allen | ERP Workflow Development | Worldwide Information
Systems (WWIS) | 
Eastman Kodak Company | 343 State Street | Rochester, NY 14650-1221 | 
lynne.allen at kodak.com <mailto:lynne.allen at kodak.com>  | 585-724-3556
Office | 
www.kodak.com <http://www.kodak.com/>  
 





"Sue Doughty" <Sue.Doughty at odfl.com> 
Sent by: sap-wug-bounces at mit.edu 

05/21/2009 01:46 PM 

Please respond to
"SAP Workflow Users' Group" <sap-wug at mit.edu>

To

"SAP Workflow Users' Group" <sap-wug at mit.edu> 

cc

 

Subject

RE: Triggering Events for HR

 

 

 




Hi Lynne, 
  
This might not be the best way to handle this, but here goes.   
  
I have a workflow for Applicants/Applications where sometimes multiple
workflows will get started.  The first step in that workflow is a method
I created that calls SAP_WAPI_WORKITEMS_TO_OBJECT.  I pass in the
current Work item ID and look for all active work items for the business
object with the object key.  In the method I loop through all the ones
it finds and if the Work Item ID sent into the method does not match
what it found, then I consider it a duplicate workflow and send out a
flag from the method.  If the flag = y, I do a process control step to
cancel the current workflow in the next step. 
  
Regards, 
Sue T. Doughty 
SAP Workflow Specialist 
Old Dominion Freight Line, Inc. 
500 Old Dominion Way 
Thomasville, NC 27360 
Phone:  (336) 822-5189 
Toll Free (800 ) 432-6335, ext. 5189 
Email:  sue.doughty at odfl.com <mailto:sue.doughty at odfl.com>  

 

________________________________


From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of lynne.allen at kodak.com
Sent: Thursday, May 21, 2009 11:54 AM
To: sap-wug at mit.edu
Subject: Triggering Events for HR 
  

This is a very basic question.... 
   When creating a recurring payment in HR, an SAP event of CREATED
(object recurrpay)  is raised for each different wage type used for an
employee. 
   For instance, if there are 3 wage types, 3 events are raised for the
SAME employee.  After the creation of the payment and the save key is
hit the event kicks off, so for each payment for the same employee we
are getting 3 events. We do not want to start the WF 3x. 
We want to start a workflow ONE time, as long as one payment exists
start the workflow, from there it does not matter how many payments are
entered.  Any thoughts on how this can be done without started the
workflow for each time? 


    

Lynne M. Allen | ERP Workflow Development | Worldwide Information
Systems (WWIS) | 
Eastman Kodak Company | 343 State Street | Rochester, NY 14650-1221 | 
lynne.allen at kodak.com <mailto:lynne.allen at kodak.com>  | 585-724-3556
Office | 
www.kodak.com <http://www.kodak.com/>  
_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20090526/2ab35cf0/attachment.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 826 bytes
Desc: image001.gif
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20090526/2ab35cf0/attachment.gif


More information about the SAP-WUG mailing list