Triggering Events for HR (Arghadip Kar)

arghadip kar arghadipkar at yahoo.com
Wed May 27 05:51:46 EDT 2009


Hi
 
You get the Completed instance also if you select the SELECTION_STATUS_VARIANT as 0000. By default it is 0001.
 

Thanks

Arghadip Kar

SAP Workflow Expert

IBM INDIA

--- On Wed, 5/27/09, sap-wug-request at mit.edu <sap-wug-request at mit.edu> wrote:


From: sap-wug-request at mit.edu <sap-wug-request at mit.edu>
Subject: SAP-WUG Digest, Vol 54, Issue 31
To: sap-wug at mit.edu
Date: Wednesday, May 27, 2009, 12:14 AM


Send SAP-WUG mailing list submissions to
    sap-wug at mit.edu

To subscribe or unsubscribe via the World Wide Web, visit
    http://mailman.mit.edu/mailman/listinfo/sap-wug
or, via email, send a message with subject or body 'help' to
    sap-wug-request at mit.edu

You can reach the person managing the list at
    sap-wug-owner at mit.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of SAP-WUG digest..."


Today's Topics:

   1. RE: Triggering Events for HR (lynne.allen at kodak.com)
   2. RE: Triggering Events for HR (Sue Doughty)


----------------------------------------------------------------------

Message: 1
Date: Tue, 26 May 2009 13:46:54 -0400
From: lynne.allen at kodak.com
Subject: RE: Triggering Events for HR
To: "SAP Workflow Users' Group" <sap-wug at mit.edu>
Message-ID:
    <OFE1C3B571.1477687B-ON852575C2.005FECBE-852575C2.0061ADBC at knotes.kodak.com>
    
Content-Type: text/plain; charset="us-ascii"

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 | 585-724-3556 Office | 
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

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 | 585-724-3556 Office | 
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/170dbac6/attachment-0001.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 826 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20090526/170dbac6/attachment-0002.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 826 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20090526/170dbac6/attachment-0003.gif

------------------------------

Message: 2
Date: Tue, 26 May 2009 14:43:42 -0400
From: "Sue Doughty" <Sue.Doughty at odfl.com>
Subject: RE: Triggering Events for HR
To: "SAP Workflow Users' Group" <sap-wug at mit.edu>
Message-ID:
    <082C942F46528B44B5463D3C2A1FF0F41C06A1B7 at corp-m-exch2.corp.odfl.com>
Content-Type: text/plain; charset="us-ascii"

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

------------------------------

_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug


End of SAP-WUG Digest, Vol 54, Issue 31
***************************************



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20090527/575936ea/attachment.htm


More information about the SAP-WUG mailing list