<?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: Concurrency when inserting in the same table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/concurrency-when-inserting-in-the-same-table/m-p/10292102#M1832998</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As SAP applications are accessed by many end users at same time, SAP has concept called LOCKING of particular tables involved in the transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can achieve your requirement as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;UL&gt;
&lt;LI&gt;Go to t-code SE11, and create a lock object for your Ztable&lt;/LI&gt;
&lt;LI&gt;Now, system create 2 function modules - 1 for locking ENQUEUE_* &amp;amp; other for un-locking DEQUEUE_*&amp;nbsp; ( search for function module in SE37 )&lt;/LI&gt;
&lt;LI&gt;Before saving data to ZTABLE, call function module ENQUEUE_* to lock the table for writing data, if locking fails, means there is somebody already working on it, hence you can display error message&lt;/LI&gt;
&lt;LI&gt;After Save action, you can unlock the table by using FM ... DEQUEUE_*&lt;/LI&gt;
&lt;/UL&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Note: you can lock and unlock event during DISPLAY/CHANGE mode if your requirement requires.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rama&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Apr 2014 08:28:52 GMT</pubDate>
    <dc:creator>ramakrishnappa</dc:creator>
    <dc:date>2014-04-23T08:28:52Z</dc:date>
    <item>
      <title>Concurrency when inserting in the same table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/concurrency-when-inserting-in-the-same-table/m-p/10292097#M1832993</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;I have a report used by several users and in this record there is a sentence to insert in a z table. My question is, what happens whether two or more users are inserting records in that table at the same time?&amp;nbsp; There is a concurrency problem, isn't there?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How does SAP manage this issue? or, what must I do in this case?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 06:31:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/concurrency-when-inserting-in-the-same-table/m-p/10292097#M1832993</guid>
      <dc:creator>former_member254358</dc:creator>
      <dc:date>2014-04-23T06:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrency when inserting in the same table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/concurrency-when-inserting-in-the-same-table/m-p/10292098#M1832994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please search about Enqueue and Dequeue funtion modules.&lt;/P&gt;&lt;P&gt;There is a Lock Mechanism that you can put in place to avoid data inconsistency issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a lot of information on SCN/web.&lt;/P&gt;&lt;P&gt;Please get back for specific doubts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;DN.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 06:37:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/concurrency-when-inserting-in-the-same-table/m-p/10292098#M1832994</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-04-23T06:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrency when inserting in the same table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/concurrency-when-inserting-in-the-same-table/m-p/10292099#M1832995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply and your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each time that a user run the report only one record is inserted in the z table. My doubt is what could happen if two users try to insert at the same time? Have I to manage this one or not?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 06:52:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/concurrency-when-inserting-in-the-same-table/m-p/10292099#M1832995</guid>
      <dc:creator>former_member254358</dc:creator>
      <dc:date>2014-04-23T06:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrency when inserting in the same table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/concurrency-when-inserting-in-the-same-table/m-p/10292100#M1832996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm" title="http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/7b/f9813712f7434be10000009b38f8cf/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04s/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/content.htm" title="http://help.sap.com/saphelp_nw04s/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/content.htm"&gt;The SAP Lock Concept (SAP Library - ABAP Programming (BC-ABA))&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 11.818181991577148px; color: #333333; background: #ffffff;"&gt;Regards,&lt;/P&gt;&lt;P style="font-size: 11.818181991577148px; color: #333333; background: #ffffff;"&gt;DN.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 06:57:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/concurrency-when-inserting-in-the-same-table/m-p/10292100#M1832996</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-04-23T06:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrency when inserting in the same table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/concurrency-when-inserting-in-the-same-table/m-p/10292101#M1832997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;Place a lock before inserting data into table with specified key. Do, insert operation and then release the lock on the specified key table.&lt;/P&gt;&lt;P&gt;In case, more than one user tries to insert same data with same key, then only one user able to insert data and another will get lock.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 08:04:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/concurrency-when-inserting-in-the-same-table/m-p/10292101#M1832997</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-04-23T08:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Concurrency when inserting in the same table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/concurrency-when-inserting-in-the-same-table/m-p/10292102#M1832998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As SAP applications are accessed by many end users at same time, SAP has concept called LOCKING of particular tables involved in the transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can achieve your requirement as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;UL&gt;
&lt;LI&gt;Go to t-code SE11, and create a lock object for your Ztable&lt;/LI&gt;
&lt;LI&gt;Now, system create 2 function modules - 1 for locking ENQUEUE_* &amp;amp; other for un-locking DEQUEUE_*&amp;nbsp; ( search for function module in SE37 )&lt;/LI&gt;
&lt;LI&gt;Before saving data to ZTABLE, call function module ENQUEUE_* to lock the table for writing data, if locking fails, means there is somebody already working on it, hence you can display error message&lt;/LI&gt;
&lt;LI&gt;After Save action, you can unlock the table by using FM ... DEQUEUE_*&lt;/LI&gt;
&lt;/UL&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Note: you can lock and unlock event during DISPLAY/CHANGE mode if your requirement requires.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rama&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2014 08:28:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/concurrency-when-inserting-in-the-same-table/m-p/10292102#M1832998</guid>
      <dc:creator>ramakrishnappa</dc:creator>
      <dc:date>2014-04-23T08:28:52Z</dc:date>
    </item>
  </channel>
</rss>

