<font size=2 face="sans-serif">One other thing to consider - if the two
events are being generated in a very short timeframe, and you're using
the event queue to deliver the event, you may wish to revise using the
event queue (if you get low volumes of these events), or look at the event
queue table if Susan's check on a workflow existence fails (just to ensure
there's not one in the queue waiting to be created). &nbsp;Not sure if
there's a WAPI to check this, but it's table SWEQUEUE for reference.</font>
<br>
<br><font size=2 face="sans-serif">Best Regards,<br>
James Johnson<br>
<br>
E-mail:JJohnson@uk.ibm.com<br>
Mobile: 07908715224 or 07920870270</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">&quot;Keohan, Susan
- 1140 - MITLL&quot; &lt;keohan@ll.mit.edu&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">&quot;SAP Workflow
Users' Group&quot; &lt;sap-wug@mit.edu&gt;, </font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">01/10/2013 20:48</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">RE: [RMX:WL]
Re: Check Function Module - how to stop duplicate WF &nbsp; &nbsp; &nbsp;
&nbsp;trigger</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Sent by: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">sap-wug-bounces@mit.edu</font>
<br>
<hr noshade>
<br>
<br>
<br><font size=3 face="Times New Roman">Creating a Check Function is one
way to go, but be sure to use WAPI’s – don’t read directly against workflow
system tables please.</font>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br><font size=1 face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CALL
FUNCTION 'SAP_WAPI_WORKITEMS_TO_OBJECT'</font>
<br><font size=1 face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
EXPORTING</font>
<br><font size=1 color=blue face="Courier New">*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
OBJECT_POR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
=</font>
<br><font size=1 face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
objtype&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
= ‘yourobject’</font>
<br><font size=1 face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
objkey&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
= l_objnr&nbsp;&nbsp; “ Object key</font>
<br><font size=1 color=blue face="Courier New">*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
TOP_LEVEL_ITEMS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
'X'</font>
<br><font size=1 face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
selection_status_variant = 0001</font>
<br><font size=1 face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
TABLES</font>
<br><font size=1 color=blue face="Courier New">*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
TASK_FILTER&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
=</font>
<br><font size=1 face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
worklist&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
= it_worklist</font>
<br><font size=1 color=blue face="Courier New">*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MESSAGE_LINES&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=</font>
<br><font size=1 color=blue face="Courier New">*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MESSAGE_STRUCT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
=</font>
<br><font size=1 face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
.</font>
<br><font size=1 face="Courier New">&nbsp;</font>
<br><font size=1 face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DESCRIBE
TABLE it_worklist LINES l_lines.</font>
<br><font size=1 face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF l_lines
&lt;&gt; 0.</font>
<br><font size=1 face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
RAISE no_workflow.</font>
<br><font size=1 face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENDIF.</font>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br><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>Prakashreddy Sabbu<b><br>
Sent:</b> Tuesday, October 01, 2013 11:17 AM<b><br>
To:</b> SAP Workflow Users' Group<b><br>
Subject:</b> RE: [RMX:WL] Re: Check Function Module - how to stop duplicate
WF trigger</font>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br><font size=2 face="Tahoma">Hi Karsten,</font>
<br><font size=2 face="Tahoma">Follow the below steps that would help.</font>
<br><font size=2 face="Tahoma">&nbsp;</font>
<br><font size=2 face="Tahoma">Right now the issue is becuase of triggering
the Create event twice for the same document.</font>
<br><font size=2 face="Tahoma">&nbsp;</font>
<br><font size=2 face="Tahoma">Create a function module which is to read
the entries from SWWIHEAD table with workflow template number , Task number
(Task Number you can say the User decision or the first step in the workflow)
and the document number (Workflow Instance). If the entry does already
exists the workflow should not trigger for the second time.</font>
<br><font size=2 face="Tahoma">&nbsp;</font>
<br><font size=2 face="Tahoma">Assing this function module as Check Fucntion
module in event linkage table (SWETYPV) which can stop the reciver fucntion
module to trigger the workflow for the second time.</font>
<br><font size=2 face="Tahoma">&nbsp;</font>
<br><font size=2 face="Tahoma">Thanks,</font>
<br><font size=2 face="Tahoma">Prakash S.</font>
<div align=center>
<hr></div>
<br><font size=2 face="Tahoma"><b>From:</b> </font><a href="mailto:sap-wug-bounces@mit.edu"><font size=2 color=blue face="Tahoma"><u>sap-wug-bounces@mit.edu</u></font></a><font size=2 face="Tahoma">
[sap-wug-bounces@mit.edu] on behalf of Ernst, Karsten [Karsten.Ernst@fhp-ww.com]<b><br>
Sent:</b> Tuesday, October 01, 2013 1:22 PM<b><br>
To:</b> SAP Workflow Users' Group<b><br>
Subject:</b> RE: [RMX:WL] Re: Check Function Module - how to stop duplicate
WF trigger</font>
<br><font size=2 color=#004080 face="Calibri">Hi Sheldon,</font>
<br><font size=2 color=#004080 face="Calibri">thanks for the hint with
the note and especially the SWEC.</font>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br><font size=2 color=#004080 face="Calibri">Currently we only have set
the flag for CREATE in the respective object.</font>
<br><img src=cid:_4_0E979BDC0E979970006FCA7A80257BF7>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br><font size=2 color=#004080 face="Calibri">Nevertheless the system issues
the event after a change to the PO as well.</font>
<br><font size=2 color=#004080 face="Calibri">What we do is the following.</font>
<br><font size=2 color=#004080 face="Calibri">After the &nbsp;creation
of a purchase requisition of a certain scenario we call a function module
which transfers the purch.requistion into a PO using FM 'BAPI_PO_CREATE1'.
</font>
<br><font size=2 color=#004080 face="Calibri">For some cases we need to
do some adjustments to the just created PO and we do this after the document
is available on the database using FM 'BAPI_PO_CHANGE'. Unfortunately the
adjustment we need to do is not possible to be set in the initial CREATE
step.</font>
<br><font size=2 color=#004080 face="Calibri">And it looks like the 'BAPI_PO_CHANGE'
is causing the system to create another BUS2012.RELEASESTEPCREATED event.
In my opinion this should not happen according to the setup in SWEC .</font>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br><font size=2 color=#004080 face="Calibri">Any ideas??</font>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br><font size=2 color=#004080 face="Calibri">Best regards</font>
<br><font size=2 color=#004080 face="Calibri">Karsten</font>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br><font size=2 face="Tahoma"><b>From:</b> </font><a href="mailto:sap-wug-bounces@mit.edu"><font size=2 color=blue face="Tahoma"><u>sap-wug-bounces@mit.edu</u></font></a><font size=2 face="Tahoma">
[</font><a href="mailto:sap-wug-bounces@mit.edu"><font size=2 color=blue face="Tahoma"><u>mailto:sap-wug-bounces@mit.edu</u></font></a><font size=2 face="Tahoma">]
<b>On Behalf Of </b>Sheldon Oxenberg<b><br>
Sent:</b> Monday, September 30, 2013 4:56 PM<b><br>
To:</b> SAP Workflow Users' Group<b><br>
Subject:</b> [RMX:WL] Re: Check Function Module - how to stop duplicate
WF trigger</font>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br><font size=2 face="Arial">Hi Karsten,</font><font size=3 face="Times New Roman"><br>
</font><font size=2 face="Arial"><br>
I believe many of us have encountered this before. &nbsp;You may need to
remove config in Transaction SWEC.<br>
Please review SAP Note 797775, and you can search the internet, for example,
&quot;SAP bus2012 releasestepcreated event&quot;<br>
<br>
Regards,<br>
Sheldon Oxenberg<br>
CSC</font><font size=3 face="Times New Roman"><br>
<br>
<br>
</font><img src=cid:_1_0E97D25C0E97CE38006FCA7A80257BF7 alt="Inactive hide details for &quot;Ernst, Karsten&quot; ---09/30/2013 10:35:51 AM---Hi everybody, I have quite a strange but interesting que"><font size=2 color=#424282 face="Arial">&quot;Ernst,
Karsten&quot; ---09/30/2013 10:35:51 AM---Hi everybody, I have quite a
strange but interesting question I think to the experts in the group.</font><font size=3 face="Times New Roman"><br>
</font><font size=1 color=#5f5f5f face="Arial"><br>
From: </font><font size=1 face="Arial">&quot;Ernst, Karsten&quot; &lt;</font><a href="mailto:Karsten.Ernst@fhp-ww.com" target=_blank><font size=1 color=blue face="Arial"><u>Karsten.Ernst@fhp-ww.com</u></font></a><font size=1 face="Arial">&gt;</font><font size=1 color=#5f5f5f face="Arial"><br>
To: </font><font size=1 face="Arial">&quot;</font><a href="mailto:sap-wug@mit.edu" target=_blank><font size=1 color=blue face="Arial"><u>sap-wug@mit.edu</u></font></a><font size=1 face="Arial">&quot;
&lt;</font><a href="mailto:sap-wug@mit.edu" target=_blank><font size=1 color=blue face="Arial"><u>sap-wug@mit.edu</u></font></a><font size=1 face="Arial">&gt;</font><font size=1 color=#5f5f5f face="Arial"><br>
Date: </font><font size=1 face="Arial">09/30/2013 10:35 AM</font><font size=1 color=#5f5f5f face="Arial"><br>
Subject: </font><font size=1 face="Arial">Check Function Module - how to
stop duplicate WF trigger</font><font size=1 color=#5f5f5f face="Arial"><br>
Sent by: </font><a href="mailto:sap-wug-bounces@mit.edu" target=_blank><font size=1 color=blue face="Arial"><u>sap-wug-bounces@mit.edu</u></font></a>
<br>
<hr noshade>
<br><font size=3 face="Times New Roman"><br>
<br>
</font><font size=2 face="Calibri"><br>
Hi everybody,<br>
 <br>
