<br><font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">I have tried identifying and deleting
redundant workflow instances using a check function module but found it
unreliable - as pointed-out in a previous related post the workflows are
all created in the same LUW. &nbsp;I actually solved the problem by using
the FM </font><font size=2 color=#000080 face="Arial">SAP_WAPI_WORKITEMS_TO_OBJECT</font><font size=2 face="sans-serif">
as an initial step in the workflow template to identify duplicate instances
and then delete them (again described in an earlier post) and it worked
ok, although the overhead is that unecessary instances are created. &nbsp;If
you have control over the raising of the event then the terminating event
solution suggested seems promising.</font>
<br>
<br><font size=2 face="sans-serif">Karl Nietz<br>
 <br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>&quot;Holt, Pamela F&quot;
&lt;pholt@ncdot.gov&gt;</b> </font>
<br><font size=1 face="sans-serif">Sent by: sap-wug-bounces@mit.edu</font>
<p><font size=1 face="sans-serif">22/05/2009 07:54 AM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
&quot;SAP Workflow Users' Group&quot; &lt;sap-wug@mit.edu&gt;</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td><font size=1 face="sans-serif">&quot;'SAP Workflow Users' Group'&quot;
&lt;sap-wug@mit.edu&gt;</font>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td>
<tr valign=top>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td><font size=1 face="sans-serif">RE: Triggering Events for HR</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2 color=blue face="Arial">I have two solutions. </font>
<br><font size=3>&nbsp;</font>
<br><font size=2 color=blue face="Arial">First solution:</font>
<br><font size=2 color=blue face="Arial">1. Using a &quot;fork&quot; step,
put a &quot;wait for terminating event&quot; in your workflow (if you don't
already have one) that starts where the workflow starts and ends where
the workflow ends.</font>
<br><font size=2 color=blue face="Arial">2. In your program, raise the
terminating event right before you raise your triggering event. &nbsp;This
will terminate the workflow that is running. Follow the terminating event
with a COMMIT WORK AND WAIT, so that the workflow you are about to start
doesn't get terminated by mistake.</font>
<br><font size=2 color=blue face="Arial">3. Raise your triggering event.</font>
<br><font size=3>&nbsp;</font>
<br><font size=3>&nbsp;</font>
<br><font size=2 color=blue face="Arial">Second solution:</font>
<br><font size=2 color=blue face="Arial">If the workflow doesn't already
have a check function module, create one. Insert the following code into
the check function module. &nbsp;This will terminate the workflow that
is already running in the check function module, before the workflow actually
starts.</font>
<br><font size=3>&nbsp;</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; DATA: t_sww_contob
TYPE TABLE OF sww_contob WITH HEADER LINE. </font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; DATA: xswwwihead
&nbsp; TYPE TABLE OF swwwihead WITH HEADER LINE.</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; DATA: icount &nbsp;
&nbsp; &nbsp; TYPE i.</font>
<br><font size=1 color=blue face="Arial monospaced for SAP">&nbsp;</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; CLEAR: &nbsp; t_sww_contob.
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;look
for an active workflow</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; REFRESH: t_sww_contob.</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp;</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; SELECT * FROM &nbsp;
&nbsp; &nbsp; sww_contob</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;INTO TABLE t_sww_contob</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;WHERE &nbsp; &nbsp; &nbsp;objtype = '&lt;business_object_name&gt;'</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;AND &nbsp; &nbsp; &nbsp; &nbsp;objkey &nbsp;= objkey</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;AND &nbsp; &nbsp; &nbsp; &nbsp;element = '&lt;business_object_name&gt;’.</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp;</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; IF sy-subrc = 0.</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; DESCRIBE
TABLE t_sww_contob LINES icount.</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; IF icount
GT 0.</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; LOOP
AT t_sww_contob.</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
SELECT SINGLE * FROM &nbsp;swwwihead</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; INTO &nbsp;xswwwihead</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE wi_id = t_sww_contob-wi_id.</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp;</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
IF sy-subrc = 0. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &quot;an active workflow is found</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; IF xswwwihead-wi_stat = 'READY' &nbsp; &nbsp;OR</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;xswwwihead-wi_stat = 'WAITING' &nbsp;OR</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;xswwwihead-wi_stat = 'SELECTED' OR</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;xswwwihead-wi_stat = 'STARTED'.</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;RAISE &lt;exception&gt;.</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; ENDIF.</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; &nbsp;
ENDIF.</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp;</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; &nbsp; ENDLOOP.</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; &nbsp; ENDIF.</font>
<br><font size=1 face="Arial monospaced for SAP">&nbsp; ENDIF.</font>
<p><font size=3>&nbsp;</font>
<br><font size=2 color=blue face="Arial">The difference between the two
solutions is that the first solution will always keep the last workflow
that was started, while the second solution keeps the first one. But they
both terminate the workflow before it actually starts executing.</font>
<br><font size=3>&nbsp;</font>
<br><font size=2 color=blue face="Arial">Regards,</font>
<br><font size=2 color=blue face="Arial">Pam Holt</font>
<br><font size=2 color=blue face="Arial">NCDOT</font>
<br>
<br>
<hr><font size=2 face="Tahoma"><b>From:</b> sap-wug-bounces@mit.edu [</font><a href="mailto:sap-wug-bounces@mit.edu"><font size=2 face="Tahoma">mailto:sap-wug-bounces@mit.edu</font></a><font size=2 face="Tahoma">]
<b>On Behalf Of </b>lynne.allen@kodak.com<b><br>
Sent:</b> Thursday, May 21, 2009 11:54 AM<b><br>
To:</b> sap-wug@mit.edu<b><br>
Subject:</b> Triggering Events for HR</font><font size=3><br>
</font>
<br><font size=2 face="sans-serif"><br>
This is a very basic question....</font><font size=3> </font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp;When creating a recurring payment in HR, an SAP event of
CREATED (object recurrpay) &nbsp;is raised for each different wage type
used for an employee. <br>
 &nbsp; &nbsp;For instance, if there are 3 wage types, 3 events are raised
