Mastering CDS Views: A Guide to Supported Capabilities and Modeling Patterns

With SAP’s Core Data Services (CDS) Views, developers can create, maintain, and reuse custom data models to meet their specific needs. In this guide, we will dive into the supported capabilities and modeling patterns of CDS Views, exploring how you can master the CDS views to unlock its full potential. From optimizing data management to improving data analysis, this guide will provide you with the knowledge and skills you need to succeed with SAP’s CDS Views.

SAP S/4HANA CDS Views

SAP S/4HANA’s virtual data model (VDM) is the foundation on which analytical apps and APIs (application programming interfaces) can access business data(often found in database tables) following consistent modeling. CDS views represent SAP S/4HANA Cloud and SAP S/4HANA VDM.

There are a wide variety of uses for CDS views, including developing Fiori apps and conducting data analysis. Your own unique CDS views can be made for such cases and these CDS views are derived from a huge pool of publicly released CDS views. It is often developers face difficulties to identifying the right CDS view for a given scenario or business requirement.

From S/4HANA 2020 SAP has added two new annotation features for CDS views—supported capabilities and modeling pattern—to aid in determining which CDS view to utilize in any given scenario.

Supported Capabilities for CDS Views

It is possible for a single CDS view to provide many capabilities such as a data source, association target, or analytical provider. Supported Capabilities indicates clear use cases for CDS views and provides an idea of the most efficient ways to use a CDS view.

The supported capabilities of a CDS view are defined using annotation and can be attached to any given CDS view. Each CDS view can have multiple supported capabilities. The annotation has the following syntax:

@ObjectModel.supportedCapabilities: [… , …]

The table below list the all supported capabilities annotation values that are currently available for CDS views:

Annotation Technical NameEnd-User Description
SQL_DATA_SOURCEData Source in SQL Select
CDS_MODELING_DATA_SOURCEData Source for Defining CDS Entities
CDS_MODELING_ASSOCIATION_TARGETAssociation Target for Defining CDS Entities
DATA_STRUCTUREData Structure
LANGUAGE_DEPENDENT_TEXTLanguage-Dependent Text
VALUE_HELP_PROVIDERData Provider for Value Help
EXTRACTION_DATA_SOURCEData Source for Data Extraction
DERIVATION_FUNCTIONDerivation Function for Default Values
PARENT_CHILD_HIERARCHY_NODE_PROVIDERData Provider for Hierarchy Information
SEARCHABLE_ENTITYData Source for Search
ANALYTICAL_QUERYAnalytical Query
ANALYTICAL_DIMENSIONAnalytical Dimension
ANALYTICAL_PROVIDERData Provider for Analytical Queries
ANALYTICAL_PARENT_CHILD_HIERARCHY_NODEData Source for Hierarchies in Analytics
OUTPUT_FORM_DATA_PROVIDEROutput: Form Data Provider
OUTPUT_EMAIL_DATA_PROVIDEROutput: Email Data Provider
OUTPUT_PARAMETER_DETERMINATION_DATA_SOURCEOutput: Parameter Determination
SITUATION_ANCHORSituation Handling: Anchor Object
SITUATION_TRIGGERSituation Handling: Trigger Object
SITUATION_DATACONTEXTSituation Handling: Data Context

Modeling Patterns for CDS Views

A modeling pattern describes the main intention of a CDS view. The modeling patterns of a CDS view are defined using annotation and can be attached to any given CDS view. Each CDS view can only have one modeling pattern.

The annotation has the following syntax:

@ObjectModel.modelingPattern: ...

The table below list the all modeling patterns annotation values that are currently available for CDS views:

DATA_STRUCTUREData Structure
LANGUAGE_DEPENDENT_TEXTLanguage-Dependent Text
VALUE_HELP_PROVIDERData Provider for Value Help
DERIVATION_FUNCTIONDerivation Function for Default Values
PARENT_CHILD_HIERARCHY_NODE_PROVIDERData Provider for Hierarchy Information
ANALYTICAL_QUERYAnalytical Query
ANALYTICAL_CUBEAnalytical Cube
ANALYTICAL_DIMENSIONAnalytical Dimension
ANALYTICAL_PARENT_CHILD_HIERARCHY_NODEData Source for Hierarchies in Analytics
OUTPUT_FORM_DATA_PROVIDEROutput: Form Data Provider
OUTPUT_EMAIL_DATA_PROVIDEROutput: Email Data Provider
OUTPUT_PARAMETER_DETERMINATION_DATA_SOURCEOutput: Parameter Determination
SITUATION_ANCHORSituation Handling: Anchor Object
SITUATION_TRIGGERSituation Handling: Trigger Object
SITUATION_DATACONTEXTSituation Handling: Data Context
NONENone

You can view the supported capabilities and modeling patterns of CDS views in the View Browser app. In the ABAP Development Tools, the information is available in an annotation at header level of a CDS view.

Summary

The introduction of supported capabilities and modeling pattern doesn’t have an effect on existing custom implementations of CDS views. However, it might make sense to look for different CDS views that are more appropriate for your implementations if you realize that their current use doesn’t fit the supported capabilities or modeling patterns.

2 thoughts on “Mastering CDS Views: A Guide to Supported Capabilities and Modeling Patterns”

  1. I am not sure where you’re getting your info, but great topic.
    I needs to spend some time learning much more or understanding
    more. Thanks for wonderful information I
    was looking for this info for my mission.

    Reply

Leave a Comment