<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1458" name=GENERATOR></HEAD>
<BODY id=role_body style="FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY: Arial"
bottomMargin=7 leftMargin=7 topMargin=7 rightMargin=7><FONT size=3>
<DIV dir=ltr><FONT face=Courier size=2><SPAN class=373591418-10102005>Hi
Ramki,</SPAN></FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2><SPAN
class=373591418-10102005></SPAN></FONT> </DIV>
<DIV dir=ltr><FONT face=Courier size=2><SPAN class=373591418-10102005>Here is
the code I want to put. However I also tested it using SWE_EVENT_CREATE with
values hardcoded.</SPAN></FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2></FONT> </DIV>
<DIV dir=ltr><SPAN class=373591418-10102005><FONT face=Courier
size=2>*************************************************</FONT></SPAN></DIV>
<DIV dir=ltr><FONT face=Courier size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Courier size=2>DATA: EVENT_RECEIVERS LIKE SWELOG OCCURS
2,</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2>TOTAL_RECEIVERS TYPE N.</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Courier size=2><SPAN class=373591418-10102005>*check if
there are any active recievers. (Since this is a change event we have receivers
in our approval workflow, </SPAN></FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2><SPAN class=373591418-10102005>*to cancel
if changed in between). So if no reciever that means no existing WF , trigger
'RELEASESTEPCREATED'.</SPAN></FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Courier size=2>CALL FUNCTION
'SWE_EVENT_GET_RECEIVERS'</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2>EXPORTING</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2>OBJTYPE = OBJTYPE</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2>OBJKEY = OBJKEY</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2>EVENT = EVENT
"AMD_CHANGED</FONT></DIV></FONT><FONT color=#0000ff size=3>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* CREATOR = '
'</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* TAKE_WORKITEM_REQUESTER
=</FONT></DIV></FONT><FONT size=3>
<DIV dir=ltr><FONT face=Courier size=2>TABLES</FONT></DIV></FONT><FONT
color=#0000ff size=3>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* EVENT_CONTAINER
=</FONT></DIV></FONT><FONT size=3>
<DIV dir=ltr><FONT face=Courier size=2>EVENT_RECEIVERS =
EVENT_RECEIVERS</FONT></DIV></FONT><FONT color=#0000ff size=3>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* RECEIVER_INFO
=</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* EXCEPTIONS</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* OBJTYPE_NOT_FOUND =
1</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* OTHERS =
2</FONT></DIV></FONT><FONT size=3>
<DIV dir=ltr><FONT face=Courier size=2>.</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2>IF SY-SUBRC = 0.</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Courier size=2>DESCRIBE TABLE EVENT_RECEIVERS LINES
TOTAL_RECEIVERS.</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Courier size=2>IF TOTAL_RECEIVERS =
0.</FONT></DIV></FONT><FONT size=3>
<DIV dir=ltr><FONT face=Courier></FONT> </DIV>
<DIV dir=ltr><FONT face=Courier size=2>CALL FUNCTION
'SWE_EVENT_CREATE'</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2>EXPORTING</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2>OBJTYPE = OBJTYPE</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2>OBJKEY = OBJKEY</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2>EVENT = 'RELEASESTEPCREATED'</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2>CREATOR =
SY-UNAME</FONT></DIV></FONT><FONT color=#0000ff size=3>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* TAKE_WORKITEM_REQUESTER =
' '</FONT></DIV></FONT><FONT size=3>
<DIV dir=ltr><FONT face=Courier><FONT size=2><SPAN
class=373591418-10102005> </SPAN>START_WITH_DELAY = <SPAN
class=373591418-10102005>'X'</SPAN></FONT></FONT></DIV></FONT><FONT
color=#0000ff size=3>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* START_RECFB_SYNCHRON = '
'</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* NO_COMMIT_FOR_QUEUE = '
'</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* DEBUG_FLAG = '
'</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* NO_LOGGING = '
'</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* IDENT =</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* IMPORTING</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* EVENT_ID =</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* TABLES</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* EVENT_CONTAINER
=</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* EXCEPTIONS</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* OBJTYPE_NOT_FOUND =
1</FONT></DIV>
<DIV dir=ltr><FONT face=Courier color=#000000 size=2>* OTHERS =
2</FONT></DIV></FONT><FONT size=3>
<DIV dir=ltr><FONT face=Courier size=2>.</FONT></DIV></FONT><FONT color=#0000ff
size=3>
<DIV dir=ltr><FONT face=Courier><FONT color=#000000><FONT
size=2></FONT></FONT></FONT> </DIV></FONT><FONT size=3>
<DIV dir=ltr><FONT face=Courier size=2>ENDIF.</FONT></DIV>
<DIV dir=ltr><FONT face=Courier size=2>ENDIF.</FONT></DIV></FONT>
<DIV dir=ltr><FONT face=Courier>*<SPAN
class=373591418-10102005>**********************************</SPAN></FONT></DIV>
<DIV dir=ltr><FONT face=Courier><SPAN
class=373591418-10102005></SPAN></FONT> </DIV>
<DIV dir=ltr><FONT face=Courier><SPAN
class=373591418-10102005>Regards</SPAN></FONT></DIV>
<DIV dir=ltr><FONT face=Courier><SPAN
class=373591418-10102005>Manish</SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma><B>From:</B> sap-wug-bounces@mit.edu
[mailto:sap-wug-bounces@mit.edu] <B>On Behalf Of
</B>Workflow99@aol.com<BR><B>Sent:</B> Saturday, October 08, 2005 4:21
PM<BR><B>To:</B> sap-wug@mit.edu<BR><B>Subject:</B> Re: Checkfunction in
SWEC/SWEINST<BR></FONT><BR></DIV>
<DIV></DIV><FONT id=role_document face=Arial color=#000000>
<DIV>
<DIV>
<DIV>
<DIV>Hi Manish,</DIV>
<DIV> </DIV>
<DIV>1) The Event function module assigned in SWEC is called everytime the
specified change takes place. It is not necessary that the event have a
receiver. A Check function module is assigned to a Event - Receiver
combinationin in SWETYPV and it does not get executed unless the event linkage
is active.</DIV>
<DIV> </DIV>
<DIV>2)</DIV>
<DIV> a) The Event FM is called in the update module and it is possible
that locks are not released until all the updates are completed. </DIV>
<DIV> b) I did come across a similar situation for one of my BOs - but it
was an SAP bug. I circumvented the problem by using a check in my
event FM.</DIV>
<DIV> </DIV>
<DIV>Perhaps, I can help more if you can post the code of yor FM.</DIV>
<DIV> </DIV>
<DIV><FONT lang=0 face=Arial PTSIZE="10" FAMILY="SANSSERIF">Regards,<BR>Ramki
Maley<BR>Workflow Developer, USCBP.<BR>248-613-1287 (C)</FONT></DIV></DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>In a message dated 10/8/2005 3:09:58 PM Eastern Standard Time,
manish.khanna@amd.com writes:</DIV>
<BLOCKQUOTE style="PADDING-LEFT: 0px; MARGIN-LEFT: 0px"><FONT
style="BACKGROUND-COLOR: transparent" face=Arial color=#000000>
<DIV><SPAN class=323465018-08102005><FONT face=Arial
color=#0000ff>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial color=#0000ff>Now that I
have realized that consignment documents cannot have release strategy and our
requirement is to trigger an approval workflow when a consignment
document is "changed" I thought of the following.</FONT></SPAN></DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial color=#0000ff>1. Create a
check function.</FONT></SPAN></DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial color=#0000ff>2. Attach
it (in SWEC) to change object EINKBELEG / BUS2013 / On Change /
Changed(event in BUS2013)</FONT></SPAN></DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial color=#0000ff>3. The
check function triggers BUS2013/'RELEASESTEPCREATED'
event.</FONT></SPAN></DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial color=#0000ff>Now this
seems to be a solution, but its not working.</FONT></SPAN></DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial color=#0000ff>Why ??
</FONT></SPAN><SPAN class=323465018-08102005><FONT face=Arial
color=#0000ff>Because</FONT></SPAN></DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial color=#0000ff>1. It seems
that the check function is not called every time. After some analysis it seems
that if BUS2013/CHANGED does not have a receiver, it does not calls the check
function. Don't know if this is correct.</FONT></SPAN></DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial color=#0000ff>2. When it
is called </FONT></SPAN></DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial color=#0000ff> a)
The database locks on EINK, EKPO etc are not released (strange
!!!)</FONT></SPAN></DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial color=#0000ff> b)
sometimes 2 RELEASESTEPCREATED are triggered.</FONT></SPAN></DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial color=#0000ff>Any ideas
or tips ??</FONT></SPAN></DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial
color=#0000ff></FONT></SPAN> </DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial
color=#0000ff>Thanks</FONT></SPAN></DIV>
<DIV><SPAN class=323465018-08102005><FONT face=Arial
color=#0000ff>Manish</FONT></SPAN></DIV><BR><BR>_______________________________________________<BR>SAP-WUG
mailing
list<BR>SAP-WUG@mit.edu<BR>http://mailman.mit.edu/mailman/listinfo/sap-wug<BR></FONT></BLOCKQUOTE></DIV>
<DIV></DIV></DIV></FONT></BODY></HTML>