SAP data models reflect an OData service from SAP back-end systems like SAP Business Suite (SAP ERP 6.0), SAP S/4HANA, and SAP S/4HANA Cloud. OData services are exposed via the SAP Gateway and are described in a
$metadata file, which describes all the entities that are exposed for that service.
Handcrafting a Mendix domain model for these OData services can be a lot of work. The SAP OData Model Creator automates this process by providing a website where your OData metadata XML file is transformed into a Mendix domain model that can be imported in your project.
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 (see below)
2.1 Getting the SAP OData Connector
To be able to use the OData Connector, create your project and then navigate to the Mendix App Store to download the SAP OData Connector. You will then find this module in your app project’s App Store modules.
For details on using Mendix App Store connectors, see How to Use App Store Content in the Modeler.
3 Generating a Data model
Generating an SAP data model starts by getting an OData metadata XML file. This file can be download from the OData service URL directly using the
$metadata suffix or retrieved from the SAP Gateway. Your SAP Gateway administrator can provide the file for you.
To generate the data model, follow these steps:
- Save the file to your hard drive.
- Open the SAP OData Model Creator.
Upload the OData Schema XML file:
Press Generate .mpk. A progress bar will be shown during the parsing and generation of the module.
Once the generation is done, the Download File button appears. Notice that the file name of your data model module is extracted from the metadata file itself.
4 Using the Data Model Module in a Mendix App
Now you have a Mendix module ready to import into your project. Open the project which you created as a prerequisite. Right-click your project in the Project Explorer and select Import module package….
You now have your service HCM_PEOPLE_PROFILE_SRV module available in your project ready to use in combination with the SAP OData Connector.
Now you are ready to use the imported data model together with the SAP OData Connector. For more information, see How to Use the SAP OData Connector.