Connection to SAP OData via SAP BTP (Cloud Integration)

When connecting the DQC Platform to an SAP ECC or SAP S/4HANA system without opening direct database access (SAP HANA) or deploying the DQC Proxy, you can expose your SAP data as an OData v2 or v4 service through SAP BTP Cloud Integration (CPI / SAP Integration Suite) and connect using the DQC OData Connector.

No custom DQC ABAP RFC package required: Unlike the SAP RFC connector, connecting via SAP BTP (CPI) OData does not require installing the Z_DQC_* ABAP function modules or the DQC Proxy in your landscape.

For an overview of all ways to bring SAP data into DQC, see Connecting to SAP systems.


Architecture overview

DQC Platform (OData Connector)
       │  HTTPS (OAuth 2.0 Client Credentials / Basic Auth)
       ▼
SAP BTP Cloud Integration (CPI) — OData API Artifact (/gw/odata/SAP/<Service>;v=1)
       │  SAP Cloud Connector (RFC / OData / ODC / SOAP)
       ▼
SAP S/4HANA or SAP ECC (SAP Gateway / CDS View / BAPI / RFC)

In SAP Cloud Integration, you can either:

  1. Pass through an existing SAP Gateway OData service (created via SEGW, ABAP CDS @OData.publish: true, or ABAP RAP), or

  2. Build an OData API Project in SAP Cloud Integration that maps OData Query (GET) operations to an on-premise SAP Gateway service, BAPI, or RFC function module via the SAP Cloud Connector.


Technical requirements for the SAP BTP (CPI) OData service

Because SAP Cloud Integration OData API projects often use custom integration flows (iFlows) to map backend data, make sure the OData service fulfills the following five requirements expected by the DQC OData Connector:

#

Requirement

Details

1

Valid $metadata document (GET <Service_URL>/$metadata)

Must return a valid OData v2 or v4 EDMX schema listing the EntityType and EntitySet definitions. If an EntityType merges columns from multiple SAP tables (for example LFA1 and LFB1), each <Property Name="..."> within an EntityType must be unique.

2

Flat properties on each EntityType

All columns to be checked in DQC must be exposed as flat <Property> fields on the EntitySet. Navigation properties starting with to_ are ignored and not expanded.

3

Row count endpoint (GET <Service_URL>/<EntitySet>/$count)

Mandatory for OData v2: The CPI integration flow must implement the /$count operation for each EntitySet and return an integer > 0. DQC queries <EntitySet>/$count during table discovery and skips EntitySets whose count fails or returns 0.

4

Pagination support (__next / @odata.nextLink or $top & $skip)

For tables larger than a single page, the Query operation in CPI must either return a server-driven next-page link (__next in OData v2, @odata.nextLink in OData v4) or honor client-driven $top and $skip query parameters passed in CPI's UriInfo header.

5

Clean base Service URL

Use the base URL of the deployed CPI OData runtime artifact (for example https://<cpi-runtime-host>/gw/odata/SAP/<Service_Name>;v=1) without /$metadata, without an EntitySet path suffix, and without query parameters.


Prerequisites in SAP BTP Cockpit

  1. Deploy the OData API artifact in SAP Cloud Integration and copy the runtime endpoint URL from Monitor → Integrations and APIs → Manage Integration Content (format: https://<cpi-runtime-host>/gw/odata/SAP/<Service_Name>;v=1).

  2. Create OAuth 2.0 credentials (recommended): In your SAP BTP Cockpit subaccount, go to Instances and Subscriptions, create a Service Instance for Process Integration Runtime with service plan integration-flow and assign the ESBMessaging.send role. Create a Service Key for that instance and note oauth.clientid, oauth.clientsecret, and oauth.tokenurl (for example https://<subdomain>.authentication.<region>.hana.ondemand.com/oauth/token).

  3. Allowlist the DQC outbound IP address (if applicable): If your SAP BTP environment or API Management layer restricts inbound traffic by IP address, allowlist the DQC Platform's static outbound IP: 3.123.94.228.


Configure the connector in the DQC Platform

  1. Go to the Data Connectors screen and click OData Server.

  2. Fill in the connection fields:

Field

Example / Value

Description

Connector Name

SAP BTP OData – Payment Terms

Display name of the connector in DQC

Service URL

https://<cpi-runtime-host>/gw/odata/SAP/<Service_Name>;v=1

Base URL of the deployed CPI OData service (without /$metadata or EntitySet name)

OData Version

OData v2 or OData v4

OData v2 is the default for SAP Cloud Integration OData API projects

Authentication Method

OAuth 2.0 or Basic Auth

OAuth 2.0 (Client Credentials) is recommended for SAP BTP

OAuth Client ID

<oauth.clientid>

Client ID from the SAP BTP Process Integration Runtime Service Key

OAuth Client Secret

<oauth.clientsecret>

Client Secret from the SAP BTP Process Integration Runtime Service Key

OAuth Token URL

https://<subdomain>.authentication.<region>.hana.ondemand.com/oauth/token

XSUAA token endpoint (oauth.tokenurl) from the Service Key

OAuth Scope

(optional)

Leave empty unless your XSUAA configuration requires a specific scope

Click Load Tables, select the SAP EntitySets you want to validate, and click Connect.


Troubleshooting

Symptom

Likely cause

Fix

Load Tables succeeds, but the list of tables is empty

For OData v2, <EntitySet>/$count is not implemented in the CPI iFlow or returns 0.

Ensure the CPI OData Query integration flow handles /$count requests and returns a positive integer count for non-empty tables.

One or more EntitySets are missing from the table list

The $metadata XML contains conflicting duplicate <Property Name="..."> declarations in the same EntityType.

Remove duplicate property names in the OData EDMX model in SAP Cloud Integration so each property name in an EntityType is unique.

Only the first page of rows is loaded, or rows are duplicated across pages

The CPI iFlow maps to an RFC/BAPI or SOAP backend and ignores $top and $skip without returning a __next link.

Forward $top and $skip from the CPI UriInfo header to the backend query, or return a server-driven __next (@odata.nextLink) pagination token.

401 Unauthorized / 403 Forbidden when loading tables

OAuth 2.0 token URL or credentials are wrong, or the BTP service instance lacks ESBMessaging.send.

Verify clientid, clientsecret, and tokenurl against the SAP BTP Process Integration Runtime (integration-flow) Service Key and confirm the ESBMessaging.send role assignment.

Fields starting with to_ do not appear as columns

Navigation properties (to_*) are stripped by the connector.

Expose all columns to be validated as flat <Property> fields directly on the EntitySet.

For general OData error messages in DQC, see Connection to OData — Troubleshooting. Learn more: Connecting to SAP systems, Connection to SAP HANA, Connection to SAP RFC, Supported data sources.