for the SAME employee. &nbsp;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.</font><font size=3>
</font><font size=2 face="sans-serif"><br>
 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.
&nbsp;Any thoughts on how this can be done without started the workflow
for each time?</font><font size=3> <br>
<br>
</font><font size=2 face="sans-serif"><br>
 &nbsp; &nbsp;</font>
<p><font size=1 color=#000080 face="Arial"><b>Lynne M. Allen</b></font><font size=1 face="Arial">
| ERP Workflow Development | Worldwide Information Systems (WWIS) | <br>
Eastman Kodak Company | 343 State Street | Rochester, NY 14650-1221 | </font><font size=3 color=blue><u><br>
</u></font><a href=mailto:lynne.allen@kodak.com><font size=1 color=blue face="Arial"><u>lynne.allen@kodak.com</u></font></a><font size=1 face="Arial">
| 585-724-3556 Office | </font><font size=3 color=blue><u><br>
</u></font><a href=http://www.kodak.com/><font size=1 color=blue face="Arial"><u>www.kodak.com</u></font></a><font size=1 face="Arial">
</font><font size=3><br>
</font><img src=cid:_1_07F1BDF007F1B584000A97E4CA2575BE>
<p><font size=3><br>
</font>
<hr><font size=1 color=#808080 face="Arial">Email correspondence to and
from this sender is subject to the N.C. Public Records Law and may be disclosed
to third parties.</font><tt><font size=2>_______________________________________________<br>
SAP-WUG mailing list<br>
SAP-WUG@mit.edu<br>
</font></tt><a href="http://mailman.mit.edu/mailman/listinfo/sap-wug"><tt><font size=2>http://mailman.mit.edu/mailman/listinfo/sap-wug</font></tt></a><tt><font size=2><br>
</font></tt>
<p>