Skip to Content
Jul 01, 2022 at 07:42 PM

Is it ok to use commit work in a FM called in a background task

122 Views Last edit Jul 02, 2022 at 07:38 AM 2 rev


I've implemented P/S BTE 1030. The requirement is to post a follow on accounting document immediately after the original accounting document is posted. Inside the BTE I've an RFC-enabled wrapper FM(called in background task destination none) which calls the account posting BAPI followed by commit work. Is this the correct/recommended approach for achieving this requirement? More importantly, is it ok to use an explicit commit work inside the background LUW?

As per SAP documentation:

The statements COMMIT WORK and ROLLBACK WORK must not be executed within a LUW. In addition, no implicit database commit can be triggered there.