<?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 Regarding commit work in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-commit-work/m-p/7910731#M1597688</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am  using update statement 2 times for a single record in table and here I am using a single  enqueue and dequeue statement for this purpose. I have 2 queries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Is it advisable to use a single enqueue dequeue statement while I am updating 2 times a single record of a table.  Or each   &lt;/P&gt;&lt;P&gt;    update statement we have to use enqueue separately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Can I use commit statement after the dequeue statment.  or I have to use before the dequeue statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;enqueue ....&lt;/P&gt;&lt;P&gt;if ..&lt;/P&gt;&lt;P&gt;   update table .....&lt;/P&gt;&lt;P&gt;   if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      flag = 'X'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if...&lt;/P&gt;&lt;P&gt;   update table.....&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;     flag = 'X'.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dequeue ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if flag = 'X'.&lt;/P&gt;&lt;P&gt;  commit.&lt;/P&gt;&lt;P&gt; endif.&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;Mani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Jun 2011 01:41:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-06-14T01:41:52Z</dc:date>
    <item>
      <title>Regarding commit work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-commit-work/m-p/7910731#M1597688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am  using update statement 2 times for a single record in table and here I am using a single  enqueue and dequeue statement for this purpose. I have 2 queries&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Is it advisable to use a single enqueue dequeue statement while I am updating 2 times a single record of a table.  Or each   &lt;/P&gt;&lt;P&gt;    update statement we have to use enqueue separately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Can I use commit statement after the dequeue statment.  or I have to use before the dequeue statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;enqueue ....&lt;/P&gt;&lt;P&gt;if ..&lt;/P&gt;&lt;P&gt;   update table .....&lt;/P&gt;&lt;P&gt;   if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      flag = 'X'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if...&lt;/P&gt;&lt;P&gt;   update table.....&lt;/P&gt;&lt;P&gt;  if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;     flag = 'X'.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dequeue ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if flag = 'X'.&lt;/P&gt;&lt;P&gt;  commit.&lt;/P&gt;&lt;P&gt; endif.&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;Mani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2011 01:41:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-commit-work/m-p/7910731#M1597688</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-14T01:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding commit work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-commit-work/m-p/7910732#M1597689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure on why you want to use the update statement twice, anyways my suggestion is to use just one update statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

if ..
modify ITAB/Work Area with the corresponding data
if sy-subrc = 0.
flag = 'X'.
endif.

if...
modify ITAB/Work Area with the corresponding data
if sy-subrc = 0.
flag = 'X'.
endif.
endif.

if flag = 'X'.
enqueue ....
update table.....
commit.
dequeue ...
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Chen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2011 04:49:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-commit-work/m-p/7910732#M1597689</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-14T04:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding commit work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-commit-work/m-p/7910733#M1597690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you are updating the same record , then teh enqueue would anyways have locked that entry.&lt;/P&gt;&lt;P&gt;So i dont think you need a separate lock.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But just wondering why 2 updates.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2011 04:53:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-commit-work/m-p/7910733#M1597690</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-14T04:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding commit work</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-commit-work/m-p/7910734#M1597691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this depends on the setting of the parameter _SCOPE in ENQUEUE fm call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the lock for both updates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have _SCOPE = 1 you can have a COMMIT WORK after each update (or one COMMIT after both updates) and have to DEQUEUE it afterwards; if _SCOPE is 2 or 3 a COMMIT WORK automatically dequeues the lock and in this case you need no DEQUEUE fm before COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Klaus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2011 04:59:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-commit-work/m-p/7910734#M1597691</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-06-14T04:59:37Z</dc:date>
    </item>
  </channel>
</rss>

