Integrating HANA Scheme

Objective

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

The Model HANA Overview

In this chapter, we explore the Model HANA function type, which is integral for integrating, connecting, and consuming data from the SAP HANA Cloud Schema of the underlying database. Understanding how to use Model HANA empowers you to harness the robust capabilities of SAP HANA for real-time data processing and analytics.

The image is a data model diagram that shows the relationships and structure of various data elements. It includes entities such as Fields, Characteristics, Currencies, Units, and others, along with their associated attributes and connections. The diagram also includes a note indicating that upon activation, a runtime environment will be created from the design-time environment, even if the configured fields, functions, and so on are changed.

Overview of Model HANA

Model HANA is a specialized function type designed to facilitate the seamless integration of your data with SAP HANA Cloud. This function type acts as a bridge, enabling you to connect to the underlying HANA database and consume its data in a structured way.

Key Features

  • Data Integration: Seamlessly connect to and integrate with SAP HANA Cloud Schema.
  • Data Consumption: Efficiently consume data from HANA tables and views.
  • Real-time Processing: Use HANA's capabilities for real-time data analytics and processing.

Structure Representation

The structure of the synced HANA table or view is represented by a Model HANA function. This representation ensures that the data model within your application accurately mirrors the corresponding structure in the HANA Cloud Schema.

Inbound - Model Hana

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

The image shows a user interface for the Manage Connections application, which allows users to create and manage various connection types, including HANA Schema, OData Service, SAC Model, and Sap Service. The main section of the interface is labeled Create, where users can select the Connection Target Type from a dropdown menu, which includes the mentioned connection types. The right side of the image provides a brief description of the HANA Schema, which allows users to consume 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 managing connections, with a section labeled Connection Target Type that provides information about the connection type. It states that this is a read-only field providing connection type target information. The main section of the interface displays details about a specific connection, including the environment, connection type, and other relevant details. The bottom of the interface provides options to draft, create, or discard the connection.

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 managing connections, with a section labeled Target HANA Schema that provides information about the HANA schema target. This is a read-only field providing the target HANA schema information. The main section of the interface displays details about a specific connection, including the environment, connection type, and other relevant details. Below this, there is a Tenant-Specific section that explains that if the checkbox is unchecked, 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 user interface for managing models, displaying a list of 11 models with their associated information such as function, sync model, sync connection, original name, description, and type. The interface provides options to edit, delete, and sync the models. The models are related to various HANA database components.

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 user interface for managing HANA models. The interface displays a table with 11 models, providing details such as function, sync model, sync connection, original name, description, and type for each model. The models are related to HANA database components. The interface allows users to manage the models, including options to edit, delete, and sync them.

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 user interface for managing model fields. It displays a table with 7 model fields, including their original name, class, and type. The user can search, add, and delete fields. The fields include CAPITALGAIN, COMPANY_ID, CURRENCY_ID, DESCRIPTION1, DIVIDENO, TAXFREEINCOME, and YEAR, which appear to be related to financial data.

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 displays a user interface for managing functions related to a HANA model. The interface has two main sections: a list of 27 functions on the left, and a table of financial data on the right. The table includes fields for COMPANY_ID, DESCRIPTION1, DIVIDEND, TAXFREEINCOME, CAPITALGAIN, CURRENCY_ID, and YEAR, with values for several company holdings such as Moonlight, Starlight, Twilight, and Sunshine. The interface allows users to view, edit, and manage the functions and financial data associated with this HANA model.

The following video contains detailed step-by-step guidance on how to integrate with desired HANA Table in the specific HAHA Schema.