<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
<BR>Hi,<BR>
&nbsp;<BR>
No doubt, of course,&nbsp;you've&nbsp;checked your event linkages and made sure you only have 1 Receiver active for the event&nbsp;(seen that happen a lot because of test linkages on delegated objects). An event trace might show up multiple linkages if you can risk turning SWELS on for a bit.<BR>
&nbsp;<BR>
Assuming you have, this sounds like a issue with the standard SAP&nbsp;HR code being triggered twice synchronously and&nbsp;processed faster than the WAPI can read the database.<BR>
&nbsp;<BR>
We sometimes see this on high volume systems where COMMIT WORK statements (executed implicitly inside the code) aren't quite enough and you really need COMMIT WORK AND WAIT statements in the code (which SAP don't do that often).<BR>
&nbsp;<BR>
As a test you could implement a simple check Function Module against your event linkage in SWETYPV and put a break-point inside it and see when and how the event is triggered by the transaction. You might just spot a loop or something, unless the event is being issued asynchronously.<BR>
&nbsp;<BR>
Perhaps by&nbsp;using the event queue you could introduce a small enough&nbsp;delay to&nbsp;give the database more time to update the tables so that the WAPI has more of a chance to find the record, but seeing as the events are likely to be published in the same LUW I doubt it would help that much.<BR>
&nbsp;<BR>
If it is a SAP problem you might want to abandon the SAP event altogether (unless they provide a fix) and publish your own single event in a suitable exit somewhere. Sometimes SAP insist on raising multiple events during a session because that's the way they want to model the outcome of that LUW, so the multiple events you are seeing may actually be what they intend to happen rather than be down to a bug. In which case the event might not be the most appropriate way to trigger your Workflow.<BR>
&nbsp;<BR>
MGT<BR>
<BLOCKQUOTE>
<HR>
To: sap-wug@mit.edu<BR>Subject: Re: BUS1065 HIRED Event<BR>From: cristiana.dagosto@au1.ibm.com<BR>Date: Wed, 30 Jan 2008 11:40:54 +1100<BR><BR><BR><FONT face=sans-serif size=2>Hi Carmen,</FONT> <BR><BR><FONT face=sans-serif size=2>the HIRED event is published from Infotype 0001 (</FONT><FONT face=Arial size=2>Function Module HR_EVENT_RULES_PA0001).</FONT> <BR><BR><FONT face=Arial size=2>I have seen the event being published twice when the position that you are hiring your employee has more than one relationship with different Org Units e.g.</FONT> <BR><BR><FONT face=Arial size=2>position 50000000</FONT> <BR><BR><FONT face=Arial size=2>01.01.2007 - 14.02.2008 belongs to Org Unit 50000001</FONT> <BR><FONT face=Arial size=2>15.02.2008 - 31.12.9999 belongs to Org Unit 50000999</FONT> <BR><BR><FONT face=Arial size=2>If you hire an employee to this position on the 10.02.2008, the event will be published twice because the system will create 2 infotypes 0001 for this employee.</FONT> <BR><BR><FONT face=Arial size=2>I think an OSS should be raised so SAP can fix the way HIRED is published.</FONT> <BR><BR><FONT face=Arial size=2>Alternatively, you can try to 'play' with function module HR_EVENT_RULES_PA0001 and code something to prevent the event being published twice?</FONT> <BR><BR><FONT face=Arial size=2>I hope this helps.</FONT> <BR><BR><FONT face=sans-serif size=2>Good luck!<BR><BR>Cristiana<BR>_________________________________<BR>Cristiana d'Agosto<BR>IBM Global Business Services<BR>Mobile: &nbsp;+61 417 927 224<BR>cristiana.dagosto@au1.ibm.com</FONT> <BR><BR><BR>
<TABLE width="100%">
<TBODY>
<TR vAlign=top>
<TD width="40%"><FONT face=sans-serif size=1><B>"Carmen Cheung" &lt;carmen.cheung@roc-group.com&gt;</B> </FONT><BR><FONT face=sans-serif size=1>Sent by: sap-wug-bounces@mit.edu</FONT> 
<FONT face=sans-serif size=1>30/01/2008 08:49 AM</FONT> 
<TABLE border=1>
<TBODY>
<TR vAlign=top>
<TD bgColor=white>
<DIV align=center><FONT face=sans-serif size=1>Please respond to<BR>"SAP Workflow Users' Group" &lt;sap-wug@mit.edu&gt;</FONT></DIV></TD></TR></TBODY></TABLE><BR><BR>
<TD width="59%">
<TABLE width="100%">
<TBODY>
<TR vAlign=top>
<TD>
<DIV align=right><FONT face=sans-serif size=1>To</FONT></DIV>
<TD><FONT face=sans-serif size=1>&lt;sap-wug@mit.edu&gt;</FONT> 
<TR vAlign=top>
<TD>
<DIV align=right><FONT face=sans-serif size=1>cc</FONT></DIV>
<TD>
<TR vAlign=top>
<TD>
<DIV align=right><FONT face=sans-serif size=1>Subject</FONT></DIV>
<TD><FONT face=sans-serif size=1>BUS1065 HIRED Event</FONT></TD></TR></TBODY></TABLE><BR>
<TABLE>
<TBODY>
<TR vAlign=top>
<TD>
<TD></TD></TR></TBODY></TABLE><BR></TD></TR></TBODY></TABLE><BR><BR><BR><FONT face=Arial size=2>Hi All,</FONT> <BR><FONT face=Arial size=2>&nbsp;</FONT> <BR><FONT face=Arial size=2>I’m creating a notification workflow for when a new employee is hired (PA40) in R/3 4.7, using triggering event HIRED for BUS1065. </FONT><BR><FONT face=Arial size=2>&nbsp;</FONT> <BR><FONT face=Arial size=2>The actual workflow is going fine, but the triggering event is being published twice in the system. I have tried to use the function module SAP_WAPI_WORKITEMS_TO_OBJECT to check if a workflow is already active and ensure the workflow is only triggered once, but to no avail.</FONT> <BR><FONT face=Arial size=2>&nbsp;</FONT> <BR><FONT face=Arial size=2>I have also tried triggering my own event to a delegate object and entered the configuration in SWEHR3. This also published duplicate events.</FONT> <BR><FONT face=Arial size=2>&nbsp;</FONT> <BR><FONT face=Arial size=2>Is there anyway to stop the duplicate event being triggered? </FONT><BR><FONT face=Arial size=2>&nbsp;</FONT> <BR><FONT face=Arial size=2>Really appreciate any ideas.</FONT> <BR><FONT face=Arial size=2>&nbsp;</FONT> <BR><FONT face=Arial size=2>Many thanks,</FONT> <BR><FONT face=Arial size=2>&nbsp;</FONT> <BR><FONT face=Arial size=2>Carmen </FONT><BR><FONT face=Arial size=2>&nbsp;</FONT> <BR><FONT face=Arial size=2>&nbsp;</FONT> <BR><FONT face=Arial size=2>&nbsp;_______________________________________________<BR>SAP-WUG mailing list<BR>SAP-WUG@mit.edu<BR>http://mailman.mit.edu/mailman/listinfo/sap-wug<BR></FONT><BR></BLOCKQUOTE><br /><hr />Everything in one place… <a href='http://www.windowslive.co.uk/get-live' target='_new'>All new Windows Live!</a></body>
</html>