<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Enqueue with multiple secondary tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341151#M1397487</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sandra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.  Happy ABAP-ing!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Oct 2009 13:11:30 GMT</pubDate>
    <dc:creator>kurt_slater3</dc:creator>
    <dc:date>2009-10-27T13:11:30Z</dc:date>
    <item>
      <title>Enqueue with multiple secondary tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341141#M1397477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have an enqueue object that locks one primary table and several related secondary tables.  When I call the FM using the key of the primary table I notice that I cannot open any secondary table record in change mode in an alternative transaction.  It's as if each secondary table has been entirely locked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was expecting that only those records in any secondary table whose foreign key matches the key of the primary table would be locked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I lock only the set of related records based on the key of the primary table without having to loop at each related secondary table record and locking these in turn?  I mean, I know I could do this, but is that really the only way?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How does SAP manage this problem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2009 15:14:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341141#M1397477</guid>
      <dc:creator>kurt_slater3</dc:creator>
      <dc:date>2009-10-21T15:14:59Z</dc:date>
    </item>
    <item>
      <title>Re: Enqueue with multiple secondary tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341142#M1397478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the tables are configured in a way that they are key each other - It should lock only those records that you passed as key.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2009 20:44:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341142#M1397478</guid>
      <dc:creator>former_member191735</dc:creator>
      <dc:date>2009-10-21T20:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Enqueue with multiple secondary tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341143#M1397479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If by "configured" you mean I am using foreign key relationships, then yes.  This is why I'm a little confused as to why the FM appears to be locking the entire table for all secondary tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's what I'm trying to do.  Suppose I have 3 tables.  There is a 1:n relationship between Table 1 -&amp;gt; Table 2 and Table 1 -&amp;gt; Table 3.  Table 1 has 2 records; Table 2 and 3 have 3 records each.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 1&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;&lt;P&gt;B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 2&lt;/P&gt;&lt;P&gt;XA&lt;/P&gt;&lt;P&gt;YA&lt;/P&gt;&lt;P&gt;ZB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table 3&lt;/P&gt;&lt;P&gt;EA&lt;/P&gt;&lt;P&gt;FA&lt;/P&gt;&lt;P&gt;GB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tables 2 and 3 are defined as secondary tables in the lock object.  So if I request a table lock for record A using the first lock object, then I should be able to request a record lock for ZB in Table 2 using another lock object, but this is not happening.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Oct 2009 21:16:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341143#M1397479</guid>
      <dc:creator>kurt_slater3</dc:creator>
      <dc:date>2009-10-21T21:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Enqueue with multiple secondary tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341144#M1397480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, so I think I solved this myself.  There are three lock objects in this example.  The first lock object is defined with Table 1 as the primary table and Table 2 &amp;amp; Table 3 as secondary tables.  The second and third lock objects are defined to lock entries in Table 2 and Table 3 respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I want to use one FM call to lock all associated A records in Table 1, Table 2 and Table 3 then I pass an '*' for the remaining key field parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now another user can use a separate transaction to lock, say, GB in Table 3 without creating a lock conflict.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2009 21:25:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341144#M1397480</guid>
      <dc:creator>kurt_slater3</dc:creator>
      <dc:date>2009-10-22T21:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Enqueue with multiple secondary tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341145#M1397481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After more testing, it appears the asterisk doesn't work after all!  So back to square one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the problem again.  I have a lock object with one primary table and several secondary tables.  When I call the FM it appears to lock the entire contents of each secondary table - not just those records that are related by the foreign key which is what I want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I have to loop at each secondary table where the foreign key = primary key of the primary table and lock each record individually??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a better way?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Oct 2009 18:57:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341145#M1397481</guid>
      <dc:creator>kurt_slater3</dc:creator>
      <dc:date>2009-10-23T18:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: Enqueue with multiple secondary tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341146#M1397482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the conditions -&amp;gt; [sap library - Lock objects - Conditions Required of Foreign Keys|http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21eecc446011d189700000e8322d00/frameset.htm]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Oct 2009 21:31:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341146#M1397482</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2009-10-24T21:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Enqueue with multiple secondary tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341147#M1397483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the link.  To the best of my knowledge, my lock object satisfies all 4 conditions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 17:25:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341147#M1397483</guid>
      <dc:creator>kurt_slater3</dc:creator>
      <dc:date>2009-10-26T17:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Enqueue with multiple secondary tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341148#M1397484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have made a little test on my 7.0 SP13 system, it works well. You should do the same, create objects &lt;STRONG&gt;from scratch&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;- 2 tables (table 1 with mandt + key1 and table 2 with mandt + key2 + key1 + foreign key on key1 which points to table 1 key1 field),&lt;/P&gt;&lt;P&gt;- 2 lock objects from scratch (lock1 on table 1 and table 2, and lock2 on table 2 only; both lock objects have exclusive lock),&lt;/P&gt;&lt;P&gt;- 2 programs  (prog1 which locks lock1, and prog2 which  locks lock2)&lt;/P&gt;&lt;P&gt;Run them parallely, prog1 first (with wait) then prog2. This last should return an error unable to lock table 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the locks WORK correctly, then try to complexify the test up to the original complexity, until you understand what is different between the 2 cases.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sandra Rossi on Oct 26, 2009 7:02 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 18:01:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341148#M1397484</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2009-10-26T18:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Enqueue with multiple secondary tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341149#M1397485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sandra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ok, so I created the tables and locks from scratch.  The only thing I did differently was to run the enqueue FM's via SM37 so I don't have to create 2 new test programs.  I am still getting the same results as before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my dummy Table T1 (key = ZF1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ZF1    |    ZF2    |   ZF3       &lt;/P&gt;&lt;P&gt;                                &lt;/P&gt;&lt;P&gt;0001   |    A      |    AA     &lt;/P&gt;&lt;P&gt;0002   |    B      |   BB    &lt;/P&gt;&lt;P&gt;0003   |    C      |   CC    &lt;/P&gt;&lt;P&gt;0004   |    D      |   DD  &lt;/P&gt;&lt;P&gt;0005   |    E       |   EE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is my dummy Table T2 (key = ZF4 + ZF1; FK = ZF1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                                    &lt;/P&gt;&lt;P&gt; ZF4     |   ZF1      |    ZF5        &lt;/P&gt;&lt;P&gt;                                    &lt;/P&gt;&lt;P&gt; 2001    |   0001    |     AA         &lt;/P&gt;&lt;P&gt; 2002    |   0001    |     AB         &lt;/P&gt;&lt;P&gt; 2003   |    0002    |     AC         &lt;/P&gt;&lt;P&gt; 2004    |   0001    |     AD         &lt;/P&gt;&lt;P&gt; 2005    |   0003    |     AE         &lt;/P&gt;&lt;P&gt; 2006    |   0004    |     AF         &lt;/P&gt;&lt;P&gt; 2006    |   0005    |     AG         &lt;/P&gt;&lt;P&gt; 2007    |   0005    |     AH         &lt;/P&gt;&lt;P&gt;                                    &lt;/P&gt;&lt;P&gt;There are also 2 enqueue FM's.  E1 locks T1 &amp;amp; T2; E2 locks only T2.  When I execute E1 where T1-ZF1 = 0001 I expect that the foreign key relationship in T2 would mean I also lock T2 where ZF4 = 2001, 2002 and 2004.  Yet for example, when I execute E2 with T2-ZF4 = 2007 in another session this triggers a lock conflict.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only way I can request a successful lock on T2 when I have already called E1 is to fully qualify all of the E2 FM parameters.  For example, if I call the E2 where T2-ZF4 = 2007 and T2-ZF1 = 0005 then the request is Ok.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Oct 2009 19:31:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341149#M1397485</guid>
      <dc:creator>kurt_slater3</dc:creator>
      <dc:date>2009-10-26T19:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Enqueue with multiple secondary tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341150#M1397486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; There are also 2 enqueue FM's.  E1 locks T1 &amp;amp; T2; E2 locks only T2.  When I execute E1 where T1-ZF1 = 0001 I expect that the foreign key relationship in T2 would mean I also lock T2 where ZF4 = 2001, 2002 and 2004.  Yet for example, when I execute E2 with T2-ZF4 = 2007 in another session this triggers a lock conflict.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; The only way I can request a successful lock on T2 when I have already called E1 is to fully qualify all of the E2 FM parameters.  For example, if I call the E2 where T2-ZF4 = 2007 and T2-ZF1 = 0005 then the request is Ok.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand what you mean, but SAP doesn't work like that. When you lock E1-ZF1 = 0001, it locks T1-ZF1 = 0001 and T2-ZF1 = 0001. If you try to lock any value in any other field then it will always succeed. My test was only about locking E1-ZF1 = 0001 then E2-ZF1 = 0001, the last fails because T2-ZF1 is already locked because of E1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2009 09:35:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341150#M1397486</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2009-10-27T09:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Enqueue with multiple secondary tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341151#M1397487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sandra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help.  Happy ABAP-ing!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Oct 2009 13:11:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enqueue-with-multiple-secondary-tables/m-p/6341151#M1397487</guid>
      <dc:creator>kurt_slater3</dc:creator>
      <dc:date>2009-10-27T13:11:30Z</dc:date>
    </item>
  </channel>
</rss>

