<?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: Lock Objects Problem while updating entries in custom table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects-problem-while-updating-entries-in-custom-table/m-p/6716496#M1454671</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3002565"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Mar 2010 12:32:25 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-18T12:32:25Z</dc:date>
    <item>
      <title>Lock Objects Problem while updating entries in custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects-problem-while-updating-entries-in-custom-table/m-p/6716495#M1454670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam updating a custom table ztable from internal table entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie : Modify ZTABLE from table ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the entries are updating and inserting perfectly..&lt;/P&gt;&lt;P&gt;But my problem is i need to use lock objects before doing this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a lock obect EZTABLE with all th ekey fields of the table.. ie : it has 2 key fields &lt;/P&gt;&lt;P&gt;item &amp;amp; matnr .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now how to use lock objects here.. do i need to loop the internal table and use enque &amp;amp; deque function module each and every time in loop or use it out side the loop..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one explain me this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 12:28:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects-problem-while-updating-entries-in-custom-table/m-p/6716495#M1454670</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T12:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Objects Problem while updating entries in custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects-problem-while-updating-entries-in-custom-table/m-p/6716496#M1454671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3002565"&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 12:32:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects-problem-while-updating-entries-in-custom-table/m-p/6716496#M1454671</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T12:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Objects Problem while updating entries in custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects-problem-while-updating-entries-in-custom-table/m-p/6716497#M1454672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kumar , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Lock the tables using the enqueue fm .&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;Modify ZTABLE from table ITAB.&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;Unlock the tables using the dequeue fm.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the below code..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**- Lock the table for updation&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'ENQUEUE_E_TABLEE'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      mode_rstable   = 'E'&lt;/P&gt;&lt;P&gt;      tabname        = 'ZTABLE'&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**- Updating the values in the afterbilled table.&lt;/P&gt;&lt;P&gt;  MODIFY ztableFROM TABLE itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**- Unlock the table after Updation.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'DEQUEUE_E_TABLEE'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      mode_rstable = 'E'&lt;/P&gt;&lt;P&gt;      tabname      = 'ZTABLE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chitra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 12:36:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects-problem-while-updating-entries-in-custom-table/m-p/6716497#M1454672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T12:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Objects Problem while updating entries in custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects-problem-while-updating-entries-in-custom-table/m-p/6716498#M1454673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can use instead of creating objetc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CALL FUNCTION 'ENQUEUE_E_TABLEE'&lt;/P&gt;&lt;P&gt;      EXPORTING&lt;/P&gt;&lt;P&gt;        MODE_RSTABLE   = 'E'&lt;/P&gt;&lt;P&gt;        TABNAME        = 'YOUR TABLE NAME'&lt;/P&gt;&lt;P&gt;        VARKEY         = L_VARKEY&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC IS INITIAL&lt;/P&gt;&lt;P&gt;MODIFY TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'DEQUEUE_E_TABLEE'&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          MODE_RSTABLE = 'E'&lt;/P&gt;&lt;P&gt;          TABNAME      = 'YOur TABKE NAME'&lt;/P&gt;&lt;P&gt;          VARKEY       = L_VARKEY..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 12:41:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects-problem-while-updating-entries-in-custom-table/m-p/6716498#M1454673</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T12:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Lock Objects Problem while updating entries in custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects-problem-while-updating-entries-in-custom-table/m-p/6716499#M1454674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi kumar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**check if the equipment is already locked by user, if yes, trigger a mail&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            CALL FUNCTION 'ENQUEUE_EIEQUI'&lt;/P&gt;&lt;P&gt;             EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            MODE_EQUI            = 'E'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            MANDT                = SY-MANDT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;               equnr                = lv_equi_temp&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            X_EQUNR              = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            _SCOPE               = '2'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            _WAIT                = ' '&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;             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;&lt;/P&gt;&lt;P&gt;            IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;              lv_subrc1 =  sy-subrc.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            ELSE.&lt;/P&gt;&lt;P&gt;              CALL FUNCTION 'DEQUEUE_EIEQUI'&lt;/P&gt;&lt;P&gt;               EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            MODE_EQUI       = 'E'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            MANDT           = SY-MANDT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                 equnr           =  lv_equi_temp&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;            X_EQUNR         = ' '&lt;/P&gt;&lt;/LI&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;            ENDIF.&lt;/P&gt;&lt;P&gt;try like this to check if the object is locked....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can also use &lt;/P&gt;&lt;P&gt;call function 'ENQUEUE,.&lt;/P&gt;&lt;P&gt;do the needful changes update the database then commit work &lt;/P&gt;&lt;P&gt;then call function 'DEQUEUE'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps,&lt;/P&gt;&lt;P&gt;tanmaya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 13:35:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lock-objects-problem-while-updating-entries-in-custom-table/m-p/6716499#M1454674</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T13:35:24Z</dc:date>
    </item>
  </channel>
</rss>

