OutSystems Platform allows you to fetch data from SAP and use it in your OutSystems applications.

The steps you take to add an SAP function to get data are:

  1. Create a connection to the SAP system in your application;
  2. Import the SAP remote functions that you need to retrieve data;
  3. Use the SAP remote functions in your application as any other OutSystems action.


In this example we will create an application that list customers stored in SAP.

We are going to develop a module to list customers from SAP, called SAPCustomers. This module is part of the Order Management application to manage orders.

Connect to the SAP System

To import a SAP remote function to get customers, first you need to create a connection to the SAP system.

To establish a connection to SAP, go to the Logic tab, and open the folder Integrations. Right-click on the SAP item and select 'Consume SAP Remote Functions...'.

A window to configure the SAP connection will be displayed. Fill the fields regarding the connection and login parameters of your SAP. Test your connection by clicking on the Test Connection button. If your connection fails, you can click on 'Show error detail' to see the error message.

Import SAP Functions to Retrieve Data

After setting the connection to SAP we can now import the SAP functions that we will use in our application.

Click on the Choose Functions button. A folder tree view with the remote functions, grouped by business use case and SAP functionality, is displayed. We need to pick the 'BAPI_CUSTOMER_GETLIST', the function to fetch the customers we want to list. Click on the function name to see its details on the right hand panel: description, input, and output parameters.

Check the function and click 'Finish'.

The Bapi_Customer_Getlist action is created and the structures to define the parameters: Addressdata, Idrange, Return, and Specialdata. See more about how structures are created and data type conversions between SAP and OutSystems Platform.


The action for the remote function will be available under the SAP connection you've configured, inside the SAP element.

Use the SAP Remote Function

You can now create the logic and list customers in your application. Use the Preparation action to implement the logic to fetch the customers from SAP.

To get customers between id 1 and 1000, assign the following values to a variable with the BAPICUSTOMER_IDRANGE data type of the Bapi_Customer_Getlist action:

The credentials used in this call are the ones defined in the connection set up. See other authentication methods.

List the Result in Your Application

You can now list customers on a web screen:

  1. Use the Bapi_Customer_Getlist SAP remote function in the Preparation to get all customers;
  2. Use a table records to list customers on the screen:
    1. Set the Bapi_Customer_Getlist SAP remote function as source;
    2. Add the columns you want to show.

Publish and open in the browser.

See Also

Troubleshoot SAP Remote Functions | Change Data in an SAP System