<?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: what exception should I use when commit work fails ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-exception-should-i-use-when-commit-work-fails/m-p/6807614#M1468518</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;do you throw an exception in a class method if commit work fails, what do you usually do ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Apr 2010 07:14:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-04-22T07:14:21Z</dc:date>
    <item>
      <title>what exception should I use when commit work fails ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-exception-should-i-use-when-commit-work-fails/m-p/6807612#M1468516</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 create a class with methods to insert , modify and delete trasaction data,  &lt;/P&gt;&lt;P&gt;when commit work fails, I want to throw an exception, what exception should I use &lt;/P&gt;&lt;P&gt;for this case?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 03:01:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-exception-should-i-use-when-commit-work-fails/m-p/6807612#M1468516</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-22T03:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: what exception should I use when commit work fails ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-exception-should-i-use-when-commit-work-fails/m-p/6807613#M1468517</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;Two non-catchable exceptions for commit work.&lt;/P&gt;&lt;P&gt;COMMIT_IN_PERFORM_ON_COMMIT &lt;/P&gt;&lt;P&gt;COMMIT_IN_POSTING &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards and Best wishes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 04:27:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-exception-should-i-use-when-commit-work-fails/m-p/6807613#M1468517</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-22T04:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: what exception should I use when commit work fails ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-exception-should-i-use-when-commit-work-fails/m-p/6807614#M1468518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;do you throw an exception in a class method if commit work fails, what do you usually do ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 07:14:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-exception-should-i-use-when-commit-work-fails/m-p/6807614#M1468518</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-22T07:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: what exception should I use when commit work fails ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-exception-should-i-use-when-commit-work-fails/m-p/6807615#M1468519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to raise an exception every time your commit fails, then you just need to create your own custom exception class and raise it inside your methods every time commit fails.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By the way, in order for you to know if your commit command failed or not- ensure that you add the AND WAIT command so that the sy-subrc field changes for success and error. Otherwise, your COMMIT WORK will always return 0 sy-subrc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Apr 2010 13:32:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-exception-should-i-use-when-commit-work-fails/m-p/6807615#M1468519</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-22T13:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: what exception should I use when commit work fails ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-exception-should-i-use-when-commit-work-fails/m-p/6807616#M1468520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In general, you should do your commit using CALL FUNCTION IN UPDATE TASK. As this runs in a different process, you will never be able to catch an exception in your main task, even if you throw one in the Open SQL code. What you should do is carefully validate your data before posting it to the database, so that commit cannot fail for data integrity reasons. If it fails for technical reasons (DB down etc.) there is nothing that your code could do about it anyway, so in this case even getting an exception would be no use. What exactly is it you are trying to accomplish?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Sebastian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Apr 2010 12:31:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-exception-should-i-use-when-commit-work-fails/m-p/6807616#M1468520</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-28T12:31:12Z</dc:date>
    </item>
  </channel>
</rss>

