Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 1.39 KB

05-generate-odata-client.md

File metadata and controls

14 lines (11 loc) · 1.39 KB

Generate your own OData client

There are many scenarios where you have either your own OData service or want to integrate with another SAP OData service, that is not part of the SAP S/4HANA services, like SAP SucessFactors. For those cases you can generate your own OData client as described in the following.

Download EDMX file

Download the service specification file for the Employee Central Time Off service from the SAP Business API Hub and put it into the generator-input directory.

In this directory you will also find the service mapping file, that contains some extra configuration for the generated service(s), like the directory name and service path for the service.

Run the generation

In your package.json you have already installed the @sap/cloud-sdk-generator dependency. Let's use it to run the generation. Pass the generator-config.json, where we specify input and output directories along with some other options for the generation.

npx generate-odata-client -c generator-config.json

Once this is completed you should find some generated code, your OData client, in the src/generated/ec-time-off-service directory. We will use this code to request additional appointments from SAP SuccessFactors.