<div>Hi All</div>
<div> </div>
<div>Please analyse what release code is getting passed for each event. Ideally it should be different. Please let us know.</div>
<div> </div>
<div>Thanks</div>
<div>Arghadip</div>
<div class="gmail_quote">On Tue, Oct 1, 2013 at 3:21 PM, James Johnson <span dir="ltr">&lt;<a href="mailto:JJOHNSON@uk.ibm.com" target="_blank">JJOHNSON@uk.ibm.com</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote"><font face="sans-serif">One other thing to consider - if the two events are being generated in a very short timeframe, and you&#39;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&#39;s check on a workflow existence fails (just to ensure there&#39;s not one in the queue waiting to be created).  Not sure if there&#39;s a WAPI to check this, but it&#39;s table SWEQUEUE for reference.</font> <br>
<br><font face="sans-serif">Best Regards,<br>James Johnson<br><br><a href="mailto:E-mail%3AJJohnson@uk.ibm.com" target="_blank">E-mail:JJohnson@uk.ibm.com</a><br>Mobile: 07908715224 or 07920870270</font> <br><br><br><br><font color="#5f5f5f" size="1" face="sans-serif">From:        </font><font size="1" face="sans-serif">&quot;Keohan, Susan - 1140 - MITLL&quot; &lt;<a href="mailto:keohan@ll.mit.edu" target="_blank">keohan@ll.mit.edu</a>&gt;</font> <br>
<font color="#5f5f5f" size="1" face="sans-serif">To:        </font><font size="1" face="sans-serif">&quot;SAP Workflow Users&#39; Group&quot; &lt;<a href="mailto:sap-wug@mit.edu" target="_blank">sap-wug@mit.edu</a>&gt;, </font><br>
<font color="#5f5f5f" size="1" face="sans-serif">Date:        </font><font size="1" face="sans-serif">01/10/2013 20:48</font> <br>
<div class="im"><font color="#5f5f5f" size="1" face="sans-serif">Subject:        </font><font size="1" face="sans-serif">RE: [RMX:WL] Re: Check Function Module - how to stop duplicate WF        trigger</font> <br></div><font color="#5f5f5f" size="1" face="sans-serif">Sent by:        </font><font size="1" face="sans-serif"><a href="mailto:sap-wug-bounces@mit.edu" target="_blank">sap-wug-bounces@mit.edu</a></font> <br>

<hr noshade>

