In the SAP HANA Live and SAP S/4HANA landscape, consumption views play a vital role in delivering analytics-ready data models tailored for reporting and visualization tools. These views serve as the final layer in the data modeling hierarchy, designed specifically to be consumed by analytical applications such as SAP Fiori, SAP Analytics Cloud, or SAP BusinessObjects.
This article explores the concept of consumption views, their significance in analytical reporting, and how to create them effectively within the SAP HANA Live context.
Consumption views are CDS (Core Data Services) views crafted to provide a business-friendly, semantically rich dataset ready for analytical consumption. Unlike other CDS views focused on raw data or complex joins (such as basic or composite views), consumption views are fine-tuned for reporting purposes and typically include:
In essence, consumption views act as the presentation layer in SAP’s data modeling strategy.
Consumption views typically consume composite views or basic views that encapsulate transactional and master data.
define view ZSalesOrder_Consumption
as select from ZSalesOrder_Composite
{
key SalesOrderID,
CustomerName,
OrderDate,
NetAmount,
Currency
}
Annotations enrich consumption views with metadata to guide analytical tools on how to display or behave with the data.
Example annotations:
@Analytics.query: true
@Analytics.dataCategory: #CUBE
@UI.chart: [{ type: #COLUMN }]
@UI.selectionField: [{ position: 10 }]
These annotations indicate that the view is query-enabled, classified as a cube, supports chart visualizations, and includes fields for selection screens.
Calculated measures and key figures can be defined within the consumption view for direct reporting.
NetAmountInEUR: NetAmount * CurrencyConversionFactor
Secure sensitive data by integrating access control annotations or checking user roles.
@AccessControl.authorizationCheck: #CHECK
Variables allow dynamic filtering at runtime, improving user interactivity.
@Environment.systemField: #CLIENT
@Environment.systemField: #USER
@AbapCatalog.sqlViewName: 'ZSALES_CONS'
@Analytics.query: true
@AccessControl.authorizationCheck: #CHECK
define view ZSalesOrder_Consumption
with parameters
p_sales_org : vbak_vkorg
as select from ZSalesOrder_Composite
{
key SalesOrderID,
CustomerName,
OrderDate,
NetAmount,
Currency,
NetAmount * CurrencyConversionFactor as NetAmountInEUR
}
where SalesOrg = :p_sales_org
This view allows filtering by sales organization and calculates amounts in EUR, ready for consumption by analytical tools.
While SAP HANA Live initially emphasized HANA calculation views for real-time reporting, the evolution towards CDS-based consumption views offers better integration within the ABAP stack and SAP’s analytical frontends. CDS consumption views are now the standard approach for building analytics on top of SAP transactional data.
Creating consumption views is a critical step in building robust analytical reporting solutions in SAP HANA Live and S/4HANA environments. These views empower business users with timely, accurate, and meaningful data, supporting smarter decision-making.
By understanding how to design and implement consumption views—leveraging annotations, calculations, security, and parameters—developers can build scalable, maintainable, and user-friendly analytics that meet modern enterprise needs.