<?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: how to do rollback with sample code. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-rollback-with-sample-code/m-p/4909447#M1146185</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You must not writing "COMMIT WORK" statement in function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Changes on your first table&lt;/P&gt;&lt;P&gt;CALL FUNCTION maintain_masterdata&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; ROLLBACK WORK.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE Statement and Exit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Changes on your second table&lt;/P&gt;&lt;P&gt;CALL FUNCTION maintain_secondTable.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; ROLLBACK WORK.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE Statement and Exit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Changes on your third table&lt;/P&gt;&lt;P&gt;CALL FUNCTION maintain_thirdTable.&lt;/P&gt;&lt;P&gt;IF sy-subrc  &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; ROLLBACK WORK.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE Statement and Exit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jack Wu on Dec 22, 2008 11:25 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jack Wu on Dec 22, 2008 11:26 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Dec 2008 03:22:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-22T03:22:45Z</dc:date>
    <item>
      <title>how to do rollback with sample code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-rollback-with-sample-code/m-p/4909445#M1146183</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;&lt;/P&gt;&lt;P&gt;I have a requirement : we are updating the record by FM hr_maintain_masterdata in three table and  if the record is get updated in two table but not in one table, it should do rollback . it should not allow to update the record in other tables also.&lt;/P&gt;&lt;P&gt;Kindly provide the sample code for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Shweta&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: shweta singh on Dec 20, 2008 1:39 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2008 12:38:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-rollback-with-sample-code/m-p/4909445#M1146183</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-20T12:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to do rollback with sample code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-rollback-with-sample-code/m-p/4909446#M1146184</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;Just type ROLLBACK WORK in the error handling code blocks. This works only, if the function module doesn't set an explicit COMMIT WORK in itself. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;COMMIT WORK.

*Changes on your first table
CALL FUNCTION hr_maintain_masterdata
.......
.......
IF sy-subrc &amp;lt;&amp;gt; 0.
 ROLLBACK WORK.
* EXIT or MESSAGE Statement 
ENDIF.

*Changes on your second table
CALL FUNCTION hr_maintain_masterdata
.......
.......
IF sy-subrc &amp;lt;&amp;gt; 0.
 ROLLBACK WORK.
* EXIT or MESSAGE Statement 
ENDIF.

*Changes on your third table
CALL FUNCTION hr_maintain_masterdata
.......
.......
IF sy-subrc &amp;lt;&amp;gt; 0.
 ROLLBACK WORK.
* EXIT or MESSAGE Statement 
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;Mark-André&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Mark-André Kluck on Dec 20, 2008 2:53 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Dec 2008 13:53:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-rollback-with-sample-code/m-p/4909446#M1146184</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-20T13:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to do rollback with sample code.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-rollback-with-sample-code/m-p/4909447#M1146185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You must not writing "COMMIT WORK" statement in function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Changes on your first table&lt;/P&gt;&lt;P&gt;CALL FUNCTION maintain_masterdata&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; ROLLBACK WORK.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE Statement and Exit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Changes on your second table&lt;/P&gt;&lt;P&gt;CALL FUNCTION maintain_secondTable.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; ROLLBACK WORK.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE Statement and Exit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Changes on your third table&lt;/P&gt;&lt;P&gt;CALL FUNCTION maintain_thirdTable.&lt;/P&gt;&lt;P&gt;IF sy-subrc  &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; ROLLBACK WORK.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE Statement and Exit&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; EXIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jack Wu on Dec 22, 2008 11:25 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Jack Wu on Dec 22, 2008 11:26 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Dec 2008 03:22:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-rollback-with-sample-code/m-p/4909447#M1146185</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-22T03:22:45Z</dc:date>
    </item>
  </channel>
</rss>

