Creating Internal Data: Model Entity

Objective

After completing this lesson, you will be able to create and feed the model entity table.

The Model Entity

Defining Model Entity

A Model Entity functions similarly to a model table, which you might be familiar with if you have experience using SAP Profitability and Performance Management (PAPM). When configuring a Model Entity, you define which fields your table includes. Also, you must specify a key field to uniquely identify records within the table, typically using a UUID (Universal Unique Identifier).

Flowchart depicting creation of runtime environment from design-time environment, showing optional folders, fields, connections, functions, and components like Environment, HANA, ODATA, SAC, SOAP, Model Entity, and various processes.

Key Steps in Configuring a Model Entity

  • Specify Fields: Define the fields that your table includes. They could be customer names, e-mail addresses, purchase history, and so on.
  • Specify the Key Field: Use the value help tag section to specify which field serves as the key field. It is typically a UUID for unique identification.

Activating the Structure

Once you have configured the Model Entity structure, you must activate it. Activating the structure finalizes the table design, making it ready for data entry.

Data Entry and CSV Upload

You can store data in the configured and activated Model Entity using two primary methods:

  • Manual Entry: Directly enter data into the table.
  • CSV Upload: Import data from a CSV file. It is important to note that the Transport Data option must be set to Yes before you can export or import a CSV file.
  • Practical Insight: Suppose you receive a CSV file with updated customer addresses. You can upload this file to your customer data table, ensuring that all address records are up to date without manual data entry.

Configuring Model Entity

After creating the Model Entity function through the Manage Functions application, you may need to perform more configurations. You can do it by:

  • Accessing the Manage Model Entities Application: Enter this application to make detailed configurations.
  • Using Semantic Links: From the Manage Functions application, use the semantic link to quickly access the Model Entity for further configuration.
  • Practical Insight: If you must add a new field PhoneNumber to the existing customer data table, use the Manage Model Entities application or the semantic link to open the specific Model Entity and make the necessary changes.

Settings and Configurations

This screen provides an overview of essential settings and configurations once a Model Entity has been created. Understanding how to navigate and use these settings will enhance your ability to manage Model Entities effectively.

An image displaying various data management functions for a model entity, including the ability to import data from a CSV file, export data to a CSV file, and erase data from the model entity. The image also shows options to undo/redo changes based on version timestamps.

Key Components and Options

Once the Model Entity is created, the General Information screen presents several key components and options:

  • Environment: This section indicates the environment in which the Model Entity is created. Clicking on this link will take you to the general information of that environment.
  • Practical Insight: For example, if your Model Entity is part of the "Sales Analysis" environment, clicking the environment link allows you to review and manage environment-specific settings.
  • Function: This link takes you to the Manage Functions screen where the specific function related to the Model Entity is configured.
  • Transport Data: This option must be set to "Yes" if you wish to transport data when moving or copying the function along with its environment. This setting is also required for CSV file operations (import/export).
  • Restrictions: You can set various restrictions to control user access, such as read-only or read-and-insert permissions. These settings allow you to manage data security and user interactions effectively.
  • Show Data: This option enables you to view and access the data stored within the Model Entity.

Configuration Buttons

In the top right corner of the screen, several buttons are available for making adjustments and handling data:

  • Edit: Allows you to change configuration settings, such as toggling the transport data option or uploading a different CSV file.
  • Import Data: Used to import data from a CSV file into the Model Entity.
  • Export Data: Generates a CSV file of the data stored in the Model Entity, making it easy to share or back up data.
  • Erase Data: Removes all data from the Model Entity, useful for resetting or clearing outdated information.
  • Undo and Redo: These functions allow you to revert or reapply the last configuration changes based on the version timestamp sequence. The timestamp is generated whenever you save your configuration, providing a history of changes.
  • Practical Insight: If you mistakenly configure a setting or import the wrong CSV file, you can use the undo button to revert to the previous configuration, ensuring no crucial data is lost.

Importance of General Information Screen

Efficient use of the General Information screen ensures:

  • Ease of Navigation: Quick access to related environments and functions.
  • Data Management: Effective handling of data transport, import, and export operations.
  • Configuration Control: Ability to revert changes and maintain a history of configurations for audit and troubleshooting purposes.

Set Version: Allows you to choose a specific version timestamp.

The image displays various data management functions for a model entity, including the ability to set a specific version timestamp, import and export data, erase data, undo/redo changes, and add association fields.

Transport Data

The Transport Data option is crucial if the data in the model entity needs to be moved along with the environment to subsequent tenants. Note that this could lead to larger zipped files due to the inclusion of data in the package.

The image displays a data management interface for a model entity. It shows options for transport data, file upload, and data restriction. The transport data option allows transporting the data to succeeding tenants along with the environment. The file option allows uploading data records formatted as CSV files. The restriction options include disabling data draft, insert only, insert and read, and read only.

