Import Data Connection to OData Services

You can create a connection that allows you to import data from both on-premise and cloud data sources using generic OData services. It is possible to request a customized OData data source solution.

Prerequisites

You have completed ONE of the following setup options:

Note
This is only required for on-premise OData services.

Context

Note
  • SAP Analytics Cloud supports OData Version 4.0. Logical Operators (such as Equal, Greater than or equal, and logical Or) are supported. The Not operator (logical negation), arithmetic operators, and arithmetic functions are not supported.
  • While OData exposes one-to-many navigation, SAP Analytics Cloud cannot follow these relationships because doing so would distort the measures at the parent level. OData v4.0 supports Lambda operators “any” and “all”, which can reduce the collection of children to a single Boolean value. For this to work, both the server and SAP Analytics Cloud must support OData v4.0.
  • Supported OData Authorization request formats:

    Authorization Code Request

    The data service must accept the token request as URL encoded.

    The data service must accept an Authorization header with the client ID and client secret encoded as a base 64 string.

    The data service must accept as a body parameter grant_type: authorization_code.

    Scopes are optional, but if supported, the data service must accept them as a body parameter scope: <SCOPE1 SCOPE2 SCOPE3...>. The scopes are sent as a string.

    Example:

    curl -X POST \
    <Token URL> \
    -H 'Accept: */*' \
    -H 'Authorization: Basic <BASE 64 Encoded String>' \
    -d grant_type=authorization_grant
    
    -d code=<Authorization code>
    
    -d redirect_uri=<Redirect URI>

    The response must be of content type JSON, and include in the response body the following parameters as top level JSON objects: access_token, refresh_token, and token_type. It may contain other parameters.

    Example:

    {
    "access_token": "<ACCESS TOKEN>",
    
    "refresh_token": <REFRESH TOKEN>",
    "token_type": "Bearer",
    "expires_in": 0,
    "scope": ""
    }

    Note that if the required parameters are returned in arrays or as nested parameters, they may not be processed correctly.

    Incorrect Example:

    {
    
    "authorization"
    
    {
    "access_token": "<ACCESS TOKEN>",
    
    "refresh_token": <REFRESH TOKEN>",
    "token_type": "Bearer",
    "expires_in": 0,
    "scope": ""
    }
    }

    Client Credentials

    The data service must accept the token request as URL encoded.

    The data service must accept an Authorization header with the client ID and client secret encoded as a base 64 string.

    The data service must accept as a body parameter grant_type: client_credentials.

    Scopes are optional, but if supported, the data service must accept them as a body parameter scope: <SCOPE1 SCOPE2 SCOPE3...>. The scopes are sent as a string.

    Example:

    curl -X POST \
    <Token URL> \
    -H 'Accept: */*' \
    -H 'Authorization: Basic <BASE 64 Encoded String>' \
    -d grant_type=client_credentials
    
    

    The response must be of content type JSON, and include in the response body the following parameters as top level JSON objects: access_token, and token_type. It may contain other parameters.

    Example:

    {
    "access_token": "<ACCESS TOKEN>",
    "token_type": "Bearer",
    "expires_in": 0,
    "scope": ""
    }
    

    Note that if the required parameters are returned in arrays or as nested parameters, they may not be processed correctly.

    Incorrect Example:

    {
    
    "authorization"
    
    {
    "access_token": "<ACCESS TOKEN>",
    "token_type": "Bearer",
    "expires_in": 0,
    "scope": ""
    }
    }

    Basic

    The data service must accept an Authorization header with the user name and password encoded as a base 64 string.

  • Embedded Complex types are not supported.

Procedure

  1. From the side navigation, choose Start of the navigation path Connections Next navigation step  (Add Connection)End of the navigation path.
    The Select a data source dialog will appear.
  2. Expand Acquire Data and select OData Services.
  3. In the New OData Services Connection dialog, enter a name for the connection.
  4. Optionally, you can select the following options:
    • Connect to an On-Premise OData service: Make sure to complete the prerequisites before connecting to an On-Premise source using a generic OData driver. If this option is not selected, the driver will connect to cloud OData data sources.
    • Connect to an SAP OData service: When you select this option, specific SAP metadata is respected. This metadata specifies default behaviors based on SAP OData services guidelines; for example, filterable and sortable are by default true, if not claimed to be false, and support basic filter operators. For more information see SAP Annotations for OData Version 2.0Information published on SAP site.
    Note
    Advanced features of customized OData data sources, such as SAP Hybris Cloud for Customer and SAP Business ByDesign Analytics, are only available using customized data source types. These features are not available using generic OData services. It is highly recommended to use the relevant customized data source types, if available, for your data service to leverage full capability of the data connector. It is possible to request a customized OData data source solution.
  5. If you are connecting to an on-premise OData service, select the Location of your Cloud Connector from the list.
  6. Enter the Data Service URL published during your configuration.
    Note
    You may add extra URL parameters in the Data Service URL field, to accommodate data-source-specific constraints on authentication. For example, you may pass in the saml2=disabled parameter to disable SAML, or sap-system-login-basic_auth=X to disable custom login. All the parameters entered in the Data Service URL field (anything following "?" in the URL) are only used in the authentication flow, and are ignored in the data queries.

    To add parameters to the URL, use the & separator between parameters.

    Note

    To successfully create a connection, a document that describes the services metadata must exist and be accessible at {the URL you enter in the Data Service URL field}/$metadata.

  7. Select the authentication type.
    The following authentication types are available:
    • Basic Authentication
    • OAuth 2.0 Client Credentials
    • OAuth 2.0 Authorization Code
    • No Authentication
  8. Provide the authentication details based on the authentication type you selected:
    • For Basic Authentication, enter the User Name and Password of the user you want to import data from.
    • For OAuth 2.0 Client Credentials, enter the OAuth Client ID, Secret, Token URL and Scope (if required) of the application you want to access.
    • For OAuth 2.0 Authorization Code, enter the OAuth Client ID, Secret, Token URL, Authorization URL and Scope (if required) of the application you want to access. Before the connection is created, you will be redirected to the Authorization URL of your application where you can authorize SAP Analytics Cloud to access your data.
  9. Choose Create.
    The new connection is added to the list of connections on the Connections screen.
  10. If you want to create a model based on this connection, see Import Data to Your Model.
    Note

    Select the Enable users to schedule for story publishing option if you want to let your users schedule the publishing of stories.