<P>
Hi Kjetil,<BR>
<BR>
Do you want me to call this function module before the triggering&nbsp; event is published? <BR>
<BR>
If yes, then, I am afraid whether I can do that since the event is published by the standard program. Also for a moment even if I have control over publishing the event, how can I restart the same workitem?<BR>
<BR>
If no, then, will you please a bit more elaborate?<BR>
<BR>
I would definitely like to trigger as few workflows as possible since that would reduce my work :))<BR>
<BR>
Thanks &amp; Regards,<BR>
Amit<BR>
<BR>
<BR>
-------------------<BR>
It's a bit late I guess, but I would recommend using a check function instead. Then you prevent starting the second instance by looking for existing workflows related to your purchase order (function SAP_WAPI_WORKITEMS_TO_OBJECT). <BR>
 <BR>
The fewer workflows started, the better - unless your salary depends on the number of started workflows.<BR>
-- <BR>
Kjetil Kilhavn, Statoil KTJ IT BKS<BR>
 <BR>
<BR>
<BR>
________________________________<BR>
<BR>
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of Amit Moghe<BR>
Sent: 2. juni 2005 10:32<BR>
To: sap-wug at mit.edu<BR>
Subject: AW: Cancelling the previous workitem<BR>
<BR>
<BR>
<BR>
Hi Michael,<BR>
<BR>
&nbsp; Thanks a lot for the help. It works perfectly...&nbsp; <BR>
<BR>
Regards,<BR>
Amit<BR>
<BR>
--------<BR>
&nbsp; Hi Amit,<BR>
<BR>
&nbsp; You can built a parallel processing in Your workflow, which ends,&nbsp; <BR>
&nbsp; if one of the both branches is completed. One branch includes Your <BR>
&nbsp; current workflow and the other consits of a Wait Step , which waits <BR>
&nbsp; for the event 'CHANGED' of BUS2012.<BR>
<BR>
<BR>
&nbsp; Best regards<BR>
&nbsp; Michael Ludwig<BR>
&nbsp; rku.it GmbH<BR>
<BR>
&nbsp; &nbsp;  -----Ursprüngliche Nachricht-----<BR>
&nbsp; &nbsp;  Von: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] Im Auftrag von Amit Moghe<BR>
&nbsp; &nbsp;  Gesendet: Donnerstag, 2. Juni 2005 08:34<BR>
&nbsp; &nbsp;  An: sap-wug at mit.edu<BR>
&nbsp; &nbsp;  Cc: amitpmoghe at rediffmail.com<BR>
&nbsp; &nbsp;  Betreff: Cancelling the previous workitem<BR>
&nbsp; &nbsp;  <BR>
&nbsp; &nbsp;  <BR>
<BR>
&nbsp; &nbsp;  Hi Workflow Gurus,<BR>
&nbsp; &nbsp;  <BR>
&nbsp; &nbsp;  I am new to workflow and need some help.<BR>
&nbsp; &nbsp;  <BR>
&nbsp; &nbsp;  I have a workflow for which I am using 'CHANGED' event of the business object BUS2012 (Purchase Order) as the triggering event. When a user changes a particular PO, this workflow starts. But before it is completed if there is another change to the same PO, then, one more workitem is started.<BR>
&nbsp; &nbsp;  <BR>
&nbsp; &nbsp;  My requirement is that if there is change to the PO, then, it should delete the previous workitem and start a new workitem. Can you please advise me as to how this can be achieved?<BR>
&nbsp; &nbsp;  <BR>
&nbsp; &nbsp;  Thanks in advance.<BR>
&nbsp; &nbsp;  <BR>
&nbsp; &nbsp;  Regards,<BR>
&nbsp; &nbsp;  Amit<BR>
<BR>
&nbsp; <BR>

</P>


<br><br>
<A target="_blank" HREF="http://clients.rediff.com/signature/track_sig.asp"><IMG SRC="http://ads.rediff.com/RealMedia/ads/adstream_nx.cgi/www.rediffmail.com/inbox.htm@Bottom" BORDER=0 VSPACE=0 HSPACE=0></a>