0% found this document useful (0 votes)
457 views

SAP Datasphere Consuming Data

The document discusses how to consume data exposed by SAP Datasphere in various clients, tools, and applications. Data can be exposed as analytic models, perspectives, and views and consumed in SAP Analytics Cloud via live connections, in Microsoft Excel via an SAP add-in, and in other clients like Power BI via OData services. It also covers using SAP Datasphere as a data source for SAP Analytics Cloud planning models and loading planning data into SAP Datasphere.

Uploaded by

Diogo Martins
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
457 views

SAP Datasphere Consuming Data

The document discusses how to consume data exposed by SAP Datasphere in various clients, tools, and applications. Data can be exposed as analytic models, perspectives, and views and consumed in SAP Analytics Cloud via live connections, in Microsoft Excel via an SAP add-in, and in other clients like Power BI via OData services. It also covers using SAP Datasphere as a data source for SAP Analytics Cloud planning models and loading planning data into SAP Datasphere.

Uploaded by

Diogo Martins
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

PUBLIC

Document Version: 2023.25 – 2023-11-28

Consuming Data Exposed by SAP Datasphere


© 2023 SAP SE or an SAP affiliate company. All rights reserved.

THE BEST RUN


Content

1 Consuming Data Exposed by SAP Datasphere. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3


1.1 Consume Data in SAP Analytics Cloud via a Live Connection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2 Integrate with SAP Analytics Cloud for Planning. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Consume SAP Datasphere Data in SAP Analytics Cloud via an OData Service. . . . . . . . . . . . . . . 10
Load SAP Analytics Cloud Planning Data into SAP Datasphere. . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.3 Consume Data in Microsoft Excel via an SAP Add-In. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.4 Consume Data in Power BI and Other Clients, Tools, and Apps via an OData Service. . . . . . . . . . . . . 15
1.5 Consume Data in Power BI and Other Clients, Tools, and Apps via ODBC. . . . . . . . . . . . . . . . . . . . . 17
1.6 Consume Data via the OData API. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Consuming Data Exposed by SAP Datasphere


2 PUBLIC Content
1 Consuming Data Exposed by SAP
Datasphere

All users of SAP Datasphere with any of the standard roles can consume data exposed by spaces they are
assigned to. If a user does not need to access SAP Datasphere itself, and only wants to consume data exposed
by it, they should be granted the DW Consumer role.

This topic contains the following sections:

• Exposing Data from SAP Datasphere [page 3]


• Consume Data in SAP Analytics Cloud [page 4]
• Integrate with SAP Analytics Cloud for Planning [page 5]
• Consume Data in Microsoft Excel [page 5]
• Consume Data in Other Clients, Tools, and Apps [page 7]
• Consume Data via an OData Service [page 7]

Exposing Data from SAP Datasphere

Data can be exposed as analytic models, perspectives, and views, which are accessible to clients, tools, and
apps as follows:

Other Clients, Tools,


Object SAP Analytics Cloud Microsoft Excel and Apps

Analytic models (see Creating an Analytic Live Connection Live Connection (via OData/ODBC
Model) an SAP Add-In)

Exposed: Automatically

Perspectives (see Define Perspectives) Live Connection Live Connection (via -


an SAP Add-In)
Exposed: Automatically

Views* (see Exposing a View For Consumption) OData** - OData/ODBC

Exposed: When the Expose for Consumption


switch is enabled

Consuming Data Exposed by SAP Datasphere


Consuming Data Exposed by SAP Datasphere PUBLIC 3
Other Clients, Tools,
Object SAP Analytics Cloud Microsoft Excel and Apps

For more information, see: • Consume Data • Consume Data in • Consume Data in
in SAP Analytics Microsoft Excel via Power BI and
Cloud via a Live an SAP Add-In Other Clients,
Connection [page [page 14] Tools, and Apps
8] via an OData Serv-
• Integrate with ice [page 15]
SAP Analytics • Consume Data in
Cloud for Planning Power BI and
[page 10] Other Clients,
Tools, and Apps
via ODBC [page
17]

* The workflow of consuming views with a semantic usage of Analytical Dataset in SAP Analytics Cloud
and Microsoft Excel via live connection is now deprecated. We recommend that you migrate your analytical
datasets to the new Fact semantic usage and expose your view data via analytic models (see Analytical
Datasets (Deprecated)).

** SAP Analytics Cloud primarily uses the consumption of view data via ODATA for planning (see Integrate with
SAP Analytics Cloud for Planning [page 10]).

 Note

Before exposing data for consumption, you should consider applying row-level security via data access
controls (see Securing Data with Data Access Controls).

Consume Data in SAP Analytics Cloud

You can create a live connection from SAP Analytics Cloud to SAP Datasphere and consume data exposed as
analytic models and perspectives to create stories and analytic applications.

