<font face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size="2">Hi Rick,<br><br>I think this is where my workflow (lack of) knowledge is shown up - are you saying that when the workflow executes a work item, the workflow key used is in the XML container (SWWCNTP0)?&nbsp; If so this explains what's going on, and why our amendments haven't worked.&nbsp; And if this is the case, I think there's a potential solution in the form of using a FM such as SAP_WAPI_READ_CONTAINER and SAP_WAPI_WRITE_CONTAINER to check/amend the object key for each workflow of the type that's been affected, which should have the knock on effect of causing the container values to be updated.<br><span><br>Best Regards,<br>James Johnson<br><br><a class="moz-txt-link-abbreviated" href="mailto:E-mail:JJohnson@uk.ibm.com">E-mail:JJohnson@uk.ibm.com</a><br>Mobile: 07908715224 or 07920870270</span><br><br><font color="#990099">-----sap-wug-bounces@mit.edu wrote: -----</font><div><blockquote style="padding-right:0px;padding-left:5px;margin-left:5px;border-left:solid black 2px;margin-right:0px">To: "SAP Workflow Users' Group" <a class="moz-txt-link-rfc2396E" href="mailto:sap-wug@mit.edu">&lt;sap-wug@mit.edu&gt;</a><br>From: Rick Bakker <rbakker@gmail.com><br>Sent by: <a class="moz-txt-link-abbreviated" href="mailto:sap-wug-bounces@mit.edu">sap-wug-bounces@mit.edu</a><br>Date: 03/30/2012 11:32AM<br>Subject: Re: Interesting issue arising from changing a workflow key after the        workflow has started<br><br><font face="Courier New,Courier,monospace" size="2">Hi James,<br><br>This may seem a bit obvious but surely the old key is also stored in<br>the workflow container?<br>You did say this was for existing workflows. One of the relevant<br>tables is SWWCONTP0.<br>Changing that will be very difficult. I assume you know that changing<br>data in tables is truly a last resort.<br><br>regards<br>Rick Bakker<br>hanabi technology<br><br>On Fri, Mar 30, 2012 at 9:00 PM, James Johnson <a class="moz-txt-link-rfc2396E" href="mailto:JJOHNSON@uk.ibm.com">&lt;JJOHNSON@uk.ibm.com&gt;</a> wrote:<br>&gt; Dear experts,<br>&gt;<br>&gt; I have an interesting situation, and a curious issue which I can't seem to<br>&gt; find the cause of.&nbsp; I am working on a utilities project and experienced an<br>&gt; inital issue where particular workflows to change a customer's meter type<br>&gt; were created with duplicate keys.&nbsp; We have now amended the key for the<br>&gt; workflow to be unique, and this seems to have fixed the issue for new<br>&gt; workflows which are being created.&nbsp; Essentially, the previous key was a<br>&gt; customer's contract account number (12 characters), followed by a contract<br>&gt; account start date (8 characters).&nbsp; A customer could have a type of account<br>&gt; where both their gas/electricity had the same contract account number (but<br>&gt; individual contract numbers under the same contract account), which led to<br>&gt; the duplicate keys (and subsequent container data issues).&nbsp; The new key is a<br>&gt; contract account (12 characters), contract (10 characters), and division (2<br>&gt; characters, either 10 for electricity or 20 for gas).<br>&gt;<br>&gt; The curious issue that has now manifested itself is due to us needing to<br>&gt; also consider old workflows previously operating under the old key which are<br>&gt; still active in the system.&nbsp; We tried to account for this by writing a<br>&gt; program to update all relevant values of INSTID in table SWW_WI2OBJ, in<br>&gt; addition to amending all relevant entries of the OBJKEY field in table<br>&gt; SWFDEVINST.&nbsp; The entries have now all been updated, however we have now<br>&gt; observed an unfortunate side-effect of the update.&nbsp; The value for the<br>&gt; contract in the workflow container (which is supposed to be characters 13 to<br>&gt; 22 of the new key), is now populated by the old key's contract account start<br>&gt; date (which by no co-incidence used to be occupied by the contract account<br>&gt; start date in the old key format).&nbsp; This then means that the old workflows<br>&gt; fall over once they reach a step that requires them to use the contract (all<br>&gt; of them in fact).<br>&gt;<br>&gt; I think the relevant question to the group here is whether there is anywhere<br>&gt; else the workflow engine could be storing/retrieving the key from that is<br>&gt; being referenced/used to construct the object during operation, as it<br>&gt; appears that even though the key has been amended to the new one, the old<br>&gt; one is still persisting somewhere for it to be used by the workflow.<br>&gt; Hopefully the above information is enough to go on, I've avoided listing the<br>&gt; technical details of what i've coded the constructor/super class constructor<br>&gt; to do to avoid creating more detail than may be necessary, but I'm quite<br>&gt; happy to list anymore information that might help resolve this interesting<br>&gt; issue.<br>&gt;<br>&gt; Best Regards,<br>&gt; James Johnson<br>&gt; IBM<br>&gt;<br>&gt; <a class="moz-txt-link-abbreviated" href="mailto:E-mail:JJohnson@uk.ibm.com">E-mail:JJohnson@uk.ibm.com</a><br>&gt; Mobile: 07908715224 or 07920870270<br>&gt;<br>&gt;<br>&gt; ________________________________<br>&gt;<br>&gt;<br>&gt;<br>&gt; Unless stated otherwise above:<br>&gt; IBM United Kingdom Limited - Registered in England and Wales with number<br>&gt; 741598.<br>&gt; Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; SAP-WUG mailing list<br>&gt; <a class="moz-txt-link-abbreviated" href="mailto:SAP-WUG@mit.edu">SAP-WUG@mit.edu</a><br>&gt; <a href="http://mailman.mit.edu/mailman/listinfo/sap-wug">http://mailman.mit.edu/mailman/listinfo/sap-wug</a><br>&gt;<br><br>_______________________________________________<br>SAP-WUG mailing list<br><a class="moz-txt-link-abbreviated" href="mailto:SAP-WUG@mit.edu">SAP-WUG@mit.edu</a><br><a href="http://mailman.mit.edu/mailman/listinfo/sap-wug">http://mailman.mit.edu/mailman/listinfo/sap-wug</a><br><br></font></rbakker@gmail.com></blockquote></div><div><br><br><hr> <br><font size="2"><br><i><br><p>Unless stated otherwise above:<br>IBM United Kingdom Limited - Registered in England and Wales with number 741598. <br>Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU</p><br></i><br></font><br><br><br></div></font>