Sub topic 1
What Embedded Analytics Is and How It Is Built
Prerequisites
Assume you know basic SQL, SAP S/4HANA business objects, and the difference between OLTP and OLAP workloads. You should also know how to navigate the SAP Fiori launchpad.
Embedded Analytics
Embedded analytics runs reports and analytical applications directly on SAP S/4HANA transactional data. It uses the same current data that operational processes use, instead of first copying data into a separate data warehouse.
This reduces data duplication and latency. However, analytical queries still need careful modeling because joins, authorizations, and aggregations execute against the live system.
The main building block is an ABAP Core Data Services (CDS) view entity. A CDS view entity defines a reusable data model in the database layer. Associations describe relationships to related entities without requiring every consumer to write its own join.
@EndUserText.label: 'Customer'
define view entity ZI_CustomerDim
as select from zcustomer
{
key customer_id as CustomerId,
@Semantics.text: true
customer_name as CustomerName,
country as Country
}The Virtual Data Model
SAP’s Virtual Data Model (VDM) organizes CDS views into layers. Each layer has a different responsibility.
- Interface views provide stable, reusable business data. They usually represent a business object or part of one.
- Composite views combine interface views and add relationships or calculations needed by a business scenario.
- Consumption views shape data for a particular consumer, such as an analytical query, application, or service.
This layering separates reusable data from consumer-specific presentation. A change to one report should not require rebuilding the underlying business model.
Analytical Annotations and Data Categories
Annotations are metadata attached to CDS definitions or fields. Analytical annotations tell the framework how to interpret a view.
Typical data categories include:
#DIMENSIONfor descriptive entities such as customers or products.#CUBEfor measurable business events such as sales items.@Analytics.query: truefor a consumption view that defines an analytical query.
Other annotations define text fields, default aggregation, currencies, units, and associations. These declarations allow analytical tools to interpret the model consistently instead of guessing field meanings.
Exercise
Which VDM layer should contain consumer-specific row and column settings?
Show answer
The consumption layer, usually in an analytical query view.