<?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: Custom transaction lock in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298378#M1725945</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you must use the range number : trans. SNRO &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and after used the function : NUMBER_GET_NEXT&amp;nbsp; ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you will find a lot of example, codes, ... with the function name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Mar 2013 09:24:37 GMT</pubDate>
    <dc:creator>FredericGirod</dc:creator>
    <dc:date>2013-03-08T09:24:37Z</dc:date>
    <item>
      <title>Custom transaction lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298375#M1725942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have created a custom transaction and custom tables to update the changes. Everytime a user creates a new entry in the transaction a new request number is updated in the custom table.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;When two users at a time login to create a new request in the transaction and press the save button, then same request number is created for both of them and the system is not incrementing the request numbers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TO explain it simple, we need it to be like a sale order. Any no. of users can login to VA01 and on pressing save simultaneously, the system&lt;/P&gt;&lt;P&gt;increments the sale order number by one. I would like a similar lock on this as well. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can some one give me an idea pls?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 07:18:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298375#M1725942</guid>
      <dc:creator>former_member182337</dc:creator>
      <dc:date>2013-03-08T07:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: Custom transaction lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298376#M1725943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use lock on Custom tables before updating in program. use&amp;nbsp; &lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;ENQUEUE_E_TABLE to lock before update and &lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;DEQUEUE_E_TABLE&lt;/SPAN&gt; to unlock after update.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;Hope this helps.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px; background-color: #ffffff;"&gt;-SS-&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 09:13:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298376#M1725943</guid>
      <dc:creator>satyabrata_sahoo3</dc:creator>
      <dc:date>2013-03-08T09:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: Custom transaction lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298377#M1725944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prem,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can just get the request number as you are getting now,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but when updating check the request number again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the request number that needs to be entered is same as you have on the screen lock the table and update the record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;update the screen with the new request number and flash a message that the number has been updated/modifies with respect to the table entry.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 09:23:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298377#M1725944</guid>
      <dc:creator>former_member183073</dc:creator>
      <dc:date>2013-03-08T09:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Custom transaction lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298378#M1725945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you must use the range number : trans. SNRO &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and after used the function : NUMBER_GET_NEXT&amp;nbsp; ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you will find a lot of example, codes, ... with the function name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 09:24:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298378#M1725945</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2013-03-08T09:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Custom transaction lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298379#M1725946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You may not require actually a lock here but yes create one with your custom table to insure an user wont be able to modify the same record than another one;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you require is a range number :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Read some documentation like &lt;A href="https://help.sap.com/erp2005_ehp_06/helpdata/zh/48/d58f50982b424be10000000a421937/content.htm?frameset=/zh/48/d58f92982b424be10000000a421937/frameset.htm"&gt;Number Range&lt;/A&gt; at help.sap.com.&lt;/LI&gt;&lt;LI&gt;Manage object and range via SNRO transaction.&lt;/LI&gt;&lt;LI&gt;In your program use NUMBER_GET_NEXT and don't forget COMMIT-WORK.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Also use search tool on &lt;A href="http://search.sap.com/ui/scn#query=range+number"&gt;range number&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 09:30:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298379#M1725946</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2013-03-08T09:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Custom transaction lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298380#M1725947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prem,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could u pls tell me how you create the New request Number .Please provide ur code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think u have to do this after Creating the Number Range in TCODE - SNRO than u have to use the FM - &lt;SPAN class="st"&gt;&lt;EM&gt;NUMBER_GET_NEXT to get the next Number.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="st"&gt;&lt;EM&gt;i think it will solve ur problem.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="st"&gt;&lt;EM&gt;Thanks&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="st"&gt;&lt;EM&gt;tarak&lt;BR /&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 09:34:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298380#M1725947</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2013-03-08T09:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Custom transaction lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298381#M1725948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 10:04:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298381#M1725948</guid>
      <dc:creator>former_member182337</dc:creator>
      <dc:date>2013-03-08T10:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Custom transaction lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298382#M1725949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case you're not already doing so, to manage the number increment for your primary key you'd best use a Number Range Object.&lt;/P&gt;&lt;P&gt;So go to TCODE SNRO, create a NO Range Object and an Interval.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before a user saves the data in your Z table, call FM NUMBER_GET_NEXT. This should not fail in case two users hit SAVE button at the same time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then as to the locking issue, you should first create a lock object in tcode SE11 for your table. Let's call it EZTEST. After you have created the lock object, SAP generates 2 FM: ENQUEUE_EZTEST and DEQUEUE_EZTEST. By using these 2 FM you can set a lock and unset it on your Z table with specific primary key(s) value(s).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to check if a certain lock has been set on your Z table use FM: ENQUEUE_READ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's probably more to say on this subject, but perhaps the info I gave you will give you a first glance on what you should/can do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Br,&lt;/P&gt;&lt;P&gt;Andrei&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Mar 2013 10:24:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298382#M1725949</guid>
      <dc:creator>former_member184675</dc:creator>
      <dc:date>2013-03-08T10:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Custom transaction lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298383#M1725950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to all for your replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If locking and unlocking is the way to fix this then i will follow the same. I do not maintain any number range,just increment the request number by one from the database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@ Andrei - "Before a user saves the data in your Z table, call FM NUMBER_GET_NEXT. This should not fail in case two users hit SAVE button at the same time."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you mean to say then by using this FM i do not need to lock and unlock the table ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Mar 2013 15:12:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298383#M1725950</guid>
      <dc:creator>former_member182337</dc:creator>
      <dc:date>2013-03-10T15:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Custom transaction lock</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298384#M1725951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kinda yes. Correct me if i'm wrong, but you don't actually need to lock the table in Insert because you're only problem is the uniqueness of the primary key.&lt;/P&gt;&lt;P&gt;By using Number Ranges and the above mentioned FM you can guarantee that two users will never get the same primary key value and that, if I'm not mistaken, solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;Andrei&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 11:08:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/custom-transaction-lock/m-p/9298384#M1725951</guid>
      <dc:creator>former_member184675</dc:creator>
      <dc:date>2013-03-11T11:08:53Z</dc:date>
    </item>
  </channel>
</rss>