Consuming Data Exposed by SAP Datasphere


4 PUBLIC Consuming Data Exposed by SAP Datasphere
You must:

• Be a SAP Datasphere user with any of the standard roles. If you do not need to connect to SAP Datasphere
itself, and only consume data, then an administrator can grant you the DW Consumer role (see Standard
Roles Delivered with SAP Datasphere).
If data access controls have been applied, then the data you can consume will be filtered based on your
user id (see Securing Data with Data Access Controls).
• Be assigned to the SAP Datasphere space exposing the data (see Control User Access to Your Space).
• Have access to an SAP Analytics Cloud tenant and have the role BI Content Creator or another role
providing equivalent privileges.
• Create or have access to an SAP Analytics Cloud live data connection to your SAP Datasphere tenant (see
Live Data Connections to SAP Datasphere in the SAP Analytics Cloud documentation).

 Note

The workflow of consuming views with a semantic usage of Analytical Dataset in SAP Analytics Cloud and
Microsoft Excel via live connection is now deprecated. We recommend that you migrate your analytical
datasets to the new Fact semantic usage and expose your view data via analytic models (see Analytical
Datasets (Deprecated)).

For more information, see Consume Data in SAP Analytics Cloud via a Live Connection [page 8].

Integrate with SAP Analytics Cloud for Planning

You can use SAP Datasphere as a data source for loading actuals or external data into an SAP Analytics Cloud
planning model. You can also load your SAP Analytics Cloud planning data into SAP Datasphere and combine it
with live actuals or other data as appropriate.

For more information, see Integrate with SAP Analytics Cloud for Planning [page 10].

Consume Data in Microsoft Excel

You can create a live connection from SAP Analytics Cloud to SAP Datasphere and consume data exposed as
analytic models and perspectives in Microsoft Excel, via the SAP Analytics Cloud add-in for Microsoft Office.

Consuming Data Exposed by SAP Datasphere


Consuming Data Exposed by SAP Datasphere PUBLIC 5
You must:

• Install the add-in (see Deploying the Add-In in the SAP Analytics Cloud, Add-In for Microsoft Office
documentation.

 Note

This topic focuses on the SAP Analytics Cloud add-in for Microsoft Office. You can also consume
data exposed as perspectives and views in the SAP Analysis for Microsoft Office add-in (see the SAP
Analysis for Microsoft Office documentation). Data exposed as analytic models cannot be consumed in
the SAP Analysis for Microsoft Office add-in.

• Be a SAP Datasphere user with any of the standard roles. If you do not need to connect to SAP Datasphere
itself, and only consume data, then an administrator can grant you the DW Consumer role (see Standard
Roles Delivered with SAP Datasphere).
If data access controls have been applied, then the data you can consume will be filtered based on your
user id (see Securing Data with Data Access Controls).
• Be assigned to the SAP Datasphere space exposing the data (see Control User Access to Your Space).
• Have access to an SAP Analytics Cloud tenant and have the role BI Content Creator or another role
providing equivalent privileges.
• Create or have access to an SAP Analytics Cloud live data connection to your SAP Datasphere tenant (see
Live Data Connections to SAP Datasphere in the SAP Analytics Cloud documentation).

 Note

The workflow of consuming views with a semantic usage of Analytical Dataset in SAP Analytics Cloud and
Microsoft Excel via live connection is now deprecated. We recommend that you migrate your analytical
datasets to the new Fact semantic usage and expose your view data via analytic models (see Analytical
Datasets (Deprecated)).

For more information, see Consume Data in Microsoft Excel via an SAP Add-In [page 14].

Consuming Data Exposed by SAP Datasphere


6 PUBLIC Consuming Data Exposed by SAP Datasphere
Consume Data in Other Clients, Tools, and Apps

You can consume data exposed from SAP Datasphere in clients, tools, and apps via an OData service or via a
database user/Open SQL schema.

See Consume Data in Power BI and Other Clients, Tools, and Apps via an OData Service [page 15] and
Consume Data in Power BI and Other Clients, Tools, and Apps via ODBC [page 17].

Consume Data via an OData Service

You can connect to the OData API and consume data exposed as views or analytic models in SAP Analytics
Cloud and other clients, tools, and apps that are capable of accessing an OData service and authenticating via
an OAuth client.

You must:

• Be a SAP Datasphere user with any of the standard roles. If you do not need to connect to SAP Datasphere
itself, and only consume data, then an administrator can grant you the DW Consumer role (see Standard
Roles Delivered with SAP Datasphere).
If data access controls have been applied, then the data you can consume will be filtered based on your
user id (see Securing Data with Data Access Controls).
• Be assigned to the SAP Datasphere space exposing the data (see Control User Access to Your Space).
• Obtain the following parameters for an OAuth client defined in your SAP Datasphere tenant:
• Client ID
• Secret
• OAuth2SAML Token URL - To be used in the OAuth 2.0 SAML Bearer Assertion workflow.
• OAuth2SAML Audience - To be used in the OAuth 2.0 SAML Bearer Assertion workflow.

 Note

Consuming exposed data in third-party clients, tools, and apps via an OData service requires a three-
legged OAuth2.0 flow with type authorization_code. Users must manually authenticate against

Consuming Data Exposed by SAP Datasphere


Consuming Data Exposed by SAP Datasphere PUBLIC 7
the configured IDP in order to generate the authorization code before continuing with the remaining
OAuth2.0 steps.

For more information, see Consume Data via the OData API [page 17].

1.1 Consume Data in SAP Analytics Cloud via a Live


Connection

You can create a live connection from SAP Analytics Cloud to SAP Datasphere and consume data exposed as
analytic models and perspectives to create stories and analytic applications.

Context

You must:

• Be a SAP Datasphere user with any of the standard roles. If you do not need to connect to SAP Datasphere
itself, and only consume data, then an administrator can grant you the DW Consumer role (see Standard
Roles Delivered with SAP Datasphere).
If data access controls have been applied, then the data you can consume will be filtered based on your
user id (see Securing Data with Data Access Controls).
• Be assigned to the SAP Datasphere space exposing the data (see Control User Access to Your Space).
• Have access to an SAP Analytics Cloud tenant and have the role BI Content Creator or another role
providing equivalent privileges.
• Create or have access to an SAP Analytics Cloud live data connection to your SAP Datasphere tenant (see
Live Data Connections to SAP Datasphere in the SAP Analytics Cloud documentation).

Consuming Data Exposed by SAP Datasphere


8 PUBLIC Consuming Data Exposed by SAP Datasphere
 Note

The workflow of consuming views with a semantic usage of Analytical Dataset in SAP Analytics Cloud and
Microsoft Excel via live connection is now deprecated. We recommend that you migrate your analytical
datasets to the new Fact semantic usage and expose your view data via analytic models (see Analytical
Datasets (Deprecated)).

Procedure

1. Navigate to your SAP Analytics Cloud tenant.

 Note

If an administrator has configured a connection to an SAP Analytics Cloud tenant (and you are
assigned one or more BI roles), you can use the  (Product Switch) in the top-right corner of the
screen to navigate.

2. In the side navigation area, click  (Stories).


3. Click the Responsive or Canvas tile, select the Optimized Design Experience mode, and click Create to open
a new story in the editor.

 Note

SAP Datasphere analytic models are not supported in the Classic Design Experience mode.

4. In the Tools menu, click Add New Data and then select Data from an existing dataset or model to open the
Select Dataset or Model dialog.
5. In the panel on the left, select your SAP Datasphere live data connection, select your space, and then click
the object to open.

 Note

The workflow of consuming views with a semantic usage of Analytical Dataset in SAP Analytics Cloud
and Microsoft Excel via live connection is now deprecated. We recommend that you migrate your
analytical datasets to the new Fact semantic usage and expose your view data via analytic models (see
Analytical Datasets (Deprecated)).

6. Drag a chart or table from the Assets list in the left panel and build your story as usual.

For detailed information about creating stories, see Data Visualization (Stories) in the SAP Analytics Cloud
documentation.

 Note

For information about SAP Analytics Cloud limitations with this type of connection, see SAP Note
2832606 .

Consuming Data Exposed by SAP Datasphere


Consuming Data Exposed by SAP Datasphere PUBLIC 9
1.2 Integrate with SAP Analytics Cloud for Planning

SAP Datasphere integrates with SAP Analytics Cloud to act as a data source for loading actuals or external
data into a planning model, and can also persist your planning data and combine it with live actuals or other
data as appropriate.

You can:

• Load actuals data from SAP Datasphere into SAP Analytics Cloud for use in your planning models via
an OData Services Connection (see Consume SAP Datasphere Data in SAP Analytics Cloud via an OData
Service [page 10]).
• Load data from SAP Analytics Cloud into SAP Datasphere as a remote table or via a data flow and
optionally combine it with actuals data or other sources as appropriate (see Load SAP Analytics Cloud
Planning Data into SAP Datasphere [page 12]).

See also the blog Introducing the Bi-Directional Integration of SAP Datasphere and SAP Analytics Cloud for
Planning .

1.2.1 Consume SAP Datasphere Data in SAP Analytics Cloud


via an OData Service

You can create an import data connection in SAP Analytics Cloud to consume data from a view exposed via the
SAP Datasphere OData API and consume it in an SAP Analytics Cloud model.

This topic contains the following sections:

• Create an SAP Analytics Cloud OData Services Connection to an SAP Datasphere View [page 11]
• Create a Model from Your Connection [page 12]

Consuming Data Exposed by SAP Datasphere


10 PUBLIC Consuming Data Exposed by SAP Datasphere
Create an SAP Analytics Cloud OData Services Connection to an SAP
Datasphere View

You can create an OData services connection in SAP Analytics Cloud to load (replicate) data from an SAP
Datasphere view to SAP Analytics Cloud.

 Note

The view being consumed must be persisted and any remote tables in its lineage must have their data
replicated to SAP Datasphere.

You must:

• Be a SAP Datasphere user with any of the standard roles. If you do not need to connect to SAP Datasphere
itself, and only consume data, then an administrator can grant you the DW Consumer role (see Standard
Roles Delivered with SAP Datasphere).
If data access controls have been applied, then the data you can consume will be filtered based on your
user id (see Securing Data with Data Access Controls).
• Obtain the following parameters for an OAuth client defined in your SAP Datasphere tenant:
• Client ID
• Secret
• OAuth2SAML Token URL - To be used in the OAuth 2.0 SAML Bearer Assertion workflow.
• OAuth2SAML Audience - To be used in the OAuth 2.0 SAML Bearer Assertion workflow.
• Have access to an SAP Analytics Cloud tenant and have the role BI Content Creator or another role
providing equivalent privileges.

1. Navigate to your SAP Analytics Cloud tenant.

 Note

If an administrator has configured a connection to an SAP Analytics Cloud tenant (and you are
assigned one or more BI roles), you can use the  (Product Switch) in the top-right corner of the
screen to navigate.

Consuming Data Exposed by SAP Datasphere


Consuming Data Exposed by SAP Datasphere PUBLIC 11
2. In the side navigation area, click  .
3. Click Add Connection, select OData Services to open the New OData Services Connection dialog, and
complete the fields as follows:

Parameter Value

Connection Name Enter an appropriate name for your connection.

Data Service URL Enter the full URL to your SAP Datasphere view in the following format:

https://<tenant_url>.cloud.sap/dwaas-core/odata/v4/
consumption/relational/<Space_ID>/<view>

Authentication Type Select OAuth 2.0 Authorization Code.

OAuth Client ID Enter the values for your SAP Datasphere OAuth client.

Secret

Token URL

Authorization URL

4. Click Create to create the connection.

Create a Model from Your Connection

You can use your OData Services connection to load your view's data into an SAP Analytics Cloud model:

1. In the side navigation area, click Modeler.


2. Click the From a Data Source tile and then select OData Services.
3. In the Create Model from OData Services dialog, select your connection in the list and click Next.
Follow the usual steps in the New Query for OData Services dialog (see Building a Query in the SAP
Analytics Cloud documentation).

 Note

Alternatively, you can load data into an existing SAP Analytics Cloud model (see Import and Prepare Fact
Data for a Model with Measures in the SAP Analytics Cloud documentation).

1.2.2 Load SAP Analytics Cloud Planning Data into SAP


Datasphere

You can transfer your SAP Analytics Cloud planning model data into SAP Datasphere via a Cloud Data
Integration connection and optionally combine and compare it with your actuals data.

This topic contains the following sections:

Consuming Data Exposed by SAP Datasphere


12 PUBLIC Consuming Data Exposed by SAP Datasphere
• Create an SAP Datasphere Cloud Data Integration Connection to Your SAP Analytics Cloud Tenant [page
13]
• Load SAP Analytics Cloud Planning Data to SAP Datasphere [page 13]
• Combine Actuals and Planning Data in an SAP Datasphere View [page 13]

Create an SAP Datasphere Cloud Data Integration Connection to Your SAP


Analytics Cloud Tenant

You can create a Cloud Data Integration connection in SAP Datasphere to load (replicate) data from an SAP
Analytics Cloud planning model to SAP Datasphere.

You must:

• Have access to an SAP Analytics Cloud tenant and have the role BI Content Creator or another role
providing equivalent privileges.
• Obtain the following parameters for an OAuth client defined in your SAP Analytics Cloud tenant:
• Client ID
• Secret
• Token URL
• Authorization URL
• [if data flows are required] Ensure that Data Provisioning Agent is configured in your SAP Datasphere
tenant (see Preparing Data Provisioning Agent Connectivity).

Create a Cloud Data Integration connection to your SAP Analytics Cloud tenant, using OAuth 2.0
authentication (see Cloud Data Integration Connections).

See the blog Using the SAC Data Export API with SAP Datasphere and Data Intelligence for more
information.

Load SAP Analytics Cloud Planning Data to SAP Datasphere

You can load your SAP Analytics Cloud planning data to SAP Datasphere via your Cloud Data Integration
connection:

• As a remote table (see Import Remote Tables).


• Via a data flow (see Creating a Data Flow).

Combine Actuals and Planning Data in an SAP Datasphere View

You can combine the planning data loaded from SAP Analytics Cloud with your actuals data (or any other
appropriate data) in a view and then expose the view to allow it to be consumed in an SAP Analytics Cloud
story via a live connection (see Consume Data in SAP Analytics Cloud via a Live Connection [page 8].

Consuming Data Exposed by SAP Datasphere


Consuming Data Exposed by SAP Datasphere PUBLIC 13
1.3 Consume Data in Microsoft Excel via an SAP Add-In
You can create a live connection from SAP Analytics Cloud to SAP Datasphere and consume data exposed as
analytic models and perspectives in Microsoft Excel, via the SAP Analytics Cloud add-in for Microsoft Office.

Context

You must:

• Install the add-in (see Deploying the Add-In in the SAP Analytics Cloud, Add-In for Microsoft Office
documentation.

 Note

This topic focuses on the SAP Analytics Cloud add-in for Microsoft Office. You can also consume
data exposed as perspectives and views in the SAP Analysis for Microsoft Office add-in (see the SAP
Analysis for Microsoft Office documentation). Data exposed as analytic models cannot be consumed in
the SAP Analysis for Microsoft Office add-in.

• Be a SAP Datasphere user with any of the standard roles. If you do not need to connect to SAP Datasphere
itself, and only consume data, then an administrator can grant you the DW Consumer role (see Standard
Roles Delivered with SAP Datasphere).
If data access controls have been applied, then the data you can consume will be filtered based on your
user id (see Securing Data with Data Access Controls).
• Be assigned to the SAP Datasphere space exposing the data (see Control User Access to Your Space).
• Have access to an SAP Analytics Cloud tenant and have the role BI Content Creator or another role
providing equivalent privileges.
• Create or have access to an SAP Analytics Cloud live data connection to your SAP Datasphere tenant (see
Live Data Connections to SAP Datasphere in the SAP Analytics Cloud documentation).

 Note

The workflow of consuming views with a semantic usage of Analytical Dataset in SAP Analytics Cloud and
Microsoft Excel via live connection is now deprecated. We recommend that you migrate your analytical

Consuming Data Exposed by SAP Datasphere


14 PUBLIC Consuming Data Exposed by SAP Datasphere
datasets to the new Fact semantic usage and expose your view data via analytic models (see Analytical
Datasets (Deprecated)).

 Note

This topic focuses on the SAP Analytics Cloud add-in for Microsoft Office. You can also consume data as
perspectives and views in the SAP Analysis for Microsoft Office add-in (see the SAP Analysis for Microsoft
Office documentation). Data exposed as analytic models cannot be consumed in the SAP Analysis for
Microsoft Office add-in.

Procedure

1. Open your Excel desktop app (or Excel for the Web) and create a new blank workbook.
2. Click the SAP Analytics Cloud Ribbon tab, and click Sign In to open the SAP Analytics Cloud panel.
3. Enter the URL for your SAP Analytics Cloud tenant, and click Go.
4. Enter your SAP Analytics Cloud user name and password, and click Log On to connect to the tenant.
5. Click Add Table, select your SAP Datasphere connection and space, then select your object, and click
Open.

 Note

The workflow of consuming views with a semantic usage of Analytical Dataset in SAP Analytics Cloud
and Microsoft Excel via live connection is now deprecated. We recommend that you migrate your
analytical datasets to the new Fact semantic usage and expose your view data via analytic models (see
Analytical Datasets (Deprecated)).

6. Select measures and dimensions as appropriate and work with your data as usual.

For detailed information about working in Excel, see Analyze Your Data in the SAP Analytics Cloud, Add-In
for Microsoft Office documentation.

See also the blog Access SAP Datasphere with SAP’s Microsoft Excel add-ins (published May 2022).

1.4 Consume Data in Power BI and Other Clients, Tools, and


Apps via an OData Service

You can consume data exposed as views in Microsoft Power BI and other third-party clients, tools, and apps via
the OData API.

You can connect Power BI to SAP Datasphere via an OData service by way of a custom connector or a blank
query and consume views that are exposed for consumption.

Consuming Data Exposed by SAP Datasphere


Consuming Data Exposed by SAP Datasphere PUBLIC 15
You must:

• Be a SAP Datasphere user with any of the standard roles. If you do not need to connect to SAP Datasphere
itself, and only consume data, then an administrator can grant you the DW Consumer role (see Standard
Roles Delivered with SAP Datasphere).
If data access controls have been applied, then the data you can consume will be filtered based on your
user id (see Securing Data with Data Access Controls).
• Be assigned to the SAP Datasphere space exposing the data (see Control User Access to Your Space).
• Obtain the following parameters for an OAuth client defined in your SAP Datasphere tenant:
• Client ID
• Secret
• OAuth2SAML Token URL - To be used in the OAuth 2.0 SAML Bearer Assertion workflow.
• OAuth2SAML Audience - To be used in the OAuth 2.0 SAML Bearer Assertion workflow.

 Note

Consuming exposed data in third-party clients, tools, and apps via an OData service requires a three-
legged OAuth2.0 flow with type authorization_code. Users must manually authenticate against
the configured IDP in order to generate the authorization code before continuing with the remaining
OAuth2.0 steps.

See the following blogs for more information:

• SAP Datasphere: OData Connector for Power BI (published October 2022)


• Connecting SAP Datasphere OData API with Power BI via a Blank Query (published September 2022)

Consuming Data Exposed by SAP Datasphere


16 PUBLIC Consuming Data Exposed by SAP Datasphere
1.5 Consume Data in Power BI and Other Clients, Tools, and
Apps via ODBC

You can consume data exposed as views in Microsoft Power BI and other third-party clients, tools, and apps via
an Open SQL schema and ODBC.

You can connect Power BI to SAP Datasphere via an Open SQL schema, and consume perspectives and views
that are exposed for consumption.

You must:

• Request a space administrator or integrator to provide you with access to a database user/Open SQL
schema associated with the SAP Datasphere space exposing the data (see Create a Database User).
• Request an administrator to add the IP address of your tool to the IP allowlist (see Add IP address to IP
Allowlist).
• Install the SAP HANA CLIENT 2.0 (see Download and Install the SAP HANA Client in the SAP HANA Cloud
documentation).
• Create an ODBC connection to SAP Datasphere using your database user credentials (see Connect to SAP
HANA Cloud via ODBC in the SAP HANA Cloud documentation).

See the blog How to Consume SAP Datasphere in Power BI for more information.

1.6 Consume Data via the OData API

You can connect to the OData API and consume data exposed as views or analytic models in SAP Analytics
Cloud and other clients, tools, and apps that are capable of accessing an OData service and authenticating via
an OAuth client.

This topic contains the following sections:

Consuming Data Exposed by SAP Datasphere


Consuming Data Exposed by SAP Datasphere PUBLIC 17
• Getting Started with the SAP Datasphere OData APIs [page 18]
• List Spaces and Assets Exposed for Consumption [page 19]
• Retrieve Asset Data and Metadata [page 19]
• Set Values for Input Parameters [page 20]
• Use OData Parameters [page 21]
• Pagination [page 22]
• OData Annotation Limitations [page 22]
• API Rate Limiting [page 22]

Getting Started with the SAP Datasphere OData APIs

You must:

• Be a SAP Datasphere user with any of the standard roles. If you do not need to connect to SAP Datasphere
itself, and only consume data, then an administrator can grant you the DW Consumer role (see Standard
Roles Delivered with SAP Datasphere).
If data access controls have been applied, then the data you can consume will be filtered based on your
user id (see Securing Data with Data Access Controls).
• Be assigned to the SAP Datasphere space exposing the data (see Control User Access to Your Space).
• Obtain the following parameters for an OAuth client defined in your SAP Datasphere tenant:
• Client ID
• Secret
• OAuth2SAML Token URL - To be used in the OAuth 2.0 SAML Bearer Assertion workflow.
• OAuth2SAML Audience - To be used in the OAuth 2.0 SAML Bearer Assertion workflow.

 Note

Consuming exposed data in third-party clients, tools, and apps via an OData service requires a three-
legged OAuth2.0 flow with type authorization_code. Users must manually authenticate against
the configured IDP in order to generate the authorization code before continuing with the remaining
OAuth2.0 steps.

Consuming Data Exposed by SAP Datasphere


18 PUBLIC Consuming Data Exposed by SAP Datasphere
Compose your OData request based on your SAP Datasphere tenant URL in the following format:

https://<tenant_url>.cloud.sap/api/v1/dwc/<request>

or:

https://<tenant_url>.cloud.sap/dwaas-core/odata/v4/<request>

Requests return, by default, the first 10 results and for retrieving more or other pages you should make use of
the $top and $skip parameters.

The API specification is available at the SAP Business Accelerator Hub .

List Spaces and Assets Exposed for Consumption

Use the catalog request to list spaces and assets that are exposed for consumption.

To list all the spaces you have access to, enter:

https://<tenant_url>.cloud.sap/api/v1/dwc/catalog/spaces

To list all the assets you have access to, enter:

https://<tenant_url>.cloud.sap/api/v1/dwc/catalog/assets

To list all the assets exposed in a particular space, enter:

https://<tenant_url>.cloud.sap/api/v1/dwc/catalog/spaces('<space_id>')/assets

To get access to the description of a particular asset, including links to its metadata and data, enter:

https://<tenant_url>.cloud.sap/api/v1/dwc/catalog/spaces('<space_id>')/
assets('<asset_id>')

Retrieve Asset Data and Metadata

Use the relational and analytical requests to retrieve asset data and metadata.

 Note

Analytic models support only analytical requests, and it is not possible to consume analytic models that
require the consumer to set one or more variables (see Add a Variable).

To retrieve the relational data for an asset, enter:

https://<tenant_url>.cloud.sap/api/v1/dwc/relational/<space_id>/<asset_id>/
<asset_id>[<params>]

If the asset requires you to set a value for one or more <params>, see Set Values for Input Parameters [page
20].

Consuming Data Exposed by SAP Datasphere


Consuming Data Exposed by SAP Datasphere PUBLIC 19
By default, all columns and records are returned. You can use OData parameters to restrict the data you
retrieve (see Use OData Parameters [page 21]).

To retrieve the analytical data for an asset, enter:

https://<tenant_url>.cloud.sap/api/v1/dwc/analytical/<space_id>/<asset_id>/
<asset_id>[<params>]

By default the analytical responses always include all model measures and attributes, and so no aggregation
is applied on the measures. In order to aggregate the results, specify the measures and attributes to be in the
result set using $select, ensuring that at least one measure is specified among the selected fields.

 Note

Views with a semantic usage of Analytical Dataset support both relational and analytical requests. Views
with all other semantic usages, including Fact, support only relational requests.

To retrieve the metadata for an asset, enter:

https://<tenant_url>.cloud.sap/api/v1/dwc/relational/<space_id>/<asset_id>/
$metadata

Set Values for Input Parameters

Some views exposed for consumption may contain input parameters which allow you to set values to filter or
otherwise modify the data you consume.

 Note

It is not possible to consume analytic models that require the consumer to set one or more variables (see
Add a Variable).

To set values for input parameters, append the following syntax directly after your <asset_id>:

(<param>='<val>'[,...])/Set

Input parameters may have default values. If an input parameter has:

• No default value - You must set a value for it.


• A default value - You do not need to set a value for it and the default value will be used. You can override the
default value by setting your own value.

For example, Sales_View in the SALES space has two input parameters:

• Region - which has no default value.


• Category - which has a default value of Footwear.

To view sales of US footwear, enter:

https://<tenant_url>.cloud.sap/api/v1/dwc/relational/SALES/Sales_View/
Sales_View(Region='US')/Set

To view sales of US apparel, enter:

Consuming Data Exposed by SAP Datasphere


20 PUBLIC Consuming Data Exposed by SAP Datasphere
https://<tenant_url>.cloud.sap/api/v1/dwc/relational/SALES/Sales_View/
Sales_View(Region='US',Category='Apparel')/Set

For more information about input parameters, see Create an Input Parameter.

Use OData Parameters

You can use the standard OData parameters $select, $filter, $orderby, $top, and $skip to control the
data you retrieve:

Parameter Description

$select Requests that the service returns only the specified properties (see System Query Option $select
in the OData Version 4.0 Specification).

For example, to retrieve only the columns Partner_ID and Value, append the syntax ?
$select=Partner_ID,Value.

$filter Request the service to restrict returned results according to the provided criteria:

• eq - Equals
• ne - Not equal
• gt - Greater Than
• ge - Greater Than or Equal To
• lt - Less Than
• le - Less Than or Equal To
• and - And
• or - Or
• not - Not
• () - Grouping

For example, to retrieve only records where Partner_ID=100000005, append the syntax ?
$filter=Partner_ID eq 100000005.

$orderby Specifies the order in which items are returned from the service (see System Query Option
$orderby in the OData Version 4.0 Specification).

For example, to order records by descending order of Value, append the syntax ?$orderby=Value
desc.

$top Specifies a value N that limits the number of items returned from a collection (see System Query Option
$top in the OData Version 4.0 Specification).

For example, to retrieve only the top 5 records by descending order of Value, append the syntax ?
$orderby=Value desc&$top=5.

$skip Specifies a value N that excludes the first N items of the selected collection (see System Query Option
$skip in the OData Version 4.0 Specification).

For example, to retrieve only records 6-10 by descending order of Value, append the syntax ?
$orderby=Value desc&$skip=5&$top=5.

Consuming Data Exposed by SAP Datasphere


Consuming Data Exposed by SAP Datasphere PUBLIC 21
Pagination

Client side pagination can be performed via the usage of the $top and $skip query parameters. Combining
both parameters allow the API consumer to retrieve an specific batch of results from the consuming OData
service.

In some cases, the full response cannot be returned in one page due to the page size query option or the
response size limit enforced by the service.

In this case, a next link annotated by the @odata.nextLink is provided at the end of the response, which
allows you to move to the next page. There will be no next link when client side pagination is applied or at the
final page.

Request Service Default Page Size

Catalog 500 records

Consumption Varies according to the amount of fields in the model. Maxi-


mum document size of 20MB.

OData Annotation Limitations

Annotations in the metadata of a specific service might restrict the query options. Some of the CDS data types
are partially or not supported by the SAP Datasphere Consumption API.

Overwritten EDM
Data Type Writable Sortable Filterable Type

cds.hana.ST_GEOME-    Edm.String
TRY

cds.hana.ST_POINT    Edm.String

cds.Binary   -

cds.LargeBinary    -

cds.hana.BINARY    -

cds.LargeString    -

cds.UUID    -

API Rate Limiting

Authenticated requests are associated either with the authenticated username, tenant ID or with the OAuth
client ID. Unauthenticated requests are associated with the originating IP address, and not the user.

When the rate limit is exceeded, the client receives the HTTP 429 Too Many Requests response status
code.

Consuming Data Exposed by SAP Datasphere


22 PUBLIC Consuming Data Exposed by SAP Datasphere
Important Disclaimers and Legal Information

Hyperlinks
Some links are classified by an icon and/or a mouseover text. These links provide additional information.
About the icons:

• Links with the icon : You are entering a Web site that is not hosted by SAP. By using such links, you agree (unless expressly stated otherwise in your
agreements with SAP) to this:

• The content of the linked-to site is not SAP documentation. You may not infer any product claims against SAP based on this information.

• SAP does not agree or disagree with the content on the linked-to site, nor does SAP warrant the availability and correctness. SAP shall not be liable for any
damages caused by the use of such content unless damages have been caused by SAP's gross negligence or willful misconduct.

• Links with the icon : You are leaving the documentation for that particular SAP product or service and are entering an SAP-hosted Web site. By using
such links, you agree that (unless expressly stated otherwise in your agreements with SAP) you may not infer any product claims against SAP based on this
information.

Videos Hosted on External Platforms


Some videos may point to third-party video hosting platforms. SAP cannot guarantee the future availability of videos stored on these platforms. Furthermore, any
advertisements or other content hosted on these platforms (for example, suggested videos or by navigating to other videos hosted on the same site), are not within
the control or responsibility of SAP.

Beta and Other Experimental Features


Experimental features are not part of the officially delivered scope that SAP guarantees for future releases. This means that experimental features may be changed by
SAP at any time for any reason without notice. Experimental features are not for productive use. You may not demonstrate, test, examine, evaluate or otherwise use
the experimental features in a live operating environment or with data that has not been sufficiently backed up.
The purpose of experimental features is to get feedback early on, allowing customers and partners to influence the future product accordingly. By providing your
feedback (e.g. in the SAP Community), you accept that intellectual property rights of the contributions or derivative works shall remain the exclusive property of SAP.

Example Code
Any software coding and/or code snippets are examples. They are not for productive use. The example code is only intended to better explain and visualize the syntax
and phrasing rules. SAP does not warrant the correctness and completeness of the example code. SAP shall not be liable for errors or damages caused by the use of
example code unless damages have been caused by SAP's gross negligence or willful misconduct.

Bias-Free Language
SAP supports a culture of diversity and inclusion. Whenever possible, we use unbiased language in our documentation to refer to people of all cultures, ethnicities,
genders, and abilities.

Consuming Data Exposed by SAP Datasphere


Important Disclaimers and Legal Information PUBLIC 23
www.sap.com/contactsap

© 2023 SAP SE or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any form


or for any purpose without the express permission of SAP SE or an SAP
affiliate company. The information contained herein may be changed
without prior notice.

Some software products marketed by SAP SE and its distributors


contain proprietary software components of other software vendors.
National product specifications may vary.

These materials are provided by SAP SE or an SAP affiliate company for


informational purposes only, without representation or warranty of any
kind, and SAP or its affiliated companies shall not be liable for errors or
omissions with respect to the materials. The only warranties for SAP or
SAP affiliate company products and services are those that are set forth
in the express warranty statements accompanying such products and
services, if any. Nothing herein should be construed as constituting an
additional warranty.

SAP and other SAP products and services mentioned herein as well as
their respective logos are trademarks or registered trademarks of SAP
SE (or an SAP affiliate company) in Germany and other countries. All
other product and service names mentioned are the trademarks of their
respective companies.

Please see https://www.sap.com/about/legal/trademark.html for


additional trademark information and notices.

THE BEST RUN

You might also like