Key Benefits

  • Consistency: Ensures data and environment settings remain aligned across different instances.
  • Ease of Migration: Facilitates seamless data transfer, reducing the risk of data loss or inconsistencies.
  • Practical Insight: Consider a scenario where you're promoting your testing environment to a production environment. By selecting "Transport Data," you ensure all necessary configurations and datasets are moved together, which minimizes setup time and potential errors in the production environment.

File Upload for Data Records

The File option allows you to upload data records formatted as CSV files. These records are then considered for import into the model entity structure during the environment activation process.

Key Features:

  • CSV Support: Simplifies the process of bulk data management.
  • Efficient Import: Streamlines data entry, ensuring accurate and quick uploads.
  • Practical Insight: Suppose you have a list of inventory items stored in a CSV file. By using the File option, you can upload this inventory directly into your model entity, saving time and reducing manual entry errors.

Text File for Localized Descriptions

The Text File option is designed for defining translations of fields tagged with "Localized Description". This option enhances accessibility by supporting multiple languages within your application.

CSV File Requirements:

  • Key: Identifier for the field.
  • Localized Description: Translated description.
  • Locale: Language code (e.g., "en" for English, "fr" for French).
  • Practical Insight: Imagine you are managing a global customer database. Using the Text File option, you can upload translations for customer titles or product descriptions, allowing users to view this information in their native language, enhancing user experience.

Restriction Options for Model Entities

Setting restrictions ensures controlled access and operations on data records. Here are the available restriction options:

Restriction Options for Model Entities

Restriction OptionsFunctionality
Disable OData DraftAllows reading and inserting data records, with updates permitted only for functions with composition relationships.
Insert OnlyPermits data record insertion through the Show Screen but disallows updates for created functions.
Insert and ReadEnables reading and inserting data records via the Import Data feature only, and not from activities. Updates to created functions are not allowed.
Read OnlyRestricts operations to reading data records, ensuring data integrity and preventing modifications.
Practical InsightIn a customer feedback application, you might use the "Insert Only" restriction to allow users to submit feedback. This ensures that once submitted, feedback entries remain unchanged, maintaining their integrity and authenticity.

Field Purpose Definitions

Properly defining the purpose of fields within your model entity is crucial for data accuracy, consistency, and usability. There are specific options you can choose from, each serving a unique function.

The image displays a data field management interface. It shows various field options, including the field name, description, alternative key description, key, and control type. The control type options include Hidden to hide marked fields and Read Only to restrict editing of the fields. The selected fields are displayed as columns in the structure.

Alternative Key

  • Purpose: Specifies an alternative field for searching or displaying values instead of the default key field.
  • Benefits: Enhances data retrieval flexibility without altering the primary key structure.
  • Practical Insight: In a product inventory system, you might use an "Alternative Key" such as a product SKU alongside the primary product ID. This allows users to search for products using either the SKU or the product ID, enhancing user experience.

Description

  • Purpose: Provides a descriptive label for the entered value of master data.
  • Benefits: Improves user comprehension by adding context and meaning to data entries.

Key

  • Purpose: Acts as a unique identifier for data records, ensuring that each record can be distinctly identified.
  • Characteristics: Keys are always mandatory in a model entity and must be unique.

Data Types

  • Characteristic: Qualitative attributes typically described by a "String" data type.
  • UUID: Universally Unique Identifier, a 128-bit number that ensures uniqueness across all records.
  • Practical Insight: In a customer relationship management (CRM) system, a customer ID (Key) ensures that each customer has a unique identifier, preventing duplication and aiding in consistent data management.

Mandatory Option

The Mandatory option is a critical setting that designates a field as required. By default, this option is unchecked.

When to Use:

  • Keys: For fields tagged as "Key", marking this checkbox is recommended as the key field is always mandatory to ensure data integrity.
  • Important Fields: Use for other essential fields where data completeness is crucial for business processes.
  • Impact: Ensures that crucial data fields are always filled, preventing incomplete data entries and maintaining the integrity of the dataset.
  • Practical Insight: In an e-commerce platform, marking the "Product ID" and "Product Name" fields as mandatory ensures that every product added to the inventory has these essential details, which are critical for search, display, and transactional processes.

Data upload Tips and Tricks

As already mentioned, we can use model entity for CSV upload.

They are several tips and tricks that you should keep in mind when using this option for uploading the data.

The image shows guidelines for formatting numeric values, specifically that decimals should be separated by a period (.) and commas should be avoided for thousands separators. It also provides instructions for opening the file in Notepad, replacing commas with semicolons, and saving the file as a CSV file to be used for uploading the data.

You are wondering how to create a function in the Universal Modeling? Watch this video: