The SAP OData Connector is a specific SAP connector for integrating with SAP back-end systems like SAP Business Suite (SAP ERP 6.0), SAP S/4HANA, SAP S/4HANA Cloud, and SAP SuccessFactors.
This how-to will teach you how to do the following:
- Add the SAP OData Connector to your Mendix app
- Configure the SAP OData Connector
Before starting this how-to, make sure you have completed the following prerequisites:
- Create the app in the Mendix Desktop Modeler 7.5.1 or higher
- Get the SAP OData Connector module
- Get an SAP Service module
2.1 Getting the SAP OData Connector Module
To be able to use the OData Connector, after creating your project, navigate to the Mendix App Store to download the SAP OData Connector module. You will then find this module in your app project’s App Store modules.
For more information, see How to Use App Store Content in the Modeler.
2.2 Getting an SAP Service Module
For getting started quickly, you can also download one of the available SAP Service modules. These modules contain a pre-built domain model for a specifc service of SAP.
For more information, see SAP Service Modules.
3 Using the SAP OData Connector
In this section, you will learn how to implement the data connector in your Mendix app.
In this example, you are retrieving a list of customers that is available in the SAP Service module named SAP Check Price and Availability.
To create the microflow for this retrieve, follow these steps:
- Create a microflow in the Desktop Modeler.
- From the Toolbox, drag the Get List operator into your microflow.
Fill in the required fields of the Get List connector. For this example, you should use these settings:
- Query –
@SAPCheckPriceandAvailability.SRA016_PRICE_AVAIL_SRV_URL +'/' + toString(SAPCheckPriceandAvailability.EntitySetNames.Customers)
- Response type – the type you want to query from the OData service; in this example,
- Request parameters – empty
- Parent – empty
- Result info – empty
- Use Cloud Connector – Yes
- Query –
In the microflow, make the return value of the microflow List of Customers. This is so that you can call the microflow as a data source in a page.
The final result of your microflow should look like this:
3.2 Creating a Page
To create a page to show the objects in a list, follow these steps:
- Create an empty page using the Grid default page template.
Select the microflow you created in 3.1 Creating a Microflow as the data source for the grid. Your page should look like this:
Create a simple button on your homepage.
Set the action to Open page and select the page you have just created.
Congratulations! You can now run your app and see a list of the customers available in the public Price as Availabitiy application of SAP Fiori Cloud Demo.