title: ABAP do something on program exit
body: <p>in my ABAP program I'm updating field X in table tab1 at the beginning and in the last step if everything goes OK, I'm reversing this update. It's important that during execution of program the field X has correct value. </p>
  
  <p>However when I exit the transaction with close button not SAP cancel button (F12), program terminates and it doesn't go to the end of program, thus not reversing the update made at the beginning. </p>
  
  <p><a href="https://i.stack.imgur.com/HYYnJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HYYnJ.png" alt="enter image description here"></a></p>
  
  <p>Is there a way that I can execute some code after closing the report?</p>