Working with the OData Service

Objective

After completing this lesson, you will be able to use OData service in the Universal Model.

The OData Service

This lesson introduces you to the technical aspects of connecting your Universal Mode environment with OData service.

In Manage Connections Applications, we must create a connection to OData Service. This type of connection allows you to integrate an OData service, such as SAP PaPM Cloud Standard Model to Universal Model or SAP S/4HANA.​

To pull in data using an OData connection, the next options must be enabled:

  • Environment: The environment where the connection is created. Choosing the linked environment ID directs you to the environment's General Information screen.
  • Connection*: Composed of up to 10 characters of capital letters and numbers with no space in between, such as CONNODTA.
  • Description*: Composed of a text with up to 200 characters that often provides connection information, such as Connection to Remote OData.
  • Connection Target Type: A read-only field providing connection target type information.
  • Model Filter: Used to filter out the models coming from the target to the ones which match the expression (pattern). Supports JavaScript regular expressions.
  • Destination Name: Lists all HTTP type destinations from the SAP BTP subaccount.
  • Service Path: Path which indicates the specific location of the service to be used. It is appended to the base URL from the created destination in SAP BTP forming the complete service URL. Query options such as question marks are not allowed.
  • Parent Folder: Select a folder function (created in the same environment as the OData Service connection) from the dropdown list. Once set, all models synced from the connection to the environment have this folder as parent so that you do not need to maintain them manually one by one in the environment.
  • Default Key Field: Existing environment field of data type String or UUID created by the user and not registered from a different connection. If the service does not contain any unique key or contains a key that does not use the mentioned data types, the Default Key Field is added to the connection model fields and serves as its key. The system converts all other fields that were marked as keys in the service definition and do not have an allowed data type to alternative keys of the model.

After you filled in the data and created a connection, the system automatically consumes data available in the OData service.​

If you don’t want to consume all these tables, you can click on edit in the right top corner and select only those tables which are relevant for you.

Inbound - ODATA Integration

To consume data from the SAP HANA Schema, you need to establish a connection.

The image shows a user interface for creating a connection, with various connection target types listed, including HANA Schema, OData Service, SAC Model, and Soap Service. The image also provides information about the Manage Connections application, which allows access to the list of available connections in the tenant and provides access to the HANA Schema, which allows consuming data from the underlying database through a specific schema.

This can be achieved in two primary ways:

Manage Connections Application

  • Functionality: This application provides access to the list of all available connections in the tenant.
  • Benefits: Centralized management of connections, easy updates, and configurations.

Steps:

Navigate to the Manage Connections application. Locate the connection type for HANA Schema. Create or modify the connection details to link with the appropriate HANA Schema.

Environment Access

  • Functionality: Create a connection directly from environmental settings, using the connection hyperlink.
  • Benefits: Quick and direct access without navigating through multiple applications.

Steps:

Access the environment settings. Use the provided connection hyperlink to establish or modify the HANA Schema connection.

Connection Types and Management

As mentioned, the Manage Connections application offers a centralized platform to manage all available connections within the tenant. One of these critical connections is to the HANA Schema.

Connection to HANA Schema

  • Purpose: Enables data consumption from the underlying SAP HANA database through a specified schema.
  • Benefits: Seamless integration with HANA data, supporting complex queries and real-time analytics.

When setting up a connection to the HANA Schema, it's crucial to fill in the general information accurately. This section serves as the backbone of your configuration, ensuring that all the necessary details are in place for seamless integration.

The image shows a user interface for creating a connection, with a read-only field providing connection type target information. The connection is composed of up to 10 characters of capital letters and numbers with no space in between.

Environment

  • Description: This field specifies the environment where the connection is created.
  • Functionality: Selecting the linked environment ID will direct you to the environment's General Information screen, providing an overview of the environment settings.
  • Importance: Ensures the connection is associated with the correct environment, maintaining organization and clarity within your system.
  • Practical Insight: In a multi-tenant setup where you might have separate environments for development, testing, and production, ensuring that the connection is created in the correct environment is critical. This practice minimizes cross-environment data contamination and maintains data integrity.

