<?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: Record level locking in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/record-level-locking/m-p/1543757#M247498</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;SAP provides you with the ability to restrict access to data while the table is being updated. This is fairly &lt;/P&gt;&lt;P&gt;simple to implement via the use of a lock object . Create the Lock Object in SE11 for that table, if that already exist then use that one..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add the following code in-order to create the table lock. This function module must be called before any &lt;/P&gt;&lt;P&gt;update takes place. If a lock has already been taken out it will display the appropriate message. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  CALL FUNCTION 'ENQUEUE_EZ_ZTABLENAME'
      EXPORTING
           mode_ZTABLENAME = 'E'
           mandt              = sy-mandt
           KEYFIELD1           = "Value
           KEYFIELD2           = "Value
           KEYFIELD3           = "Value
                   ... 
*         X_KEYFIELD1            = ' '
*         X_KEYFIELD2            = ' '
*         X_KEYFIELD3            = ' '
                   ... 
*         _SCOPE             = '2'
*         _WAIT              = ' '
*         _COLLECT           = ' '
*   If exceptions are not used, message is displayed within FM
    EXCEPTIONS
         FOREIGN_LOCK       = 1
         SYSTEM_FAILURE     = 2
         OTHERS             = 3.
             
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   Retrieve message displayed within Function Module
    message id     sy-msgid
              type   'I'
              number sy-msgno
              with   sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    EXIT.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code will remove the lock for the specific table entries.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DEQUEUE_EZ_ZTABLENAME'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;         MODE_ZTABLENAME = 'E'&lt;/P&gt;&lt;P&gt;         MANDT              = SY-MANDT&lt;/P&gt;&lt;P&gt;           mandt              = sy-mandt&lt;/P&gt;&lt;P&gt;           KEYFIELD1           = "Value&lt;/P&gt;&lt;P&gt;           KEYFIELD2           = "Value&lt;/P&gt;&lt;P&gt;           KEYFIELD3           = "Value&lt;/P&gt;&lt;P&gt;                   ... &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        X_KEYFIELD1            = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        X_KEYFIELD2            = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        X_KEYFIELD3            = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                   ...&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        _SCOPE             = '3'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        _SYNCHRON          = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        _COLLECT           = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;releasing the lock is mandatory, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the link for more info.&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/41/7af4c8a79e11d1950f0000e82de14a/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/41/7af4c8a79e11d1950f0000e82de14a/content.htm&lt;/A&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;Sudheer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 Sep 2006 11:27:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-02T11:27:37Z</dc:date>
    <item>
      <title>Record level locking</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/record-level-locking/m-p/1543756#M247497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          I want to lock a table as per ecord level locking . How to go for it?&lt;/P&gt;&lt;P&gt;          Actually the table is being updated with key records simultaneously through different processes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jyoti Shankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Sep 2006 11:11:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/record-level-locking/m-p/1543756#M247497</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-02T11:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Record level locking</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/record-level-locking/m-p/1543757#M247498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;SAP provides you with the ability to restrict access to data while the table is being updated. This is fairly &lt;/P&gt;&lt;P&gt;simple to implement via the use of a lock object . Create the Lock Object in SE11 for that table, if that already exist then use that one..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add the following code in-order to create the table lock. This function module must be called before any &lt;/P&gt;&lt;P&gt;update takes place. If a lock has already been taken out it will display the appropriate message. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  CALL FUNCTION 'ENQUEUE_EZ_ZTABLENAME'
      EXPORTING
           mode_ZTABLENAME = 'E'
           mandt              = sy-mandt
           KEYFIELD1           = "Value
           KEYFIELD2           = "Value
           KEYFIELD3           = "Value
                   ... 
*         X_KEYFIELD1            = ' '
*         X_KEYFIELD2            = ' '
*         X_KEYFIELD3            = ' '
                   ... 
*         _SCOPE             = '2'
*         _WAIT              = ' '
*         _COLLECT           = ' '
*   If exceptions are not used, message is displayed within FM
    EXCEPTIONS
         FOREIGN_LOCK       = 1
         SYSTEM_FAILURE     = 2
         OTHERS             = 3.
             
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   Retrieve message displayed within Function Module
    message id     sy-msgid
              type   'I'
              number sy-msgno
              with   sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    EXIT.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code will remove the lock for the specific table entries.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'DEQUEUE_EZ_ZTABLENAME'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;         MODE_ZTABLENAME = 'E'&lt;/P&gt;&lt;P&gt;         MANDT              = SY-MANDT&lt;/P&gt;&lt;P&gt;           mandt              = sy-mandt&lt;/P&gt;&lt;P&gt;           KEYFIELD1           = "Value&lt;/P&gt;&lt;P&gt;           KEYFIELD2           = "Value&lt;/P&gt;&lt;P&gt;           KEYFIELD3           = "Value&lt;/P&gt;&lt;P&gt;                   ... &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        X_KEYFIELD1            = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        X_KEYFIELD2            = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        X_KEYFIELD3            = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                   ...&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        _SCOPE             = '3'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        _SYNCHRON          = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        _COLLECT           = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;releasing the lock is mandatory, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the link for more info.&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/41/7af4c8a79e11d1950f0000e82de14a/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/41/7af4c8a79e11d1950f0000e82de14a/content.htm&lt;/A&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;Sudheer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Sep 2006 11:27:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/record-level-locking/m-p/1543757#M247498</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-02T11:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Record level locking</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/record-level-locking/m-p/1543758#M247499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But i need only record level locking . Does this serve my purpose ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Sep 2006 11:38:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/record-level-locking/m-p/1543758#M247499</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-02T11:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Record level locking</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/record-level-locking/m-p/1543759#M247500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In Sudhir's code the following should be replaced by your primary keys&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;           KEYFIELD1           = "Value&lt;/P&gt;&lt;P&gt;           KEYFIELD2           = "Value&lt;/P&gt;&lt;P&gt;           KEYFIELD3           = "Value&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the pattern to insert your function call and enter eqnueue&lt;STRONG&gt;tblname&lt;/STRONG&gt; to get select your table.  The subrc of the function module will tell you if it was able to lock the record or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hith&lt;/P&gt;&lt;P&gt;Sunil Achyut&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Sep 2006 12:31:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/record-level-locking/m-p/1543759#M247500</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-02T12:31:39Z</dc:date>
    </item>
  </channel>
</rss>