I have quite a strange but interesting question I think to the experts
in the group.<br>
Due to the pre-processing setup the PO event BUS2012.RELEASESTEPCREATED
is issues twice for the same object (same PO) within seconds.<br>
We see no chance to prevent the double triggering of the event and this
should not be the discussion here.<br>
What I am looking for is your help on how to implement a Check Function
Module to be integrated in the Event Type Linkage.<br>
I would like to determine if there is already an active WF instance available
for the current PO number (should be the object key of the event) and if
this is the case the event should raise an exception and should not trigger
the WF to start.<br>
If possible it might be could to check the WF Number / Receiver Type (WS9…)
as well.<br>
 <br>
As I have limited knowledge on how to implement this and especially on
how to check for the active 1<sup>st</sup> instance of the workflow for
the current object, any hint or code snippet is highly appreciated.<br>
 <br>
Best regards<br>
Karsten<br>
 </font><font size=3 color=#808080 face="Calibri"><br>
Karsten Ernst</font><font size=1 color=#808080 face="Calibri"><br>
 <b><br>
Freudenberg Home and Cleaning Solutions GmbH </b><br>
Supply Chain Management Systems and Processes<br>
 <br>
Mail: &nbsp; &nbsp; </font><a href="mailto:Karsten.Ernst@fhp-ww.com" target=_blank><font size=1 color=blue face="Calibri"><u>Karsten.Ernst@fhp-ww.com</u></font></a><font size=2 face="Calibri"><br>
 </font><font size=3 face="Times New Roman">&nbsp;</font>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<br>
