<?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 ztable using function module or memory id in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-a-ztable-using-function-module-or-memory-id/m-p/5795235#M1310643</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am facing a problem in ALV grid output (editable) - when user editing and saving data into the ztable - other user should not able to save the data and error msg to be displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am using the function modules for locking the whole table - enqueue_eztable and dequeue_eztable. i can see the table as locked in sm12, but i can also do the updating and save data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there anyother function module to work with?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another way i am doing is - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: text4 TYPE c,
        text5 TYPE c.
  IMPORT text4 TO text5 FROM MEMORY ID 'Y222'.
  IF sy-subrc = 0.
    IF text5 = 'X'.
      MESSAGE e000(z1) WITH 'SOME USER IS ACCESSING THE PROGRAM'.
    ENDIF.
  ELSE.
    EXPORT text4 = 'X' TO MEMORY ID 'Y222'.
    PERFORM update_dbase.
    FREE MEMORY ID 'Y222'.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this method also not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz help me, how to avoid other user accessing the data when another user is working on it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jul 2009 05:48:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-07T05:48:30Z</dc:date>
    <item>
      <title>lock a ztable using function module or memory id</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-a-ztable-using-function-module-or-memory-id/m-p/5795235#M1310643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am facing a problem in ALV grid output (editable) - when user editing and saving data into the ztable - other user should not able to save the data and error msg to be displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i am using the function modules for locking the whole table - enqueue_eztable and dequeue_eztable. i can see the table as locked in sm12, but i can also do the updating and save data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there anyother function module to work with?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;another way i am doing is - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: text4 TYPE c,
        text5 TYPE c.
  IMPORT text4 TO text5 FROM MEMORY ID 'Y222'.
  IF sy-subrc = 0.
    IF text5 = 'X'.
      MESSAGE e000(z1) WITH 'SOME USER IS ACCESSING THE PROGRAM'.
    ENDIF.
  ELSE.
    EXPORT text4 = 'X' TO MEMORY ID 'Y222'.
    PERFORM update_dbase.
    FREE MEMORY ID 'Y222'.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this method also not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz help me, how to avoid other user accessing the data when another user is working on it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2009 05:48:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-a-ztable-using-function-module-or-memory-id/m-p/5795235#M1310643</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-07T05:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: lock a ztable using function module or memory id</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-a-ztable-using-function-module-or-memory-id/m-p/5795236#M1310644</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;Create lock object for the table and use below method&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Lock Table ZWMDASHBOARD&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    CALL FUNCTION 'ENQUEUE_EZWMDASHBOARD'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        mode_zwmdashboard = 'E'&lt;/P&gt;&lt;P&gt;        mandt             = sy-mandt&lt;/P&gt;&lt;P&gt;      EXCEPTIONS&lt;/P&gt;&lt;P&gt;        foreign_lock      = 1&lt;/P&gt;&lt;P&gt;        system_failure    = 2&lt;/P&gt;&lt;P&gt;        OTHERS            = 3.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      RAISE unable_to_lock.     " Exception&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Modify Table ZWMDASHBOARD.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      MODIFY zwmdashboard FROM TABLE t_zwmdashboard[].&lt;/P&gt;&lt;P&gt;      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Do Nothing&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    Unlock table ZWMDASHBOARD.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      CALL FUNCTION 'DEQUEUE_EZWMDASHBOARD'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          mode_zwmdashboard = 'E'&lt;/P&gt;&lt;P&gt;          mandt             = sy-mandt.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2009 05:55:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-a-ztable-using-function-module-or-memory-id/m-p/5795236#M1310644</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-07T05:55:04Z</dc:date>
    </item>
    <item>
      <title>Re: lock a ztable using function module or memory id</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-a-ztable-using-function-module-or-memory-id/m-p/5795237#M1310645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI, &lt;/P&gt;&lt;P&gt;   It is always better  to use ENQUEUE/DEQUEUE for locking/unlocking functionality &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to use the memory ID, you can use the below format &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IMPORT text4 TO text5 FROM MEMORY ID 'Y222'. (Here you will get values to text5 )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORT text4 FROM text5 TO MEMORY ID 'Y222'.  (Value of text5 will be stored to Memory ID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt; Seema&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Jul 2009 08:51:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-a-ztable-using-function-module-or-memory-id/m-p/5795237#M1310645</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-08T08:51:29Z</dc:date>
    </item>
  </channel>
</rss>

