Skip to main content

OData

What OData Protocol Versions Are Supported?

OData protocol versionSAP Cloud SDK for JavaScript
OData v2
OData v4

What Is OData?

OData is an open standard for building and consuming RESTful APIs. It defines a query language to send and retrieve data via HTTP and to perform operations on data.

There are two widely used versions of the protocol: OData v2 and OData v4. The latter comes with more and improved functionality. Full details on the standards are to be found in the documentation.

Pregenerated OData Clients

The SAP Cloud SDK includes pregenerated JavaScript/TypeScript clients for all OData-based SAP S/4HANA Cloud and On-Premise services. Those clients simplify service consumption by exposing a typed and fluent API. This API allows you to explore and autocomplete requests against the SAP S/4HANA services.

There are more than 400 pregenerated clients with the following naming patterns:

  • SAP S/4HANA Cloud: @sap/cloud-sdk-vdm-<service name>-service
  • SAP S/4HANA On-Premise: @sap/cloud-sdk-op-vdm-<service name>-service
Virtual Data Model (VDM)

Sometimes the pregenerated clients for SAP S/4HANA are referred to as Virtual Data Model (VDM). This is why the naming pattern for the pregenerated clients contains vdm as well.

All SAP Cloud SDK's pregenerated client libraries are distributed under the SAP developer license agreement. This limits the use of the pregenerated clients to development purposes only.

Code Generator

If you want to use an OData service, that has no pregenerated client, you can use the client generator to generate your own client. You can do it for any service either developed by yourself, provided by SAP, or other 3rd parties.

  • Service definition usually comes in form of the .edmx file and contains metadata of OData service. The simplest way to obtain it if you have access to the service is navigating to the http(s)://<service-path>/$metadata endpoint. You can generate a client for any 3rd party service or a service that you have built on your own.
  • You can invoke code generator via our command-line interface (CLI).

Connectivity

We simplify connectivity to SAP enabled OData services via type-safe abstractions over Destinations, Authentication and some other related concepts.