<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>
Hi Alon,<BR>
I try to always use a BDC function to create a new object rather than a BAPI.&nbsp; A BAPI, if it is not called as an RFC, required an explicit COMMIT WORK.&nbsp; It may be some defect in my understanding, but I am not a big fan of BAPIs for several reasons and this is just one of them.<BR>
&nbsp;<BR>
Regards,<BR>
Ed Diehl<BR><BR><BR>
<BLOCKQUOTE>
<HR>
Subject: Commit Work<BR>Date: Mon, 11 Jun 2007 17:09:57 -0400<BR>From: araskin@3i-consulting.com<BR>To: sap-wug@mit.edu<BR><BR>
<META content="Microsoft SafeHTML" name=Generator>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>A colleague of mine is having an issue and I wanted to see if anyone has seen this before. I have seen this issue creep up on different implementations so I am sure I am not the first to handle this.</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<UL dir=ltr>
<LI>
<DIV><FONT face=Arial size=2>Step 1 creates a new document (doesn't matter what it is, its IS-U) by calling a BAPI</FONT></DIV>
<LI>
<DIV><FONT face=Arial size=2>The BAPI returns the ID of the new object which can be seen in the container of the Workflow</FONT></DIV>
<LI>
<DIV><FONT face=Arial size=2>Step 2 then calls SYSTEM.GenericInstantiate to get an instance of the newly created document</FONT></DIV>
<LI>
<DIV><FONT face=Arial size=2>Step 2 errors claiming that the object does not exist.</FONT></DIV></LI></UL>
<FONT face=Arial size=2>I suggested to him to uncheck the Advance with Dialog step as I thought that this would 'force' the WF sub-system to do a COMMIT WORK between steps but this did not seem to work. I was sure that the Workflow sub-system always executes a COMMIT WORK between steps. Is that not the case? We did a test, and created a method where all it did was execute a COMMIT WORK. We inserted this step in between the BAPI and the System.GenericInstantiate and everything worked beautifully. So it is definitely a commit issue. Perhaps WF treats methods marked as BAPIs differently to standard methods and doesn't not do an explicit COMMIT WORK? If so, how do people get around this?</FONT><BR>
<FONT face=Arial size=2>Regards,</FONT><BR>
<DIV id=EC_idSignature31001 dir=ltr>
<DIV><FONT face=Arial color=#000000>
<DIV dir=ltr align=left><STRONG>
<DIV dir=ltr align=left><STRONG>
<DIV dir=ltr align=left><STRONG><FONT size=2>Alon Raskin</FONT></STRONG></DIV>
<DIV dir=ltr align=left></STRONG></STRONG></FONT>&nbsp;</DIV></DIV></DIV></DIV></DIV></BLOCKQUOTE></body>
</html>