Connection

  • Description: The connection name should be composed of up to 10 characters, including capital letters and numbers, with no spaces in between (e.g., "RTSCHEMA").
  • Functionality: Acts as a unique identifier for the connection within the environment.
  • Best Practices: Use a naming convention that reflects the purpose or target of the connection, making it easily recognizable and manageable.
  • Practical Insight: If you're setting up a connection to the SAP HANA Schema for real-time sales data analytics, naming the connection "SALESDATA" can make the purpose clear to anyone managing or using the environment.

Description

  • Description: This field allows you to add a text description of up to 200 characters. The description should provide relevant details about the connection.
  • Functionality: Offers an overview or purpose of the connection, aiding in easy identification and management.
  • Best Practices: Include information such as the target database, the purpose of the connection, and any other relevant details that can help users understand the connection at a glance.
  • Practical Insight: A description like "Connection to HANA Schema for real-time sales transactions and inventory data" provides clarity and context, making it easier for administrators and users to understand the connection's role.

Connection Target Type

  • Description: This is a read-only field that provides information about the connection target type.
  • Functionality: This field helps validate and confirm the nature of the connection, ensuring that it is correctly set up to target the intended HANA Schema.
  • Practical Insight: For administrators setting up multiple connections, the Connection Target Type acts as a quick reference to verify that the connection aligns with the intended schema, reducing the risk of misconfigurations.
The image shows a user interface for creating a connection, with a read-only field providing target HANA schema information. If the checkbox is unmarked, the non-tenant-specific connections used by an environment from the source tenant are considered and transported to the target tenant.
  • Tenant-Specific: If this checkbox is unmarked, upon container transport the non-tenant-specific connections used by an environment from the source tenant are considered and transported to the target tenant.
  • Target Schema: A read-only field providing target HANA schema information.
  • Model Filter: Used to filter out the models coming from the target to the ones which match the expression (pattern). Supports JavaScript regular expressions.

After you filled in the data and created a connection, the system will automatically consume all HANA tables stored in specific HANA schema that we are using. If you don't want to consume all these tables, you can click on edit in the right top corner.

The image shows a table with information about various models, including their sync model, sync connection, original name, description, and model type. The table has 11 rows and 6 columns, displaying details about the models.

And deselect all the tables that you don't want to use. You can also use Model Filter option in general information to filter only those Tables that you actually would like to consume.

Sync Model: This checkbox allows you to decide if the model is considered when you choose the Sync Models button.

Access the next screen, using the arrow on the right side of the screen, to perform fields mapping.

The image shows a table with information about various models, including their sync model, sync connection, original name, description, and model type. The table has 11 rows and 6 columns, displaying details about the models.

You can select fields already existing in the environment to perform the mapping, or you can use option Add Field/Add fields to create new environment fields for all the unmapped connection fields in the selected models. These new fields have the same configuration as the connection fields.

After mapping is completed, click on apply. That will take you to the previous screen where you can click on Save and Sync Models button.

For marked models, choosing Sync Models automatically creates a Model HANA function in the environment. For unmarked models, choosing the Sync Models button does not create a Model HANA function in the environment.

If you have marked this previously and decide to unmark it afterwards, the Model HANA function synced is removed from the environment upon choosing the Sync Models button.

You also see that we have Sync Connection button: Sync Connection Allows you to decide if the changes to the structure made in the original table or view in the database schema, for example, adding or removing fields, are considered when you choose Sync Connection. For marked models, choosing Sync Connection updates the model with the new configuration.

For unmarked models, choosing Sync Connection does not update the model with the new configuration.

The image shows a table with information about model fields, including the original name, class, and type. The table has 7 rows and 4 columns, displaying details about the environment field, CAPITALGAIN, COMPANY_ID, CURRENCY_ID, DESCRIPTION1, DIVIDEND, and TAXFREEINCOME fields.

Now the Model HANA is created in your environment. Please keep in mind that you should reactivate environment after models synchronization.

After that the results will be available.

The image shows a table with information about various functions, including their function, description, and type. The table has 27 rows and 4 columns, displaying details about the UMDEMO_TABLES1 and UMDEMO_TABLES2 functions, which are of type Model HANA. Below the table, there is additional information displayed in a grid format, including the COMPANY_ID, DESCRIPTION1, DIVIDEND, TAXFREEINCOME, CAPITALGAIN, CURRENCY_ID, and Year fields.