<?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 Lock a Table for Test Case in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-a-table-for-test-case/m-p/2012600#M410936</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 read a little bit in the forum but didn't find exactly what I am looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a couple of test cases that change data using RFCs from Ruby.&lt;/P&gt;&lt;P&gt;Is there a way I can lock a particular table or field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my test case&lt;/P&gt;&lt;P&gt; - read ADDRESSDATA.HOUSE_NO from BAPI_BUPA_ADDRESS_GETDETAIL&lt;/P&gt;&lt;P&gt; - change ADDRESSDATA.HOUSE_NO&lt;/P&gt;&lt;P&gt; - assert if ADDRESSDATA.HOUSE_NO was changed&lt;/P&gt;&lt;P&gt; - change ADDRESSDATA.HOUSE_NO back to the previous value&lt;/P&gt;&lt;P&gt; - assert if re-change was performed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to prevent reading and writing the HOUSE_NO in between to avoid lost updates or dirty reads. What can I do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Mar 2007 22:00:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-19T22:00:54Z</dc:date>
    <item>
      <title>Lock a Table for Test Case</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-a-table-for-test-case/m-p/2012600#M410936</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 read a little bit in the forum but didn't find exactly what I am looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a couple of test cases that change data using RFCs from Ruby.&lt;/P&gt;&lt;P&gt;Is there a way I can lock a particular table or field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my test case&lt;/P&gt;&lt;P&gt; - read ADDRESSDATA.HOUSE_NO from BAPI_BUPA_ADDRESS_GETDETAIL&lt;/P&gt;&lt;P&gt; - change ADDRESSDATA.HOUSE_NO&lt;/P&gt;&lt;P&gt; - assert if ADDRESSDATA.HOUSE_NO was changed&lt;/P&gt;&lt;P&gt; - change ADDRESSDATA.HOUSE_NO back to the previous value&lt;/P&gt;&lt;P&gt; - assert if re-change was performed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to prevent reading and writing the HOUSE_NO in between to avoid lost updates or dirty reads. What can I do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 22:00:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-a-table-for-test-case/m-p/2012600#M410936</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T22:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Lock a Table for Test Case</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-a-table-for-test-case/m-p/2012601#M410937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;You can lock a table using FM:' ENQUEUE_E_TABLE' &amp;lt;b&amp;gt;or&amp;lt;/b&amp;gt; if you want to a particular record, then you need to find out the lock object and the corresponding FMs for that table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Example: To lock a reaord in PO item table EKPO ( Lock Object EMEKPOE), &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ENQUEUE_EMEKPOE'&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            ebeln = ls_ekpo-ebeln&lt;/P&gt;&lt;P&gt;            ebelp = ls_ekpo-ebelp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write your update statements&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        CALL FUNCTION 'DEQUEUE_EMEKPOE'&lt;/P&gt;&lt;P&gt;          EXPORTING&lt;/P&gt;&lt;P&gt;            ebeln = ls_ekpo-ebeln&lt;/P&gt;&lt;P&gt;            ebelp = ls_ekpo-ebelp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 22:24:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-a-table-for-test-case/m-p/2012601#M410937</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T22:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: Lock a Table for Test Case</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-a-table-for-test-case/m-p/2012602#M410938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chandra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use ENQUEUE_E_TABLE with the structure name as parameter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ENQUEUE_E_TABLE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;  TABNAME = "BAPIBUS1006_ADDRESS"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it gives me the following error from which I don't know if it is an ABAP error or generated by the Ruby saprfc library.&lt;/P&gt;&lt;P&gt;Error: TABLE_NOT_ACTIVE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Might that be because BAPIBUS1006_ADDRESS isn't a table but a structure?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a second parameter for this function, namely VARKEY, that many people are using. But I couldn't find out what to give as a value. Do you have any ideas on this one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where can I find out how the explicit enqueue function for my structure is called (I am talking about the equivalent to ENQUEUE_EMEKPOE)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Mar 2007 23:28:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-a-table-for-test-case/m-p/2012602#M410938</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-19T23:28:18Z</dc:date>
    </item>
  </channel>
</rss>

