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