<div>
<div class="h5"><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"> </font> <br>
<font size="1" face="Courier New">      CALL FUNCTION &#39;SAP_WAPI_WORKITEMS_TO_OBJECT&#39;</font> <br><font size="1" face="Courier New">        EXPORTING</font> <br><font color="blue" size="1" face="Courier New">*         OBJECT_POR               =</font> <br>
<font size="1" face="Courier New">          objtype                  = ‘yourobject’</font> <br><font size="1" face="Courier New">          objkey                   = l_objnr   “ Object key</font> <br><font color="blue" size="1" face="Courier New">*         TOP_LEVEL_ITEMS          = &#39;X&#39;</font> <br>
<font size="1" face="Courier New">          selection_status_variant = 0001</font> <br><font size="1" face="Courier New">        TABLES</font> <br><font color="blue" size="1" face="Courier New">*         TASK_FILTER              =</font> <br>
<font size="1" face="Courier New">          worklist                 = it_worklist</font> <br><font color="blue" size="1" face="Courier New">*         MESSAGE_LINES            =</font> <br><font color="blue" size="1" face="Courier New">*         MESSAGE_STRUCT           =</font> <br>
<font size="1" face="Courier New">        .</font> <br><font size="1" face="Courier New"> </font> <br><font size="1" face="Courier New">      DESCRIBE TABLE it_worklist LINES l_lines.</font> <br><font size="1" face="Courier New">      IF l_lines &lt;&gt; 0.</font> <br>
<font size="1" face="Courier New">        RAISE no_workflow.</font> <br><font size="1" face="Courier New">      ENDIF.</font> <br><font size="3" face="Times New Roman"> </font> <br><font face="Tahoma"><b>From:</b> <a href="mailto:sap-wug-bounces@mit.edu" target="_blank">sap-wug-bounces@mit.edu</a> [</font><a href="mailto:sap-wug-bounces@mit.edu" target="_blank"><font face="Tahoma">mailto:sap-wug-bounces@mit.edu</font></a><font 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&#39; 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"> </font> <br>
<font face="Tahoma">Hi Karsten,</font> <br><font face="Tahoma">Follow the below steps that would help.</font> <br><font face="Tahoma"> </font> <br><font face="Tahoma">Right now the issue is becuase of triggering the Create event twice for the same document.</font> <br>
<font face="Tahoma"> </font> <br><font 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 face="Tahoma"> </font> <br><font 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 face="Tahoma"> </font> <br><font face="Tahoma">Thanks,</font> <br><font face="Tahoma">Prakash S.</font> 
<div align="center">
<hr>
</div><br><font face="Tahoma"><b>From:</b> </font><a href="mailto:sap-wug-bounces@mit.edu" target="_blank"><font color="blue" face="Tahoma"><u>sap-wug-bounces@mit.edu</u></font></a><font face="Tahoma"> [<a href="mailto:sap-wug-bounces@mit.edu" target="_blank">sap-wug-bounces@mit.edu</a>] on behalf of Ernst, Karsten [<a href="mailto:Karsten.Ernst@fhp-ww.com" target="_blank">Karsten.Ernst@fhp-ww.com</a>]<b><br>
Sent:</b> Tuesday, October 01, 2013 1:22 PM<b><br>To:</b> SAP Workflow Users&#39; Group<b><br>Subject:</b> RE: [RMX:WL] Re: Check Function Module - how to stop duplicate WF trigger</font> <br><font color="#004080" face="Calibri">Hi Sheldon,</font> <br>
<font color="#004080" face="Calibri">thanks for the hint with the note and especially the SWEC.</font> <br><font size="3" face="Times New Roman"> </font> <br><font 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"> </font> <br><font color="#004080" face="Calibri">Nevertheless the system issues the event after a change to the PO as well.</font> <br>
<font color="#004080" face="Calibri">What we do is the following.</font> <br><font color="#004080" face="Calibri">After the  creation of a purchase requisition of a certain scenario we call a function module which transfers the purch.requistion into a PO using FM &#39;BAPI_PO_CREATE1&#39;. </font><br>
<font 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 &#39;BAPI_PO_CHANGE&#39;. Unfortunately the adjustment we need to do is not possible to be set in the initial CREATE step.</font> <br>
<font color="#004080" face="Calibri">And it looks like the &#39;BAPI_PO_CHANGE&#39; 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"> </font> <br><font color="#004080" face="Calibri">Any ideas??</font> <br><font size="3" face="Times New Roman"> </font> <br><font color="#004080" face="Calibri">Best regards</font> <br>
<font color="#004080" face="Calibri">Karsten</font> <br><font size="3" face="Times New Roman"> </font> <br><font size="3" face="Times New Roman"> </font> <br><font face="Tahoma"><b>From:</b> </font><a href="mailto:sap-wug-bounces@mit.edu" target="_blank"><font color="blue" face="Tahoma"><u>sap-wug-bounces@mit.edu</u></font></a><font face="Tahoma"> [</font><a href="mailto:sap-wug-bounces@mit.edu" target="_blank"><font color="blue" face="Tahoma"><u>mailto:sap-wug-bounces@mit.edu</u></font></a><font 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&#39; 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"> </font> <br>
<font face="Arial">Hi Karsten,</font><font size="3" face="Times New Roman"><br></font><font face="Arial"><br>I believe many of us have encountered this before.  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 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" src="cid:_1_0E97D25C0E97CE38006FCA7A80257BF7"><font 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 color="#5f5f5f" size="1" 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 color="blue" size="1" face="Arial"><u>Karsten.Ernst@fhp-ww.com</u></font></a><font size="1" face="Arial">&gt;</font><font color="#5f5f5f" size="1" face="Arial"><br>
To: </font><font size="1" face="Arial">&quot;</font><a href="mailto:sap-wug@mit.edu" target="_blank"><font color="blue" size="1" 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 color="blue" size="1" face="Arial"><u>sap-wug@mit.edu</u></font></a><font size="1" face="Arial">&gt;</font><font color="#5f5f5f" size="1" face="Arial"><br>
Date: </font><font size="1" face="Arial">09/30/2013 10:35 AM</font><font color="#5f5f5f" size="1" face="Arial"><br>Subject: </font><font size="1" face="Arial">Check Function Module - how to stop duplicate WF trigger</font><font color="#5f5f5f" size="1" face="Arial"><br>
Sent by: </font><a href="mailto:sap-wug-bounces@mit.edu" target="_blank"><font color="blue" size="1" 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 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 color="#808080" size="3" face="Calibri"><br>Karsten Ernst</font><font color="#808080" size="1" face="Calibri"><br><b><br>Freudenberg Home and Cleaning Solutions GmbH </b><br>Supply Chain Management Systems and Processes<br>
<br>Mail:     </font><a href="mailto:Karsten.Ernst@fhp-ww.com" target="_blank"><font color="blue" size="1" face="Calibri"><u>Karsten.Ernst@fhp-ww.com</u></font></a><font face="Calibri"><br></font><font size="3" face="Times New Roman"> </font> <br>
<font size="3" face="Times New Roman"> </font> <br>
<hr>
<br><font color="#808080" size="1" 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 face="Courier New">_______________________________________________<br>
SAP-WUG mailing list</font><font color="blue" face="Courier New"><u><br></u></font><a href="mailto:SAP-WUG@mit.edu" target="_blank"><font color="blue" face="Courier New"><u>SAP-WUG@mit.edu</u></font></a><font color="blue" face="Courier New"><u><br>
</u></font><a href="http://mailman.mit.edu/mailman/listinfo/sap-wug" target="_blank"><font 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"> </font> 
<div align="center">
<hr>
</div><br></div></div><font color="#808080" size="1" face="Arial">
<div>
<div class="h5">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></div></div>Sitz der Gesellschaft: Weinheim, Amtsgericht Mannheim HRB 431930[attachment &quot;smime.p7s&quot; deleted by James Johnson/UK/IBM] </font><tt><font>_______________________________________________<br>
SAP-WUG mailing list<br><a href="mailto:SAP-WUG@mit.edu" target="_blank">SAP-WUG@mit.edu</a><br></font></tt><a href="http://mailman.mit.edu/mailman/listinfo/sap-wug" target="_blank"><tt><font>http://mailman.mit.edu/mailman/listinfo/sap-wug</font></tt></a><tt><font><br>
</font></tt><br><font 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><br>_______________________________________________<br>SAP-WUG mailing list<br><a href="mailto:SAP-WUG@mit.edu">SAP-WUG@mit.edu</a><br><a href="http://mailman.mit.edu/mailman/listinfo/sap-wug" target="_blank">http://mailman.mit.edu/mailman/listinfo/sap-wug</a><br>
<br></blockquote></div><br>