Skip to main content

Extensibility and Integration



Execute SAP Stateful Calls

Some BAPI remote functions commit database changes, but some don’t have a commit implemented in their code. By default, OutSystems creates a new transaction for each SAP remote function call, and commits changes before closing it.

However, there are situations where you need to make several calls to SAP remote functions in the same transaction.

To achieve this, you need an extension module to manage stateful calls in SAP.

Create an Extension Module Using SAP Extensibility API

  1. Go to Forge and get the component SAP Utilities. It's a sample with an extension module for SAP, with actions for handling stateful calls;
  2. Because SAPUtilities extension makes use of the SAP Extensibility API, setup your extension following the requirements described in here;
  3. Publish the extension;

Use the Extension in your Application

To implement stateful calls in your application:

  1. Add dependencies to the following actions of the SAPUtilities extension:
  2. BeginContext: starts a stateful connection in SAP;
  3. EndContext: ends the stateful connection in SAP;
  4. Commit: commits changes inside a stateful connection in SAP;
  5. Rollback: rolls back changes inside a stateful connection in SAP.

  6. Use SAP remote functions together with the actions from the extension to implement a stateful call.

  • Was this article helpful?