Common Notes
Common Notes
PUBLIC
Warning
This document has been generated from the SAP Help Portal and is an incomplete version of the official SAP product
documentation. The information included in custom documentation may not re ect the arrangement of topics in the SAP Help
Portal, and may be missing important aspects and/or correlations to other topics. For this reason, it is not for productive use.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 1/119
12/10/2019
CDS Annotations
The following list summarizes all SAP annotations of the Data De nition Language (DDL) of ABAP CDS. SAP CDS annotations are
evaluated by SAP frameworks and can be either ABAP annotations or framework-speci c annotations.
AbapCatalog Annotations
AccessControl Annotations
ClientDependent Annotations
DataAging Annotations
EndUserText Annotations
Environment Annotations
MappingRole Annotations
Metadata Annotations
Semantics Annotations
Tip
To access help for an ABAP annotation, position the cursor on relevant annotation in the DDL source editor and choose F1 .
Framework-Speci c Annotations
CDS annotations that (as a rule) are evaluated during runtime by speci c frameworks such as SADL, BOPF, Analytics, or
Enterprise Search:
Analytics Annotations
AnalyticsDetails Annotations
Consumption Annotations
DefaultAggregation Annotations
EnterpriseSearch Annotations
Hierarchy Annotations
ObjectModel Annotations
OData Annotations
Search Annotations
Semantics Annotations
UI Annotations
VDM Annotations
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 2/119
12/10/2019
Tip
To access help for an framework-speci c annotation, position the cursor on relevant annotation in the DDL source editor and
choose F1 .
Related Information
ABAP CDS - Anotations
Analytics Annotations
Enable the Analytic Manager for multidimensional data consumption, performing data aggregation, and slicing and dicing data. BI
front ends like Design Studio and Analysis Office can consume the data via the Analytic Manager.
@Scope:[#VIEW]
Annotation Analytics
{
dataCategory : String enum { DIMENSION; FACT; CUBE; AGGREGATIONLEVEL; };
query : Boolean default true;
hidden : Boolean default true;
planning
{
enabled : Boolean default true;
};
dataExtraction
{
enabled : Boolean default true;
delta :
{
byElement : elementRef;
{
name : RefToElement;
maxDelayInSeconds : Integer default 1800;
detectDeletedRecords: boolean default true;
ignoreDeletionAfterDays : Integer;
};
};
};
writeBack
{
className : String;
};
};
Usage
The Analytic Manager needs a star schema (multidimensional) and a query to consume the data. Most annotations to de ne the
star schema in different CDS views are speci ed in ObjectModel annotations. The Analytics annotations also specify the
facts (center of the star schema), extraction capabilities for replicating data into further systems, and analytic query properties. A
semantic distinction can be made in the Analytics annotations between annotations that are relevant for the InfoProvider
(CUBE) level and annotations that are only relevant for analytic queries.
Annotation Meaning
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 3/119
12/10/2019
Annotation Meaning
Scope: #VIEW
Value Description
Example
Typical dimensions
view.
Scope: #VIEW
Note
This view must be annotated with Analytics.d
value AGGREGATIONLEVEL) or with ObjectMod
value #TEXT or #HIERARACHY .
Value Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 4/119
12/10/2019
Annotation Meaning
Scope: #VIEW
Note
If the eld is a time stamp, the system checks als
Semantics.systemDate.lastChangedAt:
Value Description
Scope: #VIEW
Value Description
Scope: #VIEW
Value Description
Analytics.dataExtraction.delta.byElement.ignoreDeletionAfterDays
This annotation only makes sense together with
Analytics.dataExtraction.delta.byEle
The extraction will ignore deleted records if they a
of days. The main purpose is archiving.
Example
If records are archived after two years then this v
this case, the deletion in the database tables will
older than 700 days.
Scope: #VIEW
Value Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 5/119
12/10/2019
Annotation Meaning
Scope: #VIEW
Values:
Value Description
Scope: #VIEW
Note
This view must be annotated with Analytics.q
Value Description
Note
The view has to sele
annotated with Ana
#AGGREGATIONLE
Scope: #VIEW
Note
This view must not be annotated with Analytic
Value Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 6/119
12/10/2019
Annotation Meaning
Note
Data will be selecte
from clause. The vi
annotated with the
as #DIMENSION, #C
and the DCL has to
from clause.
Scope: #VIEW
Note
Only relevant if Analytics.dataCategory:
Analytics.dataCategory: #FACT.
Value Description
Examples
Example 1
Sample Code
{
key snwd_employees.node_key as EmployeeUUID,
@ObjectModel.foreignKey.association: '_Company'
snwd_employees.parent_key as CompanyUUID,
...}
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 7/119
12/10/2019
Example 2
Sample Code
@EndUserText.label: 'EPM Demo: Sales Order Item with Addtl. Data (private view)'
@Analytics.dataCategory: #CUBE
@AccessControl.authorizationCheck: #CHECK
@AbapCatalog.sqlViewName: 'SEPM_PSOIC'
{
@ObjectModel.foreignKey.association: '_SalesOr
key _SalesOrder.SalesOrder,
_SalesOrder_E,
...}
Related Information
ObjectModel Annotations
Semantics Annotations
AnalyticsDetails Annotations
Enable application developers to specify the default multidimensional layout of the query, the sequence of variables in UI
consumption, and the speci c aggregation and planning behavior of the data. All these annotations can only be used in views with
@Analytics.query : true.
@Scope:[#ELEMENT]
Annotation AnalyticsDetails
{
query
{
formula : String;
axis : String enum { FREE; ROWS; COLUMNS; };
totals: String enum { HIDE; SHOW; };
scaling : Integer;
decimals : Integer;
displayHierarchy : String enum { OFF; ON; FILTER; };
hierarchyBinding : array of
{
type : String enum { ELEMENT; PARAMETER; CONSTANT; USER_INPUT; };
value : String;
variableSequence : Integer;
};
hierarchySettings: {
hidePostedNodesValues: Boolean default true
};
elementHierarchy: {
parent: RefToElement;
initiallyCollapsed: Boolean default true
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 8/119
12/10/2019
};
};
exceptionAggregationSteps : array of
{
exceptionAggregationBehavior : String enum { SUM; MIN; MAX; COUNT; AVG; STD; FIRST; LAST};
exceptionAggregationElements : array of elementRef;
};
planning
{
enabled : Boolean default true;
disaggregation : String enum { NONE; TOTAL; DIFFERENCE; };
distribution : String enum { EQUAL; PROPORTIONAL; PROPORTIONAL_REF; };
distributionReference : elementRef;
};
resultValueSource : String enum { CUBE; DIMENSION; };
};
@Scope:[#PARAMETER, #ELEMENT]
Annotation AnalyticsDetails
{
query
{
variableSequence : Integer;
};
};
Usage
Annotation Meaning
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 9/119
12/10/2019
Annotation Meaning
Caution
The default aggregation behavior cann
cube layer.
Note
Example: A measure "Inventory" can be
dimensions, but not for time – accordin
Note
Example: In the query there is a measu
positive sales - where sales is a measur
SUM. When the sales measure is now u
exceptionAggregationBehavior
Customer, the sales must rst be agg
to be performed. If the sales for a custo
1 (otherwise it is set to 0). This number
Scope: #ELEMENT
Value Descri
SUM sum
MIN minim
MAX maxim
COUNT counte
AVG averag
STD standa
FIRST FIRST
LAST LAST
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 10/119
12/10/2019
Annotation Meaning
Scope: #ELEMENT
Value Descri
Scope: #ELEMENT
Value Descri
NONE No Dis
TOTAL Disagg
DIFFERENCE Disagg
Scope: #ELEMENT
Value Descri
EQUAL Equal d
PROPORTIONAL Propor
PROPORTIONAL_REF Propor
selecti
Analy
annota
Scope: #ELEMENT
Value Descri
elementRef Name
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 11/119
12/10/2019
Annotation Meaning
Scope: #ELEMENT
Value Descri
true The m
the de
false The m
Scope: #ELEMENT
Value Descri
FREE Defaul
ROWS
COLUMNS Defaul
Scope: #ELEMENT
Value Descri
Scope: #ELEMENT
Value Descri
OFF No dis
ON With d
Analy
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 12/119
12/10/2019
Annotation Meaning
Scope: #ELEMENT
Value Descri
String This ex
AnalyticsDetails.query.hierar
lled (by a constant, a parameter, a lter
Scope: #ELEMENT
Value Descri
#ELEMENT Name
lter v
#PARAMETER Param
#CONSTANT Consta
#USER_INPUT USER_
analyt
same n
The va
Analy
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 13/119
12/10/2019
Annotation Meaning
Scope: #ELEMENT
Value Descri
String(512)
Note
You can also use the annotation
Consumption.filter.hierarchy
Scope: #ELEMENT
Value Descri
Integer This nu
the use
Scope: #ELEMENT
Value Descri
Scope: #ELEMENT
Value Descri
HIDE Totals
elemen
SHOW In add
set for
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 14/119
12/10/2019
Annotation Meaning
Value Descri
Integer Order
contai
Scope: #ELEMENT
Value Descri
Boolean true i
Scope:#ELEMENT
Value Descri
elementRef Alias o
entry.
Scope:#ELEMENT
Value Descri
Boolean true i
Scope: #ELEMENT
Value Descri
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 15/119
12/10/2019
Annotation Meaning
Examples
Example 1
Calculated Elements
Sample Code
@Analytics.query : true
define view fincancial as select from sales
{
@AnalyticsDetails.query.axis : #ROWS
product,
@AnalyticsDetails.query.axis : #COLUMNS
@AnalyticsDetails.query.formula : 'revenue - cost'
1 as absolute_margin,
1 as relative_margin,
Example 2
Sample Code
@Analytics.query : true
with parameters
cost_center_hier_param : String
...
@AnalyticsDetails.query : {
displayHierarchy: #ON,
hierarchyBinding :
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 16/119
12/10/2019
costs,
...
Example 3
The system supports variables like $session.system_date for different use cases:
in cube parameters
Sample Code
@Analytics.query : true
define view …
as select from zCostCenter_Flt( P_KeyDate: $session.system_date )
Sample Code
} where
DateTo >= $session.system_date and
DateFrom <= $session.system_date
Sample Code
Sample Code
Related Information
DefaultAggregation Annotations
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 17/119
12/10/2019
Consumption Annotations
De ne a speci c behavior that relates to the consumption of CDS content through domain-speci c frameworks.
@Scope:[#ELEMENT, #PARAMETER]
Annotation Consumption
{
labelElement : elementRef;
valueHelp : elementRef;
hidden : Boolean default true;
derivation
{
lookupEntity : entityRef;
resultElement : elementRef;
resultElementHigh : elementRef;
binding : array of
{
targetParameter : parameterRef;
targetElement : elementRef;
type : String(10) enum { PARAMETER; CONSTANT; };
value : String(512);
};
};
};
@Scope:[#VIEW, #TABLE_FUNCTION, #PARAMETER, #ELEMENT]
Annotation Consumption
{
semanticObject : String;
};
@Scope:[#ELEMENT]
{
derivation.resultHierarchyNode:
{
nodeTypeElement : elementRef ;
mapping: array of { hierarchyElement : elementRef ;
lookupElement: elementRef } };
filter
{
mandatory : Boolean default true;
selectionType : String(20) enum { SINGLE; INTERVAL; RANGE; HIERARCHY_NODE; };
multipleSelections : Boolean default true;
defaultValue : Expression;
defaultValueHigh : Expression;
defaultHierarchyNode: { nodeType : elementRef ;
node : array of { element : elementRef;
value : expression } };
hidden : Boolean default true;
hierarchyBinding : array of
{
type : String(10) enum { ELEMENT; PARAMETER; CONSTANT; USER_INPUT; };
value : String(512);
variableSequence : Integer;
};
};
groupWithElement: elementRef;
};
@Scope:[#PARAMETER]
Annotation Consumption
{
defaultValue : Expression;
};
Usage
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 18/119
12/10/2019
Via these annotations, the speci c behavior is de ned which is related to the consumption of CDS content. This metadata makes
no assumptions about the concrete consumption technology/infrastructure, but it is applicable across multiple consumption
technologies (e.g. Analytics or OData).
Annotation Meaning
Scope: #PARAMETER
Values:
Note
The defaultValue annotation is only allowed for View
values can only be speci ed within lters. Hence, the ann
@Consumption.filter.defaultValue has to be us
Note
Annotation of a non- ltered element of the projection list
Value Description
elementRef
Value Description
parameterRef
Value Description
#ELEMENT
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 19/119
12/10/2019
Annotation Meaning
#PARAMETER
#CONSTANT
Note
If parameter values are used in this sub-annotation, the c
declared before the parameter that is to be derived.i
Note
All provided annotation values are treated case sensitive.
Value Description
Values: Description
entityRef
Values: Description
elementRef
Values: Description
elementRef
Example
1000/4711 is a costcenter which has further costcenter
Example
If the selected record from the lookup entity is equal to (n
costCenter) = (space, 1000, 4711) means always the leaf.
the node. If this does not exist, then it is interpreted as a
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 20/119
12/10/2019
Annotation Meaning
Values: Description
Caution
Consumption.filter.de
an element name which desc
hierarchyElement :
elementRef
lookupElement:
elementRef
Scope: #ELEMENT
Consumption.filter.defaultValue
Consumption.filter.hidden
Consumption.filter.mandatory
Consumption.filter.multipleSele
Consumption.filter.selectionTyp
Consumption.filter.defaultValue
Consumption.filter.defaultHiera
Consumption.filter.hierarchyBin
Consumption.filter.hierarchyBin
Consumption.filter.hierarchyBin
Note
This element should be exposed by UIs. UIs based on Ana
variables.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 21/119
12/10/2019
Annotation Meaning
Value Description
Value Description
Value Description
elementRef
element :
elementRef
Consumption.filter.hidden The lter will not be shown in the UIs. In combination with
at runtime without user interaction.
Value Description
Value Description
#CONSTANT Constant
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 22/119
12/10/2019
Annotation Meaning
Value Description
String(512)
Note
You can also use the annotation
AnalyticsDetails.query.hierarchyBinding.v
Value Description
Consumption.filter.mandatory To prompt the “Filter UI” to enforce a user entry for a (sem
default value exists (for example, de ned through a CASE e
Example
The user deletes the proposal for a mandatory lter in th
message "Please enter a value for lter ...". After the user
is then sent to the engine. Therefore, the Filter UI ensures
engine is never performed for mandatory lters.
Value Description
Boolean (true,
false)
Value Description
selectionType IN list
SINGLE and
multipleSelections
= true
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 23/119
12/10/2019
Annotation Meaning
Value Description
Scope: #ELEMENT
Note
Whenever such elements are used for querying grouped
should also be included in the query's "group by" express
Value Description
elementRef
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 24/119
12/10/2019
Annotation Meaning
Note
The eld will not be exposed to UIs.
Value Description
Note
We recommend to use ObjectModel.text.element
Consumption.labelElement annotation.
Value Description
elementRef
Example
SAP Fiori has introduced the concept of intent-based nav
combination of <semanticObject> <action>. A sem
SAP Fiori UIs to dynamically derive navigation targets for
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 25/119
12/10/2019
Annotation Meaning
Value Description
Analytic Manager
Value Description
elementRef
Examples
Example 1
The annotations Consumption.labelElement and Consumption.quickInfo are used to link the corresponding text and
ID elds:
Sample Code
@Consumption.labelElement: 'CompanyName'
@Consumption.quickInfoElement: 'CompanyDescription'
so.buyer_guid AS BuyerGuid,
so.company_name AS CompanyName,
so.description AS CompanyDescription
}
Example 2
The annotation Consumption.groupWithElement is used to de ne that the element CompanyName depends semantically
on the element BuyerGuid. In the case of an aggregated table, the elds can be displayed combined:
Sample Code
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 26/119
12/10/2019
key so.sales_order_key AS NodeKey,
so.buyer_guid AS BuyerGuid,
@Consumption.groupWithElement: 'BuyerGuid'
so.company_name AS CompanyName,
so.currency_code AS CurrencyCode,
@DefaultAggregation: #SUM
so.gross_amount AS GrossAmount
}
Example 3
The annotation Consumption.hidden is used to prevent elds from being exposed by OData. The annotation, therefore,
prevents elds from being available to the client. This is necessary for system parameters because these parameters need to be
lled by the runtime-engine, but must not be available to the client:
Sample Code
@Consumption.hidden: true
so.buyer_guid AS BuyerGuid,
_Customer.company_name AS CompanyName
}
Example 4
The annotation Consumption.defaultValue is used to specify default values for parameters. In this example, the currency
EUR is used:
Sample Code
$parameters.p_TargetCurrency AS CurrencyCode,
currency_conversion(
amount => so.gross_amount,
source_currency => so.currency_code,
target_currency => $parameters.p_TargetCurrency,
exchange_rate_date => CAST( '20150101' AS abap.dats )
) AS GrossAmount
}
Example 5
The annotation Consumption.valueHelp is used to expose an association as a value help. In this example, the CDS view
CurrencyCodeValueHelp is used for the eld CurrencyCode:
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 27/119
12/10/2019
Sample Code
@Consumption.valueHelp: '_Currency'
so.currency_code AS CurrencyCode,
so.gross_amount AS GrossAmount
}
Example 6
The association Consumption.semanticObject is used to assign semantic objects to CDS views or elements that can be
used in the UI for intent-based navigation.
Sample Code
@Consumption.semanticObject: 'SalesOrder'
DEFINE VIEW SalesOrder
AS SELECT FROM sepm_cds_sales_order AS so
{
so.sales_order_id AS SalesOrderId,
@Consumption.semanticObject: 'BusinessPartner'
so.buyer_guid AS BuyerGuid,
}
Example 7
The annotation Consumption.filter is used to enable lters for values. In this example, product_hierarchy is ltered
for several single values of calendar_day, and for one single interval of product.
Sample Code
@Analytics.query : true
DEFINE VIEW product_hierarchy
AS SELECT FROM sales
{
...
@Consumption.filter : { selectionType : #SINGLE, multipleSelections : true}
calendar_day, //several single values are allowed
@Consumption.filter : { selectionType : #INTERVAL, multipleSelections : false }
product, // single interval allowed
...
}
Example 8
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 28/119
12/10/2019
The annotation Consumption.filter is used to enable lters for values. In this example, costcenter_reporting is
ltered hierarchically for the constant CONTR_AREA_10 and for the parameter cost_center_hier_param.
Sample Code
@Analytics.query : true
DEFINE VIEW costcenter_reporting
with parameters cost_center_hier_param : String
AS SELECT FROM costcenters
{
...
@Consumption.filter : {
selectionType : #HIERARCHY_NODE,
multipleSelections : false,
hierarchyBinding :
[ { type : #CONSTANT, value : 'CONTR_AREA_10' },
{ type : #PARAMETER, value : 'cost_center_hier_param' } ]
}
costcenter, // hierarchy node filter
costs,
...
}
Example 9
This example shows how to specify hierarchy nodes as default value in the Consumption.filter annotation. A consumption
view should provide a prompt for a hierarchy node of a costcenter hierarchy with default 1000/ALL (HierarchyNode).
Sample Code
Example 10
This example shows how to enable the Consumption.derivation annotation to return hierarchy nodes. The annotation
Consumption.derivation.resultHierarchyNode is used to return hierarchy nodes. Given a view
CostcenterResponsible with elds eld1, eld2, eld3, eld4, and responsible. The query view should lter by the
costcenter nodes the given responsible (parameter) is responsible for.
Sample Code
DefaultAggregation Annotations
Speci es aggregation behavior on element level
@Scope:[#ELEMENT]
Annotation DefaultAggregation : String enum { NONE; SUM; MIN; MAX; AVG; COUNT; COUNT_DISTINCT; FORMULA
Usage
Annotation Meaning
DefaultAggregation When the DefaultAggregation annotation has been speci ed for an element, the corresponding
elements are used as so called measures (elements that can be aggregated) in analytical scenarios.
These measures are aggregated automatically with the default Aggregation. In SQL SELECT statements
you have to specify the aggregation behavior explicitly.
Scope: [ELEMENT]
Evaluation Runtime (Engine): This annotation will be interpreted by the analytic manager.
Values:
Value Description
SUM, MAX, MIN, AVG, All these values determine the default aggregation of the measure.
COUNT, COUNT_DISTINCT
Caution
The analytic manager doesn't support the following values: AVG,
COUNT, COUNT_DISTINCT.
FORMULA The value FORMULA indicates, that the element is a formula which
has to be calculated after the operands have been determined by
aggregation or calculation. It should never be aggregated.
NONE This value indicates that the element is not a measure. Usually
these elements are used in lters and GROUP BY statements.
NOTE
If no DefaultAggregation annotation is assigned to an element, the engine assumes the aggregation behavior for values
FORMULA for formulas and NONE value (no aggregation takes place) for other select list entries. Since these are the default values
assumed when DefaultAggregation is absent, this annotation may be omitted altogether (Exception: addressing of
1ROWCOUNT - see example Counters and exception aggregation below).
Examples
Example 1
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 30/119
12/10/2019
For CDS views representing master data reports (i.e. the FROM clause refers to a CDS view categoriezed as #DIMENSION), a
counter of the different dimension values can be de ned by combining the annotation DefaultAggregation: #SUM with a
select list entry containing constant value 1:
Sample Code
@Analytics.query: true
controllingArea,
@DefaultAggregation: #SUM
This way no exception aggregation is involved which leads to improved performance of the report.
Note
This pattern can be combined with CAST statements (for reusing texts of DDIC data types) and/or CASE statements (for
de ning restricted measures). But you must not use other constants than 1 or add annotation
AnalytcisDetails.query.formula.
Related Information
AnalyticsDetails Annotations
EnterpriseSearch Annotations
Note
These annotations are currently only available for SAP-internal projects and not released for customer projects.
Note that SAP might change the behavior of this annotation in future. Consequently, functionality might change. Therefore,
usage is on your own responsibility for customer projects. SAP recommends not to use these CDS annotations in customer
projects.
filteringFacet : { default };
defaultValueSuggestElement : true;
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 31/119
12/10/2019
usageMode : array of String(20) enum
{
ADVANCED_SEARCH = 'AdvancedSearch';
AUTO_FACET = 'AutoFacet';
SUGGESTION = 'Suggestion';
};
presentationMode : array of String(20) enum
{
DETAIL = 'Detail';
HIDDEN = 'Hidden';
IMAGE = 'Image';
SUMMARY = 'Summary';
THUMBNAIL = 'Thumbnail';
TITLE = 'Title';
NONE = 'None';
};
commonAttributes : array of String(100);
snippets
{
enabled : Boolean default true;
beginTag : String(128) default '<b>';
endTag : String(128) default '<b>';
};
highlighted
{
enabled : Boolean default true;
beginTag : String(128) default '<b>';
endTag : String(128) default '<b>';
};
};
Usage
Annotation Meaning
EnterpriseSearch.enabled De nes if a CDS view is generally relevant for search scenarios based on SAP
HANA Enterprise Search.
Note
EnterpriseSearch annotations require the annotation
@Search.searchable for the same view.
Scope: #View
Values:
Value Description
Default: true
EnterpriseSearch.filteringFacet Speci es that the element is to be considered as a request eld which is used
for facetted search (also named interactive navigation or guided navigation).
Scope: #Element
Values:
Value Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 32/119
12/10/2019
Annotation Meaning
EnterpriseSearch.defaultValueSuggestElement Speci es that the element is to be considered for suggestions (also named
type-ahead or auto-completion function).
Scope: #Element
Values:
Value Description
Default: true
Related Information
Search Annotations
Hierarchy Annotations
Enables an application developer to specify a parent-child hierarchy that s/he wants to make explicitly accessible in a data model,
together with the structure that de nes this hierarchy.
@Scope:[#VIEW]
Annotation Hierarchy
{
parentChild : array of
{
name : String(127);
label : String;
multipleParents : Boolean default true;
recurseBy : elementRef;
recurse
{
parent : array of elementRef;
child : array of elementRef;
};
siblingsOrder : array of
{
by : elementRef;
direction : String(4) enum { ASC = 'ASC'; DESC = 'DESC'; } default #ASC;
};
rootNode
{
visibility : String(25) enum { ADD_ROOT_NODE_IF_DEFINED; ADD_ROOT_NODE; DO_NOT_ADD_ROOT_NODE;
};
orphanedNode
{
handling : String(20) enum { ROOT_NODES; ERROR; IGNORE; STEPPARENT_NODE; } default #ROOT_NODE
stepParentNodeId : array of String;
};
directory : associationRef;
};
};
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 33/119
12/10/2019
Usage
The parent-child hierarchy is based directly on the master data entities. The hierarchy is time-dependent if the master data entity
is as well. The hierarchy is de ned either by one parent element (with Hierarchy.parentChild.recurseBy) or by multiple
parents (with Hierarchy.parentChild.recurse). A parent element describes a self-referencing relationship within the
master data entity and will usually be de ned via an association. Only one level needs to be assigned to a parent-child hierarchy,
because the levels in the hierarchy are taken from the parent-child relationships between members associated with the parent
element. One or more parent-child hierarchies can be de ned within the same master data entity.
Note
A simple example of a parent-child hierarchy is the “Employee” master data. A “Manager” is an “Employee” and almost every
“Employee” is assigned to a “Manager”.
Annotation Meaning
Hierarchy.parentChild.directory For external hierarchies, the view of hierarchy nodes often contains t
multiple alternative hierarchies. A user is supposed to choose a sing
for display, and his/her selection is used as a lter when selecting fr
hierarchy node view. The directory annotation identi es an assoc
hierarchy directory association, from the hierarchy node view to a v
called hierarchy directory), providing all available alternative hierarc
hierarchy node view.
Scope: #VIEW
Value Description
Scope: #VIEW
Values (optional):
Value Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 34/119
12/10/2019
Annotation Meaning
Note
In a geographic hierarchy for example, you might want to assign th
Turkey to the continents Europe and Asia.
Caution
We need to distinguish the above use case from the following one:
hierarchy YEAR, QUARTER, MONTH January under 2011 and Janua
2012 are not the same member with multiple parents. They are diff
Januaries.
Scope: #VIEW
Value Description
Default: true
Hierarchy.parentChild.name Technical name of the hierarchy. Only relevant if the view de nes one
only, and Hierarchy.parentChild.directory is not used.
Scope: #VIEW
Value Description
Hierarchy.parentChild.orphanedNode.handling De nes how nodes without a parent (more precisely with a parent th
occur as a child) are processed.
Scope: #VIEW
Value Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 35/119
12/10/2019
Annotation Meaning
Hierarchy.parentChild.orphanedNode.stepParentNodeId De nes how nodes without a parent (more precisely with a parent th
occur as a child) are processed.
Scope: #VIEW
Value Description
Scope: #VIEW
Value Description
Scope: #VIEW
Value Description
Scope: #VIEW
Value Description
Hierarchy.parentChild.rootNode.visibility Using this annotation, you can de ne dedicated metadata for how to
node(s) in the hierarchy.
Scope: #VIEW
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 36/119
12/10/2019
Annotation Meaning
Value Description
Scope: #VIEW
Value Description
Hierarchy.parentChild.siblingsOrder.direction de n
order of values with the same parent is “ascending” or “descending”
Scope: #VIEW
Value Description
Examples
Example 1
Sample Code
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 37/119
12/10/2019
Example 2
Sample Code
Example 3
Sample Code
ObjectModel Annotations
Provide de nitions of structural as well as transactional related aspects of the business data model
@Scope:[#VIEW]
Annotation ObjectModel
{
lifecycle
{
enqueue
{
expiryBehavior : String enum { RELATIVE_TO_ENQUEUE_START; RELATIVE_TO_LAST_CHANGE; } default
expiryInterval : String;
notificationBeforeExpiryInterval : String;
};
processing
{
expiryBehavior : String enum { RELATIVE_TO_PROCESSING_START; RELATIVE_TO_LAST_CHANGE; } defau
expiryInterval : String;
notificationBeforeExpiryInterval : String;
};
};
modelCategory : String enum { BUSINESS_OBJECT; };
dataCategory : String enum { TEXT; HIERARCHY; };
representativeKey : keyElementRef;
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 38/119
12/10/2019
semanticKey : array of elementRef;
compositionRoot : Boolean default true;
transactionalProcessingEnabled : Boolean default true;
transactionalProcessingDelegated : Boolean default true;
createEnabled : Boolean default true;
updateEnabled : Boolean default true;
deleteEnabled : Boolean default true;
writeDraftPersistence : String;
writeActivePersistence : String;
entityChangeStateId : elementRef;
};
@Scope:[#ELEMENT]
Annotation ObjectModel
{
association
{
type : array of String enum { TO_COMPOSITION_CHILD; TO_COMPOSITION_PARENT; TO_COMPOSITION_ROOT;
};
createEnabled : Boolean default true;
text
{
element : array of elementRef;
association : associationRef;
};
hierarchy
{
association : associationRef;
};
foreignKey
{
association : associationRef;
};
readOnly : Boolean default true;
mandatory : Boolean default true;
enabled : Boolean default true;
};
Usage
Annotation Meaning
Scope: [ELEMENT]
Values:
Value Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 39/119
12/10/2019
Annotation Meaning
NOTE: In such a ca
the hierarchy must
@ObjectModel.c
true .
Scope: [VIEW]
Scope: [VIEW]
Scope: [VIEW]
Values:
Value Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 40/119
12/10/2019
Annotation Meaning
Scope: [VIEW]
Scope: [ELEMENT]
Scope: [VIEW]
Scope: [ELEMENT]
Scope: [ELEMENT]
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 41/119
12/10/2019
Annotation Meaning
RELATIVE_TO_ENQUEUE_START - The pe
from the point in time the exclusive durable
initially acquired.
Scope: [VIEW]
Scope: [VIEW]
Scope: [VIEW]
ObjectModel.lifecle.processing.expiryBehavior After the durable lock expiration phase has been pro
exclusive draft, the durable lock of its active docum
However for draft-aware applications it is still not al
draft related to the same active document until the
existing draft is expired.
Scope: [VIEW]
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 42/119
12/10/2019
Annotation Meaning
Scope: [VIEW]
Scope: [VIEW]
Scope: [ELEMENT]
Scope: [VIEW]
Values:
Value Description
ObjectModel.readOnly If this annotation has the value true, the eld must
the consumer.
Scope: [ELEMENT]
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 43/119
12/10/2019
Annotation Meaning
Scope: [VIEW]
Scope: [VIEW]
Scope: [ELEMENT]
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 44/119
12/10/2019
Annotation Meaning
Scope: [ELEMENT]
Scope: [VIEW]
a) writeActivePersistence: Active da
CDS view) is directly modi ed by the transa
(without having any kind of draft).
Scope: [VIEW]
Scope: [VIEW]
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 45/119
12/10/2019
Annotation Meaning
Scope: [VIEW]
Scope: [VIEW]
Caution
Do not use this annotation an more! It is replaced
ObjectModel.transactionalProcessingE
Scope: [VIEW]
Examples
Example 1
Sample Code
@ObjectModel.modelCategory: #BUSINESS_OBJECT
@ObjectModel.compositionRoot: true
define view I_SalesOrder
association [0..*] to I_SalesOrderItem as _Item ... {
@ObjectModel.association.type: #TO_COMPOSITION_CHILD
_Item, ...
}
Example 2
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 46/119
12/10/2019
This example demonstrates how you can de ne foreign key relationship.
Sample Code
@ObjectModel.representativeKey: ’Material’
define view I_Material ... {
key Material, ...
}
Example 3
Sample Code
@ObjectModel.dataCategory: #TEXT
@ObjectModel.representativeKey: ’Material’
define view I_MaterialText ... {
key Material,
@Semantics.language: true
key Language,
@Semantics.text: true
MaterialName,
@Semantics.text: true
MaterialDescription, ...
}
Example 4
Sample Code
Example 5
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 47/119
12/10/2019
Sample Code
@ObjectModel.compositionRoot: true
@ObjectModel.transactionalProcessingEnabled: true
@ObjectModel.writeDraftPersistence: ‘<DraftDDICTable>’
define view I_MaterialWithDraft ... {
...
}
OData Annotations
Capture OData-related aspects to expose data gained from a CDS entity in an OData service.
@Scope:[#VIEW, #TABLE_FUNCTION]
Annotation OData
{
publish : Boolean default true;
};
Usage
Annotation Meaning
Values:
Value Description
false De nes that this CDS entity cannot be exposed for an OData service
Note
When the CDS entity is activated, the OData service is generated automatically. After activation, it can be opened from the
ABAP Element Information popup of the corresponding database table.
Subsequently, the OData service also needs to be activated in the transaction /IWFND/MAINT_SERVICE manually.
Examples
This example demonstrates how you can de ne the SEPM_I_SalesOrder CDS entity that exposes data to an OData service.
Here, an OData service is generated for the CDS entity. The data is provided from the database table snwd_so.
Sample Code
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 48/119
12/10/2019
@OData.publish:true
define view SEPM_I_SalesOrder as select from snwd_so {
...
}
Related Information
Expose CDS View as an OData Service
Search Annotations
This annotation marks a view as searchable. You de ne the fuzziness threshold as well as the speci cs of term mappings at
element level.
@Scope:[#VIEW, #TABLE_FUNCTION]
Annotation Search
{
searchable : Boolean default true;
};
@Scope:[#ELEMENT]
Annotation Search
{
defaultSearchElement : Boolean default true;
ranking : String(6) enum { HIGH = 'high'; MEDIUM = 'medium'; LOW = 'low'; } default #MEDIUM;
fuzzinessThreshold : Decimal(3,2);
termMappingDictionary : String(128);
termMappingListID : String(32);
};
Usage
Annotation Meaning
Search.searchable De nes if a CDS view or entity is generally relevant for search scenarios. This annotation must be
set in case other search-related annotations are being de ned for elements of the respective CDS
view or entity. The annotation offers a general switch and a means to quickly detect whether a
view is relevant or not.
Scope: #View
Values:
Value Description
Boolean (true, false) De nes whether a view is relevant for search or not.
Default: true
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 49/119
12/10/2019
Annotation Meaning
Search.defaultSearchElement Speci es that the element is to be considered in a freestyle search (for example a SELECT…)
where no columns are speci ed.
Usually, such a search must not operate on all elements – for performance reasons, and because
not all elements (e.g. internal keys) do qualify for this kind of access.
Scope: #Element
Values:
Value Description
Search.ranking Speci es how relevant the values of an element are for ranking, if the freestyle search terms
match the element value.
Scope: #Element
Values:
Value Description
HIGH The element is of high relevancy; this holds usually for ID and
their descriptions.
MEDIUM The element is of medium relevancy; this holds usually for other,
important element. This is the default.
LOW Although the element is relevant for freestyle search, a hit in this
element has no real signi cance for a result item's ranking.
Search.fuzzinessThreshold Speci es the least level of fuzziness (with regard to some comparison criteria passed at runtime)
the element has to have to be considered in a fuzzy search at all.
Note
A fuzzy search enables a certain degree of error tolerance and returns records even if the
search term contains additional or missing characters or other types of spelling errors.
Note
To perform a fuzzy search you have to set the search mode to fuzzy in the customizing
settings of your ABAP system. Find the customizing node under SAP NetWeaver
Implementation Guide Search and Operational Analytics Enterprise Search Search
Con guration Set Parameters for Federated Search .
If in the customizing a value for Fuzzy Similarity is present, the value of the parameter
Search.fuzzinessThreshold will become void.
Scope: #Element
Values:
Value Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 50/119
12/10/2019
Annotation Meaning
Decimal (3,2) The least level of fuzziness the element has to have to be
considered in a fuzzy search at all, e.g. 0.7.
Search.termMappingDictionary Speci es the table that holds the term mappings (synonyms) to be considered in the context of a
search on this view.
Scope: #Element
Evaluation Runtime (Engine): No engine usage right now. Reserved for future usage.
Values:
Value Description
Search.termMappingListID Speci es one or multiple list IDs within the term mapping dictionary mentioned before.
The list is implemented as a column of the term mapping table, with the list ID as content of this
column. This concept has the aim to enable overarching term mapping dictionaries while being
able to separate domain-speci c content at the same time.
Scope: #Element
Evaluation Runtime (Engine): No engine usage right now. Reserved for future usage.
Values:
Value Description
Array of String(32) De nes one or more columns of the term mapping dictionary.
Semantics Annotations
Used by the core engines for data processing, analytics, and data consumption
@Scope:[#ELEMENT, #PARAMETER]
Annotation Semantics
{
telephone
{
type : array of String enum { HOME; CELL; WORK; FAX; PREF; TEXT; VOICE; VIDEO; PAGER; TEXT_PHONE
};
eMail
{
type : array of String enum { HOME; WORK; PREF; OTHER; } default #PREF;
address : Boolean default true;
from : Boolean default true;
sender : Boolean default true;
to : Boolean default true;
cc : Boolean default true;
bcc : Boolean default true;
subject : Boolean default true;
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 51/119
12/10/2019
body : Boolean default true;
keywords : Boolean default true;
received : Boolean default true;
};
name
{
fullName : Boolean default true;
givenName : Boolean default true;
additionalName : Boolean default true;
familyName : Boolean default true;
nickName : Boolean default true;
suffix : Boolean default true;
prefix : Boolean default true;
jobTitle : Boolean default true;
};
address
{
type : array of String enum { HOME; WORK; PREF; OTHER; } default #PREF;
city : Boolean default true;
street : Boolean default true;
streetNoNumber : Boolean default true;
number : Boolean default true;
country : Boolean default true;
region : Boolean default true;
subRegion : Boolean default true;
zipCode : Boolean default true;
postBox : Boolean default true;
label : Boolean default true;
};
organization
{
name : Boolean default true;
unit : Boolean default true;
role : Boolean default true;
};
calendarItem
{
summary : Boolean default true;
description : Boolean default true;
categories : Boolean default true;
dtStart : Boolean default true;
dtEnd : Boolean default true;
duration : Boolean default true;
due : Boolean default true;
completed : Boolean default true;
priority : Boolean default true;
class : Boolean default true;
status : Boolean default true;
percentComplete : Boolean default true;
contact : Boolean default true;
location : Boolean default true;
transparent : Boolean default true;
fbType : Boolean default true;
wholeDay : Boolean default true;
};
businessDate
{
at : Boolean default true;
from : Boolean default true;
to : Boolean default true;
createdAt : Boolean default true;
lastChangedAt : Boolean default true;
};
systemDate
{
createdAt : Boolean default true;
lastChangedAt : Boolean default true;
};
time : Boolean default true;
calendar
{
dayOfMonth : Boolean default true;
dayOfYear : Boolean default true;
week : Boolean default true;
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 52/119
12/10/2019
month : Boolean default true;
quarter : Boolean default true;
year : Boolean default true;
yearWeek : Boolean default true;
yearMonth : Boolean default true;
yearQuarter : Boolean default true;
};
fiscal
{
yearVariant : Boolean default true;
period : Boolean default true;
year : Boolean default true;
yearPeriod : Boolean default true;
};
geoLocation
{
longitude : Boolean default true;
latitude : Boolean default true;
cartoId : Boolean default true;
normalizedName : Boolean default true;
};
url
{
mimeType : elementRef;
};
contact
{
type : String enum {PERSON; ORGANIZATION; };
note : Boolean default true;
photo : Boolean default true;
birthDate : Boolean default true;
};
user
{
id : Boolean default true;
createdBy : Boolean default true;
lastChangedBy : Boolean default true;
responsible : Boolean default true;
};
mimeType : Boolean default true;
text : Boolean default true;
language : Boolean default true;
languageReference : elementRef;
};
@Scope:[#ELEMENT]
Annotation Semantics
{
amount
{
currencyCode : elementRef;
};
quantity
{
unitOfMeasure : elementRef;
};
currencyCode : Boolean default true;
unitOfMeasure : Boolean default true;
};
Usage
Semantic annotations are used to inform the client as to which of the elements contain a phone number, a part of a name or
address, or something relating to a calendar event. They must not be bound, for example, to a dedicated consumption channel.
They need to be available for consumption through OData, (S)QL, and so on.
Semantic annotations complement the concept of semantic data types, while semantic data types always introduce speci c
behavior in the provider/core infrastructure (through dedicated operations or conversion functions).
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 53/119
12/10/2019
Semantic annotations allow the standardizing of semantics that only have an impact on the consumption side (such as telephone
number, mail address, city, and so on).
Annotation Meaning
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations (Exception: Semantics.address.n
Values:
Semantics.address.type[ ] Description
Values:
String(10)
Value Description
Semantics.address.city Boolean default The annotated eld contains a plain-text string that contains the name of a city
true
Semantics.address.country The annotated eld contains a plain-text string that contains the name of a cou
Semantics.address.label The annotated eld contains a plain-text string representing the formatted add
Semantics.address.number The annotated eld contains a street number separated from a street name.
Semantics.address.postBox The annotated eld contains information about a post office box.
Semantics.address.region The annotated eld contains a plain-text string that contains the name of a reg
Semantics.address.subRegion The annotated eld contains a plain-text string that contains the name of a sub
Semantics.address.street The annotated eld contains a street name and a street number.
Semantics.address.streetNoNumber The annotated eld contains a street name separated from a street number.
Semantics.address.zipCode The annotated eld contains a numeric string that contains the ZIP code (type
Annotations belonging to Semantics.amount contain a monetary amount, and the corresponding currency code is contained in the reference
Scope: [ELEMENT]
Values:
Semantics.amount.currencyCode elementRef The annotated eld contains a monetary amount, and the corresponding curre
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 54/119
12/10/2019
Annotation Meaning
Annotations belonging to Semantics.businessDate contain information about changes of database table records.
Evaluation Runtime (Engine): *Business data often carries time validities. When accessing data, one usually intends to get the most current o
mandatory for the engine to know the semantics in order to carry out a generic validity evaluation.
Note
Many objects used in the Business Suite store data in a way that requires an algorithm to derive the actual data for a validity state. The anno
would yield incorrect results.
Values:
Semantics.businessDate.at* Boolean default The annotated eld indicates that the column contains the key dates and not i
true
Semantics.businessDate.createdAt* The annotated eld is the date (and time) when the database table record was
Semantics.businessDate.from* The annotated eld is the date timestamp or interval that de nes the validity o
business point of view.
Technical validity: The from date is different from the point in time when the
Semantics.businessDate.to*
confused with dates contained in the data part.
Semantics.businessDate.lastChangedAt The annotated eld is the date/time when the database table record was mod
It is usually identical to the creation date/time of the insertion, if the record ha
Evaluation Runtime (Engine): This is required to answer queries like "all chang
relevant, for example, for the ranking of a search result.
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Semantics.calendar.dayOfMonth Boolean default The value of the annotated eld is a day number relative to a calendar month.
true
Example
1 - 31
Semantics.calendar.dayOfYear The value of the annotated eld is a day number relative to a calendar year.
Example
1 - 366
Semantics.calendar.month The value of the annotated eld encodes a calendar month number as a string
digits.
Example
The string matches the regex pattern 0[1-9]|1[0-2]
Semantics.calendar.quarter The value of the annotated eld encodes a calendar quarter number as a string
digit.
Example
The string matches the regex pattern [1-4]
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 55/119
12/10/2019
Annotation Meaning
Semantics.calendar.week The value of the annotated eld encodes a calendar week number as a string f
digits.
Example
The string matches the regex pattern 0[1-9]|[1-4][0-9]|5[2-3]
Semantics.calendar.year The value of the annotated eld encodes a year number as a string following th
optional minus sign for years B.C., followed by at least four digits.
Example
The string matches the regex pattern -?([1-9][0-9]{3,}|0[0-9]{3})
Semantics.calendar.yearMonth The value of the annotated eld encodes a calendar year and month as a string
consisting of an optional minus sign for years B.C., followed by at least six digit
January to December.
Example
The string matches the regex pattern -?([1-9][0-9]{3,}|0[0-9]{3})
Semantics.calendar.yearQuarter The value of the annotated eld encodes a calendar year and quarter as a strin
consisting of an optional minus sign for years B.C., followed by at least ve dig
Example
The string matches the regex pattern -?([1-9][0-9]{3,}|0[0-9]{3})
Semantics.calendar.yearWeek The value of the annotated eld encodes a calendar year and week as a string
consisting of an optional minus sign for years B.C., followed by at least six digit
in the year.
Example
The string matches the regex pattern -?([1-9][0-9]{3,}|0[0-9]{3})
Annotations belonging to Semantics.calendarItem follow the iCalendar standard (RFC5545 ) for representing and exchanging calendaring a
journal entries, and free or busy information, independent of any particular calendar service or protocol
Values:
Semantics.calendarItem.categories Boolean default The value of the annotated eld is used to specify categories or subtypes of th
true searching for a calendar item of a particular type and category.
Semantics.calendarItem.class The value of the annotated eld provides a method of capturing the scope of th
information within an individual calendar entry.
The default value is PUBLIC. Other values are PRIVATE, CONFIDENTIAL, iana
name (experimental, non-standard parameter).
Note
Applications must treat x-name and iana-token values they do not recognize
Semantics.calendarItem.completed The value of the annotated eld de nes the date and time that a to-do was act
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 56/119
12/10/2019
Annotation Meaning
Semantics.calendarItem.contact The value of the annotated eld is used to represent contact information or alt
associated with the calendar item.
Semantics.calendarItem.description The value of the annotated eld provides a description of the calendar item.
Semantics.calendarItem.due The value of the annotated eld de nes the date and time that a to-do is expec
Semantics.calendarItem.duration The value of the annotated eld is used to identify properties that contain a du
Semantics.calendarItem.dtEnd The value of the annotated eld speci es the date and time that a calendar ite
Semantics.calendarItem.dtStart The value of the annotated eld speci es the date and time that a calendar ite
Semantics.calendarItem.fbType The value of the annotated eld speci es the free or busy time type.
Semantics.calendarItem.location The value of the annotated eld de nes a location related to a calendar compo
Example
LOCATION:Conference Room - F123\, Bldg. 002
LOCATION;ALTREP="http://xyzcorp.com/conf-rooms/f123.vcf
Semantics.calendarItem.percentCompl. The value of the annotated eld is used by an assignee or delegatee of a to-do
"organizer".
Semantics.calendarItem.priority The value of the annotated eld de nes the relative priority for a calendar item
Semantics.calendarItem.status The value of the annotated eld de nes the overall status or con rmation for t
Semantics.calendarItem.summary The value of the annotated eld de nes a short summary or subject for the ca
Semantics.calendarItem.transparent The value of the annotated eld de nes whether or not an event is transparent
Semantics.calendarItem.wholeDay The value of the annotated eld de nes whether or not an event covers whole
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values:
Value Description
Semantics.contact.birthDate Boolean default This annotated eld contains the birth date of the individual.
true
Semantics.contact.note This annotated eld speci es supplemental information or a comment that is
Semantics.contact.photo This annotated eld contains an image or photograph related to the contact.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 57/119
12/10/2019
Annotation Meaning
This can be either an ISO code or an SAP currency code (data type CUKY).
Scope: [ELEMENT]
Note
The attribute address should be used in case a mail address is included – independent from the specialized semantics from, sender, to,
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Semantics.email.type Description
Values: String
Value Description
Semantics.email.address Boolean default The value of the annotation contains the addresses of the sender and the recip
true mailbox or a group of mailboxes.
Semantics.email.bcc The value of the annotation contains the recipient list that receive an email, bu
recipients of the same email.
Semantics.email.cc The value of the annotation contains the recipient list that receive an email tha
Semantics.email.from The value of the annotation speci es the author(s) of a message. This can be a
Semantics.email.keywords The value of the annotated eld contains a comma-separated list of one or mo
Semantics.email.received The value of the annotated eld contains a trace information at the beginning o
receives a message for delivery or further processing.
Semantics.email.sender The value of the annotated eld speci es the mailbox of the agent responsible
example, if a secretary were to send a message for another person, the mailbo
Semantics.email.subject The value of the annotated eld contains the topic of the message.
Semantics.email.to The value of the annotation contains the recipient list that receive an email tha
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 58/119
12/10/2019
Annotation Meaning
Annotations belonging to Semantics. scal are required for time-based calculations in analytical use cases.
Evaluation Runtime (Engine): Some attributes contain the respective information (as plain integers), and the processor needs the semantics
Semantics. scal.period Boolean default A scal period is covered by nancial reports, for example, an annual report co
true report includes accounting data for three months.
The value of the annotated eld encodes a scal period as a string following th
scal period usually is a quarter of a year.
Example
The string matches the regex pattern [0-9]{3}
Semantics. scal.year The value of the annotated eld encodes a scal year number as a string follow
digits.
Example
The string matches the regex pattern [1-9][0-9]{3}
Semantics. scal.yearPeriod The value of the annotated eld encodes a scal year and period as a string fol
seven digits. The last three digits represent the scal period in the year.
Example
The string matches the regex pattern ([1-9][0-9]{3})([0-9]{3})
Semantics. scal.yearVariant The value of the annotated eld encodes a scal year variant, which describes
match the calendar year.
Values:
Semantics.geoLocation.longitude The value of the annotated eld speci es the longitude of the location such as
Semantics.geoLocation.normalizedName The value of the annotated eld contains the readable name of the location.
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData a
Semantics.languageReference This annotation references a eld that identi es languages. You can use this annotation if you can
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 59/119
12/10/2019
Annotation Meaning
Semantics.mimeType This annotation describes the mime type of a resource (identi ed by a URL or directly available as
This is required when accessing the document content, for example, in a content crawl, during tex
viewing.
In UIs, documents are usually presented with an icon that symbolizes their mime type.
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values:
Semantics.name.additionalName Boolean default The value of the annotation contains the second rst name of an individual.
true
Semantics.name.familyName The value of the annotation contains the surname of an individual.
Semantics.name.fullName The value of the annotation contains the full name of an individual.
Semantics.name.givenName The value of the annotation contains the rst name of an individual.
Semantics.name.jobTitle The value of the annotation contains the job title of an individual.
Semantics.name.pre x The value of the annotation contains the honori c pre x of an individual.
Semantics.name.suffix The value of the annotation contains the honori c suffix of an individual.
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values:
Semantics.organization.name Boolean default The value of the annotated eld contains the organization name.
true
Semantics.organization.role The value of the annotated eld specify the function or part played in a particu
Example
ROLE:Project Leader
Semantics.organization.unit The value of the annotated eld contains the name of the organization unit.
Annotations belonging to Semantics.quantity contain a measured quantity, and the corresponding unit of measure is contained in the referen
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values:
Semantics.quantity.unitOfMeasure elementRef The value of the annotated eld speci es a unit of measure related to a measu
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 60/119
12/10/2019
Annotation Meaning
Annotations belonging to Semantics.systemDate specify the date/time that is recorded by the technical infrastructure/database.
Note
The sub-annotations have the same semantics as the equally named attributes of the businessDate annotation. The difference is that val
and are recorded by the database.
Values:
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values: String(10)
Value Description
FAX Fax
PAGER Pager
Semantics.text This annotation identi es a human-readable text that is not necessarily language-dependent.
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData a
Semantics.time This annotation is used to indicate a date semantic for the NVARCHAR-based ABAP type TIMS.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 61/119
12/10/2019
Annotation Meaning
Note
There seems to be currently no internationally recognized standard list for units of measure ava
Annotations belonging to Semantics.url contain a URL, and its mime type is contained in the referenced second eld.
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values:
Semantics.url.mimeType elementRef This annotated eld is required when opening a document for viewing, or when
In UIs, documents are usually presented with an icon that symbolizes their mim
Annotations belonging to Semantics.user de ne the ID of the user related to the data record.
The attribute id should be used if the user ID without additional semantics is included. If the dedicated semantics of the user ID are known, th
responsible should be used.
Values:
Semantics.user.createdBy Boolean default The value of the annotated eld speci es who created a data record.
true
Semantics.user.id The value of the annotated eld contains the ID of a user.
Semantics.user.lastChangedBy The value of the annotated eld speci es who changed a data record at last.
Semantics.user.responsible The value of the annotated eld speci es who is the person responsible for a d
Examples
Example 1
The following CDS view fetches the contact data. Here, the annotations assign to the corresponding elds the relevant semantic
information, such as rst name, last name, and so on.
Sample Code
@Semantics.name.additionalName
MiddleName,
@Semantics.name.familyName
LastName,
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 62/119
12/10/2019
@Semantics.user.id
SystemUser,
Initials,
GenderCode,
AddressUUID,
@Semantics.telephone.type: [#FAX]
FaxNumber,
@Semantics.telephone.type: [#CELL]
MobilePhoneNumber,
@Semantics.eMail.address
EmailAddress,
PreferredLanguage,
@Semantics.contact.birthDate
BirthDate,
@Semantics.name.fullName
_FormattedName.FormattedContactName,
...
}
Example 2
The following CDS view fetches sales order items. Here, the annotations assign the units and currencies to the corresponding
elds.
Sample Code
@Semantics.currencyCode
currency_code as CurrencyCode,
@Semantics.amount.currencyCode: 'CurrencyCode'
gross_amount as GrossAmount,
@Semantics.unitOfMeasure
unit_of_measure as UnitOfMeasure,
@Semantics.quantity.unitOfMeasure: 'UnitOfMeasure'
quantity as Quantity,
...
}
Example 3
The following CDS view fetches geographic data of cities annotating the corresponding location elds according to a standardized
format:
Sample Code
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 63/119
12/10/2019
@Semantics.geoLocation.longitude
Longitude,
@Semantics.geoLocation.latitude
latitude,
@Semantics.geoLocation.normalizedName
name
}
Example 4
The following CDS view fetches language-dependant data annotating the corresponding language elds and text elds:
Sample Code
@Semantics.language: true
key spras AS language,
@Semantics.text: true
ktplt AS chartOfAccountsName
}
UI Annotations
Represent semantic views on business data through the use of speci c patterns that are completely independent of UI
technologies.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 64/119
12/10/2019
url : elementRef;
};
description
{
type : String enum
{
STANDARD;
WITH_INTENT_BASED_NAVIGATION;
WITH_NAVIGATION_PATH;
WITH_URL;
} default #STANDARD;
label : String(40);
iconUrl : String;
criticality : elementRef;
value : elementRef;
targetElement : elementRef;
url : elementRef;
};
};
badge
{
headLine
{
type : String enum
{
STANDARD;
WITH_INTENT_BASED_NAVIGATION;
WITH_NAVIGATION_PATH;
WITH_URL;
} default #STANDARD;
label : String(40);
iconUrl : String;
criticality : elementRef;
value : elementRef;
targetElement : elementRef;
url : elementRef;
};
title
{
type : String enum
{
STANDARD;
WITH_INTENT_BASED_NAVIGATION;
WITH_NAVIGATION_PATH;
WITH_URL;
} default #STANDARD;
label : String(40);
iconUrl : String;
criticality : elementRef;
value : elementRef;
targetElement : elementRef;
url : elementRef;
};
typeImageUrl : String;
imageUrl : elementRef;
mainInfo
{
type : String enum
{
STANDARD;
WITH_INTENT_BASED_NAVIGATION;
WITH_NAVIGATION_PATH;
WITH_URL;
} default #STANDARD;
label : String(40);
iconUrl : String;
criticality : elementRef;
value : elementRef;
targetElement : elementRef;
url : elementRef;
};
secondaryInfo
{
type : String enum
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 65/119
12/10/2019
{
STANDARD;
WITH_INTENT_BASED_NAVIGATION;
WITH_NAVIGATION_PATH;
WITH_URL;
} default #STANDARD;
label : String(40);
iconUrl : String;
criticality : elementRef;
value : elementRef;
targetElement : elementRef;
url : elementRef;
};
};
chart : array of
{
qualifier : String(120);
title : String(40);
description : String(80);
chartType : String enum
{
COLUMN;
COLUMN_STACKED;
COLUMN_STACKED_100;
COLUMN_DUAL;
COLUMN_STACKED_DUAL;
COLUMN_STACKED_DUAL_100;
BAR;
BAR_STACKED;
BAR_STACKED_100;
BAR_DUAL;
BAR_STACKED_DUAL;
BAR_STACKED_DUAL_100;
AREA;
AREA_STACKED;
AREA_STACKED_100;
HORIZONTAL_AREA;
HORIZONTAL_AREA_STACKED;
HORIZONTAL_AREA_STACKED_100;
LINE;
LINE_DUAL;
COMBINATION;
COMBINATION_STACKED;
COMBINATION_STACKED_DUAL;
HORIZONTAL_COMBINATION_STACKED;
HORIZONTAL_COMBINATION_STACKED_DUAL;
PIE;
DONUT;
SCATTER;
BUBBLE;
RADAR;
HEAT_MAP;
TREE_MAP;
WATERFALL;
BULLET;
VERTICAL_BULLET;
};
dimensions : array of elementRef;
measures : array of elementRef;
dimensionAttributes : array of
{
dimension : elementRef;
role : String(10) enum
{
CATEGORY;
SERIES;
};
};
measureAttributes : array of
{
measure : elementRef;
role : String(10) enum
{
AXIS_1;
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 66/119
12/10/2019
AXIS_2;
AXIS_3;
};
asDataPoint : Boolean default true;
};
actions : array of
{
type : String enum
{
FOR_ACTION;
FOR_INTENT_BASED_NAVIGATION;
};
label : String(40);
dataAction : String;
invocationGrouping : String enum
{
ISOLATED;
CHANGE_SET;
} default #ISOLATED;
semanticObjectAction : String;
};
};
textArrangement : String enum
{
TEXT_FIRST;
TEXT_LAST;
TEXT_ONLY;
TEXT_SEPARATE;
};
};
@Scope:[#ELEMENT]
Annotation UI
{
hidden : Boolean default true;
masked : Boolean default true;
multiLineText : Boolean default true;
lineItem : array of
{
qualifier : String(120);
position : Integer;
exclude : Boolean default true;
importance : String enum { HIGH; MEDIUM; LOW; };
type : String enum
{
FOR_ACTION;
AS_ADDRESS;
AS_DATAPOINT;
AS_CONTACT;
AS_CHART;
FOR_INTENT_BASED_NAVIGATION;
STANDARD;
WITH_INTENT_BASED_NAVIGATION;
WITH_NAVIGATION_PATH;
WITH_URL;
} default #STANDARD;
label : String(40);
iconUrl : String;
criticality : elementRef;
dataAction : String;
invocationGrouping : String enum { ISOLATED; CHANGE_SET; } default #ISOLATED;
semanticObjectAction : String;
value : elementRef;
targetElement : elementRef;
url : elementRef;
};
identification : array of
{
position : Integer;
exclude : Boolean default true;
importance : String enum { HIGH; MEDIUM; LOW; };
type : String enum
{
FOR_ACTION;
AS_ADDRESS;
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 67/119
12/10/2019
AS_DATAPOINT;
AS_CONTACT;
AS_CHART;
FOR_INTENT_BASED_NAVIGATION;
STANDARD;
WITH_INTENT_BASED_NAVIGATION;
WITH_NAVIGATION_PATH;
WITH_URL;
} default #STANDARD;
label : String(40);
iconUrl : String;
criticality : elementRef;
dataAction : String;
invocationGrouping : String enum { ISOLATED; CHANGE_SET; } default #ISOLATED;
semanticObjectAction : String;
value : elementRef;
targetElement : elementRef;
url : elementRef;
};
statusInfo : array of
{
position : Integer;
exclude : Boolean default true;
importance : String enum { HIGH; MEDIUM; LOW; };
type : String enum
{
FOR_ACTION;
AS_ADDRESS;
AS_DATAPOINT;
AS_CONTACT;
AS_CHART;
FOR_INTENT_BASED_NAVIGATION;
STANDARD;
WITH_INTENT_BASED_NAVIGATION;
WITH_NAVIGATION_PATH;
WITH_URL;
} default #STANDARD;
label : String(40);
iconUrl : String;
criticality : elementRef;
dataAction : String;
invocationGrouping : String enum { ISOLATED; CHANGE_SET; } default #ISOLATED;
semanticObjectAction : String;
value : elementRef;
targetElement : elementRef;
url : elementRef;
};
fieldGroup : array of
{
qualifier : String(120);
groupLabel : String(40);
position : Integer;
exclude : Boolean default true;
importance : String enum { HIGH; MEDIUM; LOW; };
type : String enum
{
FOR_ACTION;
AS_ADDRESS;
AS_DATAPOINT;
AS_CONTACT;
AS_CHART;
FOR_INTENT_BASED_NAVIGATION;
STANDARD;
WITH_INTENT_BASED_NAVIGATION;
WITH_NAVIGATION_PATH;
WITH_URL;
} default #STANDARD;
label : String(40);
iconUrl : String;
criticality : elementRef;
dataAction : String;
invocationGrouping : String enum { ISOLATED; CHANGE_SET; } default #ISOLATED;
semanticObjectAction : String;
value : elementRef;
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 68/119
12/10/2019
targetElement : elementRef;
url : elementRef;
};
dataPoint
{
title : String(40);
description : String(80);
longDescription : String(190);
forecastValue : elementRef;
minimumValue : Integer;
maximumValue : Integer;
valueFormat
{
scaleFactor : Integer;
numberOfFractionalDigits : Integer;
};
referencePeriod
{
description : String(80);
start : elementRef;
end : elementRef;
};
criticality : elementRef;
criticalityCalculation
{
improvementDirection : String enum { MINIMIZE; TARGET; MAXIMIZE; };
toleranceRangeLowValue : Integer;
toleranceRangeLowValueElement : elementRef;
toleranceRangeHighValue : Integer;
toleranceRangeHighValueElement : elementRef;
deviationRangeLowValue : Integer;
deviationRangeLowValueElement : elementRef;
deviationRangeHighValue : Integer;
deviationRangeHighValueElement : elementRef;
};
trend : elementRef;
trendCalculation
{
referenceValue : elementRef;
isRelativeDifference : Boolean default false;
upDifference : Integer;
upDifferenceElement : elementRef;
strongUpDifference : Integer;
strongUpDifferenceElement : elementRef;
downDifference : Integer;
downDifferenceElement : elementRef;
strongDownDifference : Integer;
strongDownDifferenceElement : elementRef;
};
responsible : elementRef;
responsibleName : String(120);
};
selectionField : array of
{
qualifier : String(120);
position : Integer;
exclude : Boolean default true;
element : elementRef;
};
};
Usage
The focus of OData UI vocabulary developed by SAP is on usage patterns of data in UIs, not on UI patterns. The vocabulary is
completely independent of the UI technologies or devices that consume the data. The usage patterns of data used by the OData
UI vocabulary represent certain semantic views on business data. Some of them are very generic, others are based on the concept
of an entity, something tangible to end-users. Examples for entities are semantic object instances or business object instances.
Looking at different UI patterns, these data usage patterns reoccur again and again. To generate OData annotations from CDS
views, CDS annotations are reused from different domains, for example Consumption, Communication, Semantics, EndUserText.
The CDS annotations that are additionally required in a UI domain are listed in the following table.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 69/119
12/10/2019
Annotation Meaning
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values:
The OData annotations DataFieldAbstract are the basis for all DataFie
optional labels that can trigger navigation to related data, or execute a
UI.badge.headLine.type This enumeration annotation exactly speci es what type of the type h
enumeration type determines which CDS elements are required or ava
Values:
String
Value Description
STANDARD Default
Maps to standard DataField. Yo
displayed without any addition
label
value
criticality
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 70/119
12/10/2019
Annotation Meaning
DataFieldWithNavigationPath
value pair that refers to a prop
de nition consists of a link to n
navigation property provided b
annotation le.
label
value
targetElement
DataFieldWithURL is based on
that refers a property of the O
a URL to navigate to a new targ
label
value
url
Example
When users open a badge, th
badge.
The OData annotations DataFieldAbstract are the basis for all DataFie
optional labels that can trigger navigation to related data, or execute a
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 71/119
12/10/2019
Annotation Meaning
UI.badge.mainInfo.type This enumeration annotation exactly speci es what type of the type h
enumeration type determines which CDS elements are required or ava
Values:
String
Value Description
STANDARD Default
Maps to standard DataField. Yo
displayed without any addition
label
value
criticality
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 72/119
12/10/2019
Annotation Meaning
DataFieldWithNavigationPath
value pair that refers to a prop
de nition consists of a link to n
navigation property provided b
annotation le.
label
value
targetElement
DataFieldWithURL is based on
that refers a property of the O
a URL to navigate to a new targ
label
value
url
The OData annotations DataFieldAbstract are the basis for all DataFie
optional labels that can trigger navigation to related data, or execute a
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 73/119
12/10/2019
Annotation Meaning
UI.badge.secondaryInfo.type This enumeration annotation exactly speci es what type of the type h
enumeration type determines which CDS elements are required or ava
Values:
String
Value Description
STANDARD Default
Maps to standard DataField. Yo
displayed without any addition
label
value
criticality
DataFieldWithNavigationPath
value pair that refers to a prop
de nition consists of a link to n
navigation property provided b
annotation le.
label
value
targetElement
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 74/119
12/10/2019
Annotation Meaning
DataFieldWithURL is based on
that refers a property of the O
a URL to navigate to a new targ
label
value
url
The OData annotations DataFieldAbstract are the basis for all DataFie
optional labels that can trigger navigation to related data, or execute a
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 75/119
12/10/2019
Annotation Meaning
UI.badge.title.type This enumeration annotation exactly speci es what type of the type h
enumeration type determines which CDS elements are required or ava
Values:
String
Value Description
STANDARD Default
Maps to standard DataField. Yo
displayed without any addition
label
value
criticality
DataFieldWithNavigationPath
value pair that refers to a prop
de nition consists of a link to n
navigation property provided b
annotation le.
label
value
targetElement
DataFieldWithURL is based on
that refers a property of the O
a URL to navigate to a new targ
label
value
url
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 76/119
12/10/2019
Annotation Meaning
Example
When users open an overview
related to the entity type to w
belong to.
Annotations belonging to UI.chart are used to show a visual representation of aggregated data.
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values: array of
Values: array of
Values:
String
Value Description
ISOLATED Default
Describes the error handling w
selected instances:
Example
A user selects ve ite
One item cannot be c
other four items are
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 77/119
12/10/2019
Annotation Meaning
If an action cannot be
instances, the action is
instances.
Example
A user selects ve ite
One item cannot be c
copied.
Values:
String
Value Description
DataFieldForAction is based on
action. For example, a button i
label.
label
invocationGrouping
dataAction
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 78/119
12/10/2019
Annotation Meaning
DataFieldForIntentBasedNavig
semantic object.
label
semanticObjectAction
Values:
String
Value Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 79/119
12/10/2019
Annotation Meaning
Values: array of
Values:
String
Value Description
Example
Line chart: Dimensions for w
up the X-axis (category axis)
role, the rst dimension is us
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 80/119
12/10/2019
Annotation Meaning
Example
Line chart: Dimensions for w
the line segments of the cha
dimension value. If multiple d
values of all such dimensions
dimension and a color is assi
Values: array of
Values:
String
Value Description
Example
Bubble chart: The rst meas
if none exists, the rst measu
if none exists, the rst measu
assigned to the feed UID valu
Note
For an example, see the desc
Note
For an example, see the desc
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 81/119
12/10/2019
Annotation Meaning
Annotations belonging to UI.dataPoint are used to visualize a single point of data that typically is a number but may also be text, for example,
Data Points.
Scope: [ELEMENT]
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values:
Values:
String
Value Description
MINIMIZE
Values under tolerance
(positive)
TARGET
Values under deviation
(negative)
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 82/119
12/10/2019
Annotation Meaning
MAXIMIZE
Values under deviation
(negative)
Note
If you use This annotation, yo
UI.dataPoint.criticalityCalcul
Note
If you use This annotation, yo
UI.dataPoint.criticalityCalcul
Note
If you use This annotation, yo
UI.dataPoint.criticalityCalcul
Note
If you use This annotation, yo
UI.dataPoint.criticalityCalcul
Note
If you use This annotation, yo
UI.dataPoint.criticalityCalcul
Note
If you use This annotation, yo
UI.dataPoint.criticalityCalcul
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 83/119
12/10/2019
Annotation Meaning
Note
If you use This annotation, yo
UI.dataPoint.criticalityCalcul
Note
If you use This annotation, yo
UI.dataPoint.criticalityCalcul
Example
You can display a KPI using t
description of this KPI can be
UI.dataPoint.description ann
Example
You can display a KPI using t
hovering over this KPI can be
UI.dataPoint.longDescription
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 84/119
12/10/2019
Annotation Meaning
Note
If you use This annotation, yo
UI.dataPoint.responsibleNam
Note
If you use This annotation, yo
UI.dataPoint.responsible.
Example
You create a KPI in which you
be reached at the end of a sp
UI.dataPoint.targetValue tha
Note
If you use This annotation, do
UI.dataPoint.targetValueElem
Example
You create a KPI that referen
regions that need to be reach
region. This is the UI.dataPoi
value depending on the regio
Note
If you use This annotation, do
UI.dataPoint.targetValue.
Example
You can display a KPI using t
KPI can be displayed using th
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 85/119
12/10/2019
Annotation Meaning
1 = StrongUp (arrow
2 = Up (arrow diagonic
3 = Sideways (horizo
5 = StrongDown (arro
Note
If you use This annotation, yo
UI.dataPoint.trendCalculatio
Note
If you use This annotation, yo
UI.dataPoint.trendCalculatio
Example
Your reference value is 10, an
difference of these two value
these two values is 1.2.
Note
If you use This annotation, yo
UI.dataPoint.trendCalculatio
Note
If you use This annotation, yo
UI.dataPoint.trendCalculatio
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 86/119
12/10/2019
Annotation Meaning
Note
If you use This annotation, yo
UI.dataPoint.trendCalculatio
Note
If you use This annotation, yo
UI.dataPoint.trendCalculatio
Note
If you use This annotation, yo
UI.dataPoint.trendCalculatio
Note
If you use This annotation, yo
UI.dataPoint.trendCalculatio
Example
If the element value is 1, one
34.5.
Example
A value 1000 displayed with
Annotations belonging to UI. eldGroup is an ordered collection of data elds with a label for the group. UI. eldGroup annotations are used to
in a form.
Scope: [ELEMENT]
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values: array of
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 87/119
12/10/2019
Annotation Meaning
UI. eldGroup.importance This annotation expresses the importance of dataFields or other anno
example, in dynamic rendering approaches with responsive design pat
Example
You de ned several eld groups for an item's object view oorplan. T
displayed always, get importance HIGH. This ensures that these eld
when the page is rendered on a small display.
Values:
String
Value Description
HIGH -
MEDIUM -
LOW -
UI. eldGroup.invocationGrouping This annotation expresses how multiple invocations of the same action
annotation is optional. This annotation needs to be speci ed if you use
Values:
String enum
Value Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 88/119
12/10/2019
Annotation Meaning
ISOLATED Default
Describes the error handling w
selected instances:
Example
A user selects ve ite
One item cannot be c
other four items are
If an action cannot be
instances, the action is
instances.
Example
A user selects ve ite
One item cannot be c
copied.
Example
You can specify the sequenc
an item's object view oorpla
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 89/119
12/10/2019
Annotation Meaning
UI. eldGroup.type This enumeration annotation exactly speci es what type of the type h
enumeration type determines which CDS elements are required or ava
Values:
String
Value Description
DataFieldForAction is based on
action. For example, a button i
label.
label
invocationGrouping
dataAction
DataFieldForAnnotation is use
Edm.AnnotationPath abstract
vCard.Address or UI.DataPoint
label
value
label
value
DataFieldForIntentBasedNavig
semantic object.
label
semanticObjectAction
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 90/119
12/10/2019
Annotation Meaning
STANDARD Default
Maps to standard DataField. Yo
displayed without any addition
label
value
criticality
DataFieldWithNavigationPath
value pair that refers to a prop
de nition consists of a link to n
navigation property provided b
annotation le.
label
value
targetElement
DataFieldWithURL is based on
that refers a property of the O
a URL to navigate to a new targ
label
value
url
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 91/119
12/10/2019
Annotation Meaning
DataFieldWithIntentBasedNav
be rendered as a hyperlink.
label
value
semanticObjectAction
Annotations belonging to UI.headerInfo describe an entity, its title, and an optional short description, the name of its entity in singular and plu
individual entity.
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values:
The OData annotations DataFieldAbstract are the basis for all DataFie
optional labels that can trigger navigation to related data, or execute a
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 92/119
12/10/2019
Annotation Meaning
UI.headerInfo.description.type This enumeration annotation exactly speci es what type of the type h
enumeration type determines which CDS elements are required or ava
Values:
String
Value Description
STANDARD Default
Maps to standard DataField. Yo
displayed without any addition
label
value
criticality
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 93/119
12/10/2019
Annotation Meaning
DataFieldWithNavigationPath
value pair that refers to a prop
de nition consists of a link to n
navigation property provided b
annotation le.
label
value
targetElement
DataFieldWithURL is based on
that refers a property of the O
a URL to navigate to a new targ
label
value
url
DataFieldWithIntentBasedNav
be rendered as a hyperlink
label
semanticObjectAction
value
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 94/119
12/10/2019
Annotation Meaning
Example
When users open an item fro
related to that item as part o
The OData annotations DataFieldAbstract are the basis for all DataFie
optional labels that can trigger navigation to related data, or execute a
UI.headerInfo.title.type This enumeration annotation exactly speci es what type of the type h
enumeration type determines which CDS elements are required or ava
Values:
String
Value Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 95/119
12/10/2019
Annotation Meaning
STANDARD Default
Maps to standard DataField. Yo
displayed without any addition
label
value
criticality
DataFieldWithNavigationPath
value pair that refers to a prop
de nition consists of a link to n
navigation property provided b
annotation le.
label
value
targetElement
DataFieldWithURL is based on
that refers a property of the O
a URL to navigate to a new targ
label
value
url
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 96/119
12/10/2019
Annotation Meaning
DataFieldWithIntentBasedNav
be rendered as a hyperlink.
label
semanticObjectAction
value
Example
When users open a SAP Fior
related to the entity type to w
belong to.
UI.hidden This annotation allows to show or hide data elds based on the state o
see Field Hiding.
Scope: [ELEMENT]
Annotation belonging to UI.identi cation represent an ordered collection of speci c data elds that together with headerInfo identi es an ent
Example
This annotation is displayed in the General Information section in the body of the object view oorplan of an item, for example.
Scope: [ELEMENT]
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values: array of
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 97/119
12/10/2019
Annotation Meaning
UI.identi cation.importance This annotation expresses the importance of dataFields or other anno
example, in dynamic rendering approaches with responsive design pat
Example
You de ned several entries for the General Information section for a
entries that need to be displayed always, get importance HIGH. This
in the section when this section is rendered on a small display.
Values:
String
Value Description
HIGH -
MEDIUM -
LOW -
UI.identi cation.invocationGrouping This annotation expresses how multiple invocations of the same action
annotation is optional. This annotation needs to be speci ed if you use
FOR_ACTION.
Values:
String enum
Value Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 98/119
12/10/2019
Annotation Meaning
ISOLATED Default
Describes the error handling w
selected instances:
Example
A user selects ve ite
One item cannot be c
other four items are
If an action cannot be
instances, the action is
instances.
Example
A user selects ve ite
One item cannot be c
copied.
Example
When users open the object
General Information section
general information about th
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 99/119
12/10/2019
Annotation Meaning
UI.identi cation.type This enumeration annotation exactly speci es what type of the type h
enumeration type determines which CDS elements are required or ava
Values:
String
Value Description
DataFieldForAction is based on
action. For example, a button i
label.
label
invocationGrouping
dataAction
DataFieldForAnnotation is use
Edm.AnnotationPath abstract
vCard.Address or UI.DataPoint
label
value
label
value
DataFieldForIntentBasedNavig
semantic object.
label
semanticObjectAction
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 100/119
12/10/2019
Annotation Meaning
STANDARD Default
Maps to standard DataField. Yo
displayed without any addition
label
value
criticality
DataFieldWithNavigationPath
value pair that refers to a prop
de nition consists of a link to n
navigation property provided b
annotation le.
label
value
targetElement
DataFieldWithURL is based on
that refers a property of the O
a URL to navigate to a new targ
label
value
url
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 101/119
12/10/2019
Annotation Meaning
DataFieldWithIntentBasedNav
be rendered as a hyperlink.
label
value
semanticObjectAction
Annotations belonging to UI.lineItem represent an ordered collection of data elds that is used to represent data from multiple data instances
see Columns.
Scope: [ELEMENT]
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values: array of
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 102/119
12/10/2019
Annotation Meaning
Example
You de ned a table with several columns. The columns that need to b
HIGH. This ensures that these columns are displayed in a table when
Values:
String
Value Description
HIGH -
MEDIUM -
LOW -
UI.lineItem.invocationGrouping This annotation expresses how multiple invocations of the same action
annotation is optional. This annotation needs to be speci ed if you use
Values:
String enum
Value Description
ISOLATED Default
Describes the error handling w
selected instances:
Example
A user selects ve ite
One item cannot be c
other four items are
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 103/119
12/10/2019
Annotation Meaning
If an action cannot be
instances, the action is
instances.
Example
A user selects ve ite
One item cannot be c
copied.
UI.lineItem.type This enumeration annotation exactly speci es what type of the type h
enumeration type determines which CDS elements are required or ava
Values:
String
Value Description
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 104/119
12/10/2019
Annotation Meaning
DataFieldForAction is based on
action. For example, a button i
label.
label
invocationGrouping
dataAction
DataFieldForAnnotation is use
Edm.AnnotationPath abstract
vCard.Address or UI.DataPoint
label
value
label
value
DataFieldForIntentBasedNavig
semantic object.
label
semanticObjectAction
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 105/119
12/10/2019
Annotation Meaning
STANDARD Default
Maps to standard DataField. Yo
displayed without any addition
label
value
criticality
DataFieldWithNavigationPath
value pair that refers to a prop
de nition consists of a link to n
navigation property provided b
annotation le.
label
value
targetElement
DataFieldWithURL is based on
that refers a property of the O
a URL to navigate to a new targ
label
value
url
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 106/119
12/10/2019
Annotation Meaning
DataFieldWithIntentBasedNav
be rendered as a hyperlink.
label
value
semanticObjectAction
UI.masked This annotation refers to, for example, passwords or pass phrases. The
value in clear text upon explicit user interaction. For more information
Scope: [ELEMENT]
UI.multiLineText This annotation contains text that is rendered as multiple lines. For mo
Scope: [ELEMENT]
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 107/119
12/10/2019
Annotation Meaning
Annotations belonging to UI.selectionField allow ltering a list of data. UI.selectionField annotations are usually used in an initial page oorpla
Scope: [ELEMENT]
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values: array of
Example
You de ne a sales ord
business partners fo
country information
view but in the busin
Example
When users open a SAP Fior
items, they might want to lt
date, for example. They can s
list. You specify what selectio
so on.
Annotations belonging to UI.statusInfo represent a list of abstract data elds that convey the status of an entity. UI.statusInfo annotations are
item's object view oorplan.
Scope: [ELEMENT]
Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations
Values: array of
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 108/119
12/10/2019
Annotation Meaning
Example
You de ned several statuses. The statuses that need to be displayed
ensures that these statuses are displayed in a table, for example, wh
display.
Values:
String
Value Description
HIGH -
MEDIUM -
LOW -
UI.statusInfo.invocationGrouping This annotation expresses how multiple invocations of the same action
annotation is optional. This annotation needs to be speci ed if you use
Values:
String enum
Value Description
ISOLATED Default
Describes the error handling w
selected instances:
Example
A user selects ve ite
One item cannot be c
other four items are
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 109/119
12/10/2019
Annotation Meaning
If an action cannot be
instances, the action is
instances.
Example
A user selects ve ite
One item cannot be c
copied.
UI.statusInfo.type This enumeration annotation exactly speci es what type of the type h
enumeration type determines which CDS elements are required or ava
Values:
String
Value Description
DataFieldForAction is based on
action. For example, a button i
label.
label
invocationGrouping
dataAction
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 110/119
12/10/2019
Annotation Meaning
DataFieldForAnnotation is use
Edm.AnnotationPath abstract
vCard.Address or UI.DataPoint
label
value
DataFieldForAnnotation is use
Edm.AnnotationPath abstract
vCard.Address or UI.DataPoint
label
value
label
value
DataFieldForIntentBasedNavig
semantic object. The navigatio
label
semanticObjectAction
STANDARD Default
Maps to standard DataField. Yo
displayed without any addition
label
value
criticality
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 111/119
12/10/2019
Annotation Meaning
DataFieldWithNavigationPath
value pair that refers to a prop
de nition consists of a link to n
navigation property provided b
annotation le.
label
value
targetElement
DataFieldWithURL is based on
that refers a property of the O
a URL to navigate to a new targ
label
value
url
DataFieldWithIntentBasedNav
be rendered as a hyperlink.
label
value
semanticObjectAction
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 112/119
12/10/2019
Annotation Meaning
Scope: [VIEW]
Values:
String
Value Description
Example
English (EN)
Example
EN (English)
Example
English
Example
Language Language
(Code)
EN English
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 113/119
12/10/2019
Examples
Example 1: @UI.headerInfo
In this example, the element @UI.headerInfo.typeNamePlural is used to de ne, what can be shown in the title of a table or list.
Sample Code
...
@UI.headerInfo: { typeNamePlural: 'Sales Orders' }
define view ZExample_SalesOrder as select from sepm_cds_sales_order as so {
...
}
Example 2: @UI.lineItem
The annotation @UI.lineItem is used to de ne what elements are shown in the table-columns.
Since the desired columns of a table depend on the use-case (an overview may require more elds than a value-help) several list-
layouts can be de ned, distinguished by a quali er. If the CDS view contains analytical annotations, for example
@DefaultAggregation, they are considered automatically. No additional UI annotations are required.
Sample Code
...
define view ZExample_SalesOrder as select from sepm_cds_sales_order as so {
@UI.lineItem: [ { position: 10 }, { qualifier: 'ValueList', position: 10 } ]
key so.sales_order_id as SalesOrder,
@UI.lineItem: [ { position: 30 } ]
so.currency_code as CurrencyCode,
@DefaultAggregation: #SUM
@UI.lineItem: [ { position: 40 } ]
so.gross_amount as GrossAmount
}
Example 3: @UI.selectionField
The annotation @UI.selectionField is used to enable speci c elements for selection, for example using a lter bar.
If the CDS view is annotated as @Search.searchable or if a value help is available for the element, this is considered. No additional
UI annotations are required to expose the search eld or value help.
Sample Code
...
define view ZExample_SalesOrder as select from sepm_cds_sales_order as so {
key so.sales_order_id as SalesOrder,
@UI.selectionField: [ { position: 10 } ]
so.customer.company_name as CompanyName,
...
}
Sample Code
...
define view ZExample_SalesOrder as select from sepm_cds_sales_order as so {
@UI.identification: [ { position: 10 } ]
key so.sales_order_id as SalesOrder,
@UI.identification: [ { position: 20 } ]
so.customer.company_name as CompanyName,
@UI.identification: [ { position: 30 } ]
so.currency_code as CurrencyCode,
@UI.identification: [ { position: 40 } ]
so.gross_amount as GrossAmount
}
The annotation @UI. eldGroup is used to group several elds, for example, for sections of forms. Similar to the annotation
@UI.lineItem, the different eld groups have unique quali ers.
Sample Code
Example 6:@UI.badge
The annotation @UI.badge represents the view of a business card. A badge can be considered as the combination of the
annotations @UI.headerInfo and @UI.identi cation. The properties ImageUrl, TypeImageUrl, and Title correspond to the
properties from the annotation @UI.HeaderInfo. In addition to the Title property, the properties HeadLine, MainInfo and
SecondaryInfo of the same format can be speci ed.
Sample Code
@UI.badge: {
title: {
label: 'Sales Order',
value: 'SalesOrderID' -- Reference to element in projection-list
},
headLine: {
label: 'Customer',
value: 'CompanyName' -- Reference to element in projection-list
},
mainInfo: {
label: 'Gross Amount',
value: 'GrossAmount' -- Reference to element in projection-list
},
secondaryInfo: {
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 115/119
12/10/2019
label: 'Billing Status',
value: 'BillingStatus' -- Reference to element in projection-list
}
}
Example 7: @UI.chart
The annotation @UI.chart is used to de ne the properties of a chart. The annotation is de ned at view level and refers to the
elements that are supposed to be used in the chart. Additionally, a title and description can be provided.
Sample Code
...
@UI.chart: {
title: 'Gross Amount by Customer',
description: 'Line-chart displaying the gross amount by customer',
chartType: #LINE,
dimensions: [ 'CompanyName' ], -- Reference to one element
measures: [ 'GrossAmount' ] -- Reference to one or more elements
}
@Semantics.amount.currencyCode: 'CurrencyCode'
so.gross_amount as GrossAmount,
...
}
Example 8: @UI.hidden
The annotation @UI.hidden prevents elds from being displayed, leaving them available for client.
This is sensible if the CDS has technical keys, for example Guids, that have to be exposed to the OData service to work, but are
usually not supposed to be displayed on the UI. Another use case are elds that are required in other calculations.
In the following example, a data point with precalculated criticality and trend is exposed. These elds are required in the client to
calculate the corresponding values, but are not supposed to be displayed directly.
Sample Code
...
define view ZExample_SalesOrdersByCustomer as select from ... as so {
@UI.hidden
key so.buyer_guid as BuyerGuid,
...
@UI.dataPoint: {
criticality: 'AmountCriticality', -- Reference to element
trend: 'AmountTrend', -- Reference to element
}
so.actual_amount as ActualAmount,
@UI.hidden
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 116/119
12/10/2019
so.criticality as AmountCriticality,
@UI.hidden
so.trend as AmountTrend
}
Example 9: @UI.masked
The annotation @UI.masked marks a eld that may contain sensitive data and should therefore not be displayed in clear text by
the client.
This annotation does not in uence how data is transferred. If a eld is marked as @UI.masked, dataof this eld is still transferred
to the client like any other property.
Sample Code
...
define view Destination as select from ... {
@UI.identification: [ { position: 10 } ]
key DestinationID,
...
@UI.identification: [ { position: 20 } ]
AuthType, -- None, Basic, SSO, ...
@UI.identification: [ { position: 30 } ]
BasicAuthUserName,
@UI.identification: [ { position: 40 } ]
@UI.masked
BasicAuthPassword,
...
}
Example 10:@UI.multiLineText
The annotation @UI.multiLineText marks a eld, for example a description, that is supposed to be displayed by controls that
support multiline-input, for example a text area.
Sample Code
...
define view Product as select from ... {
@UI.identification: [ { position: 10 } ]
key ProductID,
@UI.identification: [ { position: 20 } ]
ProductName,
@UI.identification: [ { position: 30 } ]
@UI.multiLineText: true
Description,
...
}
The annotation @UI.dataPoint de nes a single point of data, typically a number, that can be enriched with business-relevant data,
for example if a high or low value is desired, or if the value is increasing to decreasing.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 117/119
12/10/2019
The simplest variant of a data point consists of a value and a tile. In this case, only the value itself is exposed, without additional
information.
Sample Code
...
define view ZExample_SalesOrdersByCustomer as select from ... as so {
key so.buyer_guid as BuyerGuid,
@Semantics.currencyCode: true
so.currency_code as CurrencyCode,
@Semantics.amount.currencyCode: 'CurrencyCode'
so.actual_amount as ActualAmount
}
VDM Annotations
Allow classifying views of the virtual data model in terms of their admissible reuse options and provisioned content
@Scope:[#VIEW, #TABLE_FUNCTION]
Annotation VDM
{
viewType : String enum { BASIC; COMPOSITE; CONSUMPTION; };
private : Boolean default true;
};
Usage
VDM is intended to be interpreted by view browsers and other functionality which is based on the virtual data model.
This classi cation is used only for SAP internal structuring and interpretation of the CDS views. Releasing CDS views for
customers and partners is controlled by additional internal classi cation of the views.
Annotation Meaning
Evaluation Runtime (Engine): None - Used for SAP internal structuring and interpretation of the CDS
views
Values:
Value Description
BASIC views that form the core data basis without data redundancies.
COMPOSITE views that provide data derived and/or composed from the BASIC
views.
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 118/119
12/10/2019
Annotation Meaning
CONSUMPTION views that serve for speci c application purposes and may be
de ned based upon public interface (for example, BASIC and
COMPOSITE) views.
VDM.private Private interface (for example, BASIC and COMPOSITE) views represent technical helper views which
may only be used by their de ning responsibles.
Examples
Example 1
Sample Code
@VDM.viewType: #BASIC
define view I_SalesOrder ... {
key SalesOrder,
...
}
Example 2
Sample Code
@VDM.private: true
@VDM.viewType: #COMPOSITE
define view P_SalesOrderItemCube ... {
key SalesOrder,
...
}
https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 119/119