Structuring the Model Entity with Reader

Objective

After completing this lesson, you will be able to integrate your environment with SAC.

Integration with SAC

In this lesson, we explore the integration with SAP Analytic Cloud (SAC) and pulling data from the SAC model.

Note

For SAC only, inbound is possible. No outbound to SAC is feasible.
Flowchart depicting the creation of a runtime environment from design-time components like fields, connection, and function. It includes modules like HANA, ODATA, SAC, SOAP, and processes like enrichment and processing.

You may have noticed that the Reader block has lit up and that is why pulling in the data from SAC is enabled via Model Entity with the Reader function.

To consume the data from SAC Model, we must create a connection to SAC. We have done something similar when connecting to HANA scheme, just in that case we used HANA scheme as connection target type. We choose this type as the connection target type. It can be done either from Manage Connections applications, or directly from the environment clicking on the connection hyperlink and accessing the Manage Connections application from there.

As we have already mentioned, the Manage Connections application provides access to the list of available connections in the tenant.​

One of them is the connection to the SAC Model. It allows you to integrate to specific SAP Analytics Cloud API through reading and writing via data export and data import.​

As prerequisite for this is that integration with SAC is established. You can learn more about how to do that in our module 3 where we go deeper into integration and authorization topics. This time, we show how to consume the data from the SAC model for which integration has already been done.

Integration Steps

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

The image shows a user interface for creating a new connection in the Manage Connections application. The interface includes fields for selecting the environment and connection target type. The available connection target types include HANA Schema, which allows consuming data from the underlying database through a specific schema. The image also includes a description of the Manage Connections application and the HANA Schema functionality.

This can be achieved in two primary ways. To consume data from the SAP HANA Schema, you need to establish a connection. 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 new connection. It includes a read-only field labeled Connection Target Type that provides information about the connection type. The interface also displays details about the connection, including the environment, description, and target HANA Schema. The connection is composed of up to 10 characters of capital letters and numbers with no spaces 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 managing connection target information. It includes fields for general connection details, a read-only section displaying target HANA schema information, and an option to mark the connection as tenant-specific if the container transport is for a non-tenant-specific environment. The interface provides options to draft updates, create new entries, and discard draft changes.
  • 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 displays a table of models, including their type, connection, original name, description, and target. The table can be edited, deleted, and synchronized with other models. The table provides an overview of various models related to HANA.

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 displays a table with a list of models, including their type, sync connection, original name, description, and target. The table can be searched, edited, deleted, and synchronized. The table provides an overview of various HANA-related 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 displays a table of model fields, including the Environment Field, CAPITALGAIN, COMPANY_ID, CURRENCY_ID, DESCRIPTION1, DIVIDEND, TAXFREEINCOME, and YEAR. Each field has an original name, class, and type displayed. The table can be searched, and additional fields can be added or edited.

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 table of functions and a table of company-related data. The functions table includes two UNDEEMO_TABLES functions, each with a description and type. The company data table shows details such as COMPANY_ID, DESCRIPTION1, DIVIDEND, TAXFREEINCOME, CAPITALGAIN, CURRENCY_ID, and Year for several companies.

Integration between SAC and Universal Model might be tricky. This video will uncover all relevant steps on how to pull-in the data from SAC Model.