<P>Greg,</P>
<P>since you are in a new release, can't you use the workflow binding instructions?</P>
<P>Best regards,</P>
<P>Robert<BR>
<BR>
BergTop ICT <BR>
Tel. +31 (0) 6 46 39 36 49 <BR>
Email: robert@bergtop-ict.nl <BR>
Website: www.bergtop-ict.nl <BR>
LinkedIn: www.linkedin.com/in/robertvdberg <BR>
<BR>
<B>On Fri, 14 Mar 2008 12:36 , SAP@e-Wave &lt;sap@e-wavesolutions.com&gt; sent:<BR>
<BR>
</P></B>
<BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #5167c6 2px solid; MARGIN-RIGHT: 0px">Hi everyone. I am curious if anyone else has to update a main <BR>
workflow container whilst WITHIN a running workitem using <BR>
SAP_WAPI_WRITE_CONTAINER in ECC 6.0 <BR>
<BR>
So, whilst a workflow is executing, a step in the workflow is calling <BR>
a method of a 'z' object. This method needs to update an element in <BR>
the main workflow container (again, I can't pass it back via the <BR>
swc_set_element macro for various reasons, one being that the method <BR>
in production calls a function module that only has importing <BR>
parameters, not exporting, etc, etc, too late to change now as we have <BR>
thousands of existing workitems). <BR>
<BR>
I have done extensive testing an analysis and am quite stumped. <BR>
<BR>
You can call SAP_WAPI_WRITE_CONTAINER during the method (or, more <BR>
specifically, from an FM called from the method), but it won't update <BR>
the parent workflow container as it raises an exception (you can see <BR>
it in the step history for that workitem in the technical log): " <BR>
<BR>
Call of interface SAP_WAPI_WRITE_CONTAINER within the runtime system <BR>
not permitted" (this is message number SWF_RUN 624). <BR>
<BR>
If I look in the code of the WAPI, there is a specific check: <BR>
<BR>
IF lv_handle LE 0. <BR>
lv_excp = lh_wapi-&gt;get_last_exception( ). <BR>
return_code = 900. <BR>
RAISE EXCEPTION lv_excp. <BR>
ENDIF. <BR>
<BR>
If I copy this function module and comment these lines out, then all <BR>
works fine. What's also frustrating, is that this code snippet that <BR>
performs the check does not exist i 4.6 or 4.7, so it works there! <BR>
For some reason in 6.0, they have prevented the use of this WAPI to be <BR>
called during a running workitem. <BR>
<BR>
Now yes, I can write an ABAP that runs and updates the container <BR>
external to the workflow, but I need this to happen real time. <BR>
<BR>
I have even tried putting a wrapper FM around it and calling it in the <BR>
update task. It doesn't error out, but mysteriously just doesn't <BR>
update the container. <BR>
<BR>
Again, for a lot of technical reasons that I won't list, I can't just <BR>
use standard container binding, so it's a pretty unique case. <BR>
<BR>
Any help/thoughts from anyone would be greatly appreciated. <BR>
<BR>
Cheers, <BR>
Greg <BR>
<BR>
<BR>
_______________________________________________ <BR>
SAP-WUG mailing list <BR>
<A href="javascript:parent.opencompose('SAP-WUG@mit.edu','','','')">SAP-WUG@mit.edu</A> <BR>
<A href="modules/refer.pl?redirect=http%3A%2F%2Fmailman.mit.edu%2Fmailman%2Flistinfo%2Fsap-wug" target=_blank><FONT color=red>http://mailman.mit.edu/mailman/listinfo/sap-wug</FONT></A><BR>
</BLOCKQUOTE><BR>