title: BAPI_TRANSACTION_COMMIT with WAIT = 'X' within a BADi
body: <p>What would be the effect of using the 'BAPI_TRANSACTION_COMMIT' with 'WAIT' parameter when equals to 'X' inside a BADi? Should I expect that SAP will commit the data when LUW commits?</p>
  
  <p>I'm aware that inside 'BAPI_TRANSACTION_COMMIT' it happens 'COMMIT WORK' or 'COMMIT WORK AND WAIT' if you specify parameter 'WAIT' = 'X'.</p>
  
  <p>I'm also aware that it's not correct to make a 'COMMIT WORK' inside a BADi, but if I use 'COMMIT WORK AND WAIT' via the BAPI?</p>
  
  <p><a href="http://help.sap.com/abapdocu_70/en/ABAPCOMMIT.htm" rel="noreferrer">The SAP documentation regarding to COMMIT</a> says:</p>
  
  <blockquote>
    <p>This executes all high-priority (VB1) update function modules in the
    order of their registration and in a common database LUW. If you do
    not specify the addition AND WAIT, the program does not wait until the
    update work process has executed it (asynchronous updating), but
    instead is resumed immediately after COMMIT WORK. However, if the
    addition AND WAIT is specified, program processing after COMMIT WORK
    will not continue until the update work process has executed the
    high-priority update function modules (synchronous updating).   </p>
    
    <p>When all high-priority update function modules are completed successfully,
    the statement executes the low-priority (VB2) update function modules
    in the order of registration together in a common database LUW.</p>
  </blockquote>
  
  <p>My confusion arises because we have a BADi implementation where there's a call to the mentioned function with parameter 'WAIT' = 'X' and we have found a SAP Notes where it prohibits the use of 'COMMIT WORK' inside that BADi, however it says 'COMMIT WORK' and not 'COMMIT WORK AND WAIT'.</p>
  
  <p>So I could think that the implementation is right because that data would be commited when LUW finishes ... or not. Any comments?</p>