<hr>
<br><font size=1 color=#808080 face="Arial">Freudenberg Home and Cleaning
Solutions GmbH<br>
Im Technologiepark 19, D-69469 Weinheim<br>
<br>
Geschäftsführer: Dr. Klaus Peter Meier, Arndt Miersch, Frank Reuther<br>
Sitz der Gesellschaft: Weinheim, Amtsgericht Mannheim HRB 431930</font><font size=2 face="Courier New">_______________________________________________<br>
SAP-WUG mailing list</font><font size=2 color=blue face="Courier New"><u><br>
</u></font><a href="mailto:SAP-WUG@mit.edu" target=_blank><font size=2 color=blue face="Courier New"><u>SAP-WUG@mit.edu</u></font></a><font size=2 color=blue face="Courier New"><u><br>
</u></font><a href="http://mailman.mit.edu/mailman/listinfo/sap-wug" target=_blank><font size=2 color=blue face="Courier New"><u>http://mailman.mit.edu/mailman/listinfo/sap-wug</u></font></a>
<br><font size=3 face="Times New Roman">&nbsp;</font>
<div align=center>
<hr></div>
<br><font size=1 color=#808080 face="Arial">Freudenberg Home and Cleaning
Solutions GmbH<br>
Im Technologiepark 19, D-69469 Weinheim<br>
<br>
Geschäftsführer: Dr. Klaus Peter Meier, Arndt Miersch, Frank Reuther<br>
Sitz der Gesellschaft: Weinheim, Amtsgericht Mannheim HRB 431930[attachment
&quot;smime.p7s&quot; deleted by James Johnson/UK/IBM] </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>
<br><font size=2 face="sans-serif"><br>
Unless stated otherwise above:<br>
IBM United Kingdom Limited - Registered in England and Wales with number
741598. <br>
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6
3AU<br>
</font>