+ All Categories
Home > Documents > SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations...

SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations...

Date post: 17-Jul-2020
Category:
Upload: others
View: 60 times
Download: 9 times
Share this document with a friend
119
12/10/2019 https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 1/119 SAP - ABAP Programming Model for SAP Fiori Generated on: 2019-12-10 SAP NetWeaver 7.5 | SPS09 PUBLIC Original content: https://help.sap.com/viewer/cc0c305d2fab47bd808adcad3ca7ee9d/7.5.9/en-US 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 reect 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. For more information, please visit the https://help.sap.com/viewer/disclaimer.
Transcript
Page 1: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 1/119

SAP - ABAP Programming Model for SAPFioriGenerated on: 2019-12-10

SAP NetWeaver 7.5 | SPS09

PUBLIC

Original content: https://help.sap.com/viewer/cc0c305d2fab47bd808adcad3ca7ee9d/7.5.9/en-US

Warning

This document has been generated from the SAP Help Portal and is an incomplete version of the official SAP productdocumentation. The information included in custom documentation may not re�ect the arrangement of topics in the SAP HelpPortal, and may be missing important aspects and/or correlations to other topics. For this reason, it is not for productive use.

For more information, please visit the https://help.sap.com/viewer/disclaimer.

Page 2: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 2/119

CDS AnnotationsThe following list summarizes all SAP annotations of the Data De�nition Language (DDL) of ABAP CDS. SAP CDS annotations areevaluated by SAP frameworks and can be either ABAP annotations or framework-speci�c annotations.

ABAP CDS - ABAP Annotations

CDS annotations that are evaluated by ABAP runtime:

AbapCatalog Annotations

AccessControl Annotations

ClientDependent Annotations

DataAging Annotations

EndUserText Annotations

Environment Annotations

MappingRole Annotations

Metadata Annotations

Semantics Annotations

Framework-Speci�c Annotations

CDS annotations that (as a rule) are evaluated during runtime by speci�c frameworks such as SADL, BOPF, Analytics, orEnterprise 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

TipTo access help for an ABAP annotation, position the cursor on relevant annotation in the DDL source editor and choose F1 .

For more information, look here ABAP CDS - ABAP Annotations

Page 3: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 3/119

Related InformationABAP CDS - Anotations

Analytics AnnotationsEnable the Analytic Manager for multidimensional data consumption, performing data aggregation, and slicing and dicing data. BIfront ends like Design Studio and Analysis Office can consume the data via the Analytic Manager.

Scope and De�nition

Usage

The Analytic Manager needs a star schema (multidimensional) and a query to consume the data. Most annotations to de�ne thestar schema in different CDS views are speci�ed in ObjectModel annotations. The Analytics annotations also specify thefacts (center of the star schema), extraction capabilities for replicating data into further systems, and analytic query properties. Asemantic 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

TipTo access help for an framework-speci�c annotation, position the cursor on relevant annotation in the DDL source editor andchoose F1 .

For more information, look here Framework-Speci�c Annotations

@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; }; };

Page 4: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 4/119

Annotation Meaning

Analytics.dataCategory Analytic queries can be de�ned on top of CDS viewAnalytics.dataCategory annotation.

Scope: #VIEW

Evaluation Runtime (Engine): By specifying the daprovide directives and hints, telling the analytic mentities for example.

Value Description

#DIMENSION This value indicates tdata. Such a view canqueries.

#FACT This value indicates ttransactional data (cecontains the measurenecessary for replicatjoined with master da

#CUBE The #CUBE value (likedata, but #CUBE doesredundancy. This mepossible. Queries are where data is replicat

#AGGREGATIONLEVEL This value indicates athe analytic manager(planning functionalitselect from a view witwhich supports the aAnalytics.writeB

associations are allowrenamed.

Analytics.dataExtraction.enabled Application developers can use this annotation to data replication (for example, delta capabilities mu

Scope: #VIEW

Evaluation Runtime (Engine): Speci�es which viewscenarios.

Value Description

true The view is suitable fotrue, if this annotatio

false The view is not suitab

ExampleTypical dimensions view.

NoteThis view must be annotated with Analytics.dvalue AGGREGATIONLEVEL) or with ObjectModvalue #TEXT or #HIERARACHY .

Page 5: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 5/119

Annotation Meaning

Analytics.dataExtraction.delta.byElement.name Application developers can enable the generic deltThis is the element that should be used for �lteringThis element can either be a date (ABAP type DAT

Scope: #VIEW

Evaluation Runtime (Engine): Speci�es which viewscenarios.

Value Description

elementName as String Name of an element tduring generic delta e

Analytics.dataExtraction.delta.byElement.maxDelayInSeconds There is always a time delay between taking a UTCcommit. This annotation speci�es the maximum p

Scope: #VIEW

Evaluation Runtime (Engine): Speci�es which viewscenarios.

Value Description

Integer Maximum number ofstamp and the succedefault is 1800 secon

Analytics.dataExtraction.delta.byElement.detectDeletedRecords By using this annotation, the system will remembethat were extracted in delta mode. If a key combinanymore, this will automatically generate a delete

Scope: #VIEW

Evaluation Runtime (Engine): Detects deleted rec

Value Description

Boolean The default is true, i

Analytics.dataExtraction.delta.byElement.ignoreDeletionAfterDaysThis annotation only makes sense together withAnalytics.dataExtraction.delta.byEle

The extraction will ignore deleted records if they aof days. The main purpose is archiving.

Scope: #VIEW

Evaluation Runtime (Engine): Speci�es which viewscenarios.

Value Description

NoteIf the �eld is a time stamp, the system checks alsSemantics.systemDate.lastChangedAt:

ExampleIf records are archived after two years then this vthis case, the deletion in the database tables willolder than 700 days.

Page 6: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 6/119

Annotation Meaning

Integer Speci�ed number of

Analytics.hidden You can use this �ag to decide whether the entity sclients.

Scope: #VIEW

Evaluation Runtime (Engine): Views with Analytvalue help. Views with Analytics.dataCategofor the CDS query designer.

Values:

Value Description

true The view cannot be cdefault is true, if this

false The view can be cons

Analytics.planning.enabled An input-enabled query provides writeback capabscenarios.

Scope: #VIEW

Evaluation Runtime (Engine): Speci�es which viewenabled analytic query by the analytic manager.

Value Description

true The view is enabled fothis annotation is use

false The view is not enabl

Analytics.query Query view classi�cation.

Scope: #VIEW

Evaluation Runtime (Engine): By tagging the CDSwhich views will be exposed to the analytic managinterpreted as an analytic query by the analytic ma

Value Description

NoteThis view must be annotated with Analytics.q

NoteThe view has to seleannotated with Ana#AGGREGATIONLE

NoteThis view must not be annotated with Analytic

Page 7: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 7/119

ExamplesExample 1

Example for replication-enabled master data.

Annotation Meaning

true The query view will beThe default is true, if

false The query view will nomanager.

Analytics.writeBack.className Views with Analytics.dataCategory: #AGGtype of view can be used for planning scenarios. Tthe data, authorization checks and enqueuing.

Scope: #VIEW

Evaluation Runtime (Engine): Speci�es which clasto write data to the view.

Value Description

className as String Name of an ABAP clainterface IF_RODPS_

NoteData will be selectefrom clause. The viannotated with the as #DIMENSION, #Cand the DCL has to from clause.

NoteOnly relevant if Analytics.dataCategory: Analytics.dataCategory: #FACT.

Sample Code

@EndUserText.label: 'EPM Demo: Employee' @Analytics:{ dataCategory: #DIMENSION , dataExtraction.enabled: true } //@VDM.viewType: #BASIC @AccessControl.authorizationCheck: #CHECK @ObjectModel.representativeKey: 'EmployeeUUID' @AbapCatalog.sqlViewName: 'SEPM_IEMPLOYEE' define view SEPM_I_Employee as select from snwd_employees

association [0..1] to SEPM_I_Company as _Company on $projection.Company...

{ key snwd_employees.node_key as EmployeeUUID, @ObjectModel.foreignKey.association: '_Company' snwd_employees.parent_key as CompanyUUID, ...}

Page 8: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 8/119

Example 2

Example for transactional data (fact).

Related InformationObjectModel AnnotationsSemantics Annotations

AnalyticsDetails AnnotationsEnable application developers to specify the default multidimensional layout of the query, the sequence of variables in UIconsumption, and the speci�c aggregation and planning behavior of the data. All these annotations can only be used in views [email protected] : true.

Scope and De�nition

Sample Code

@EndUserText.label: 'EPM Demo: Sales Order Item with Addtl. Data (private view)' @Analytics.dataCategory: #CUBE @AccessControl.authorizationCheck: #CHECK @AbapCatalog.sqlViewName: 'SEPM_PSOIC'

define view SEPM_P_SalesOrderItemCube with parameters P_DisplayCurrency : snwd_curr_code //for currency conversion, TODO: data element with bett

as select from SEPM_I_SalesOrderItem

association [0..1] to SEPM_I_SalesOrder_E as _SalesOrder_E on $projection.salesord... { @ObjectModel.foreignKey.association: '_SalesOr key _SalesOrder.SalesOrder, _SalesOrder_E, ...}

@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

Page 9: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade96779… 9/119

Usage

Annotation Meaning

};

}; 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; }; };

Page 10: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 10/119

Annotation Meaning

AnalyticsDetails.exceptionAggregationSteps.exceptionAggregationBehavior Usually, the default aggregation determi

In some cases different aggregation beh(dimension of a cube).

Exception aggregation is optional and is aggregation behavior for speci�ed elememeasure has to be aggregated differentlycan be assigned. ExceptionAggregat

Scope: #ELEMENT

Evaluation Runtime (Engine): The (logicaggregation is as follows: Firstly the Defastill grouped by all elements in the list ofaggregated by the exception aggregation

The �rst remark holds even if the Defaultis performed when the result is still grouformula has been calculated, the result iExceptionAggregationSteps. This calculation can be de�ned precisely.

Value Descri

SUM sum

MIN minim

MAX maxim

COUNT counte

AVG averag

STD standa

FIRST FIRST

LAST LAST

CautionThe default aggregation behavior canncube layer.

NoteExample: A measure "Inventory" can bedimensions, but not for time – accordin

NoteExample: In the query there is a measupositive sales - where sales is a measurSUM. When the sales measure is now uexceptionAggregationBehavior

Customer, the sales must �rst be aggto be performed. If the sales for a custo1 (otherwise it is set to 0). This number

Page 11: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 11/119

Annotation Meaning

AnalyticsDetails.exceptionAggregationSteps.exceptionAggregationElements

: [ '' ]The elements which should be aggregatecharacteristics.

Scope: #ELEMENT

Evaluation Runtime (Engine): Analytic mAnalyticsDetails.exceptionAgg

Value Descri

array of elementRef list of e

AnalyticsDetails.planning.disaggregation This annotations allows you to de�ne thefor elements with AnalyticsDetails

Scope: #ELEMENT

Evaluation Runtime (Engine): If a measuanalytic query. It enables the user to mamust be disaggregated on all the data re

Value Descri

NONE No Dis

TOTAL Disagg

DIFFERENCE Disagg

AnalyticsDetails.planning.distribution If disaggregation is chosen, you can choothis annotation.

Scope: #ELEMENT

Evaluation Runtime (Engine): This annoelement is not enabled for planning.

Value Descri

EQUAL Equal d

PROPORTIONAL Propor

PROPORTIONAL_REF ProporselectiAnaly

annota

AnalyticsDetails.planning.distributionReference If disaggregation is chosen and Analyti#PROPORTIONAL_REF, you can specifythis annotation.

Scope: #ELEMENT

Evaluation Runtime (Engine): This annoelement is not enabled for planning.

Value Descri

elementRef Name

Page 12: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 12/119

Annotation Meaning

AnalyticsDetails.planning.enabled Individual members in the selection list (enabling planning. The list can only be usviews have to be annotated with AnalytAnalytics.planning.enabled: t

Scope: #ELEMENT

Evaluation Runtime (Engine): If a measuanalytic query.

Value Descri

true The mthe de

false The m

AnalyticsDetails.query.axis The elements of the view can be positionannotated with their axis. Measures (eleneed to be on the same axis. The annotameasures of the query. If no Analyticsthe measures on the columns.

The default value for elements which areprojection list, which belong to the same

Scope: #ELEMENT

Evaluation Runtime (Engine): If the BI cthe layout is derived by this annotation.

Value Descri

FREE Defaul

ROWS

COLUMNS Defaul

AnalyticsDetails.query.decimals For measures, restricted measures and cto be used.

Scope: #ELEMENT

Evaluation Runtime (Engine): Analytic mFor other elements it will be ignored.

Value Descri

Integer number from 0 to 9. Numbe

AnalyticsDetails.query.displayHierarchy This annotation allows you to specify thepossible for measures.

Scope: #ELEMENT

Evaluation Runtime (Engine): Analytic mspeci�ed element.

Value Descri

OFF No dis

ON With dAnaly

Page 13: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 13/119

Annotation Meaning

FILTER The disthis eleon the�lter.

AnalyticsDetails.query.formula This annotation allows you to specify theSQL formula (operands required from th(measures) can be used as operands.

Scope: #ELEMENT

Evaluation Runtime (Engine): Analytic m

Value Descri

String This ex

AnalyticsDetails.query.hierarchyBinding.type The AnalyticsDetails.query.hiespecial hierarchy for an element with a dkey �eld of the hierarchy directory view. hierarchy directory, the second entry to exists, the hierarchy binding can be omit

AnalyticsDetails.query.hierar

�lled (by a constant, a parameter, a �lter

Scope: #ELEMENT

Evaluation Runtime (Engine): Analytic m

Value Descri

#ELEMENT Name �lter v

#PARAMETER Param

#CONSTANT Consta

#USER_INPUT USER_

analytsame nThe vaAnaly

Page 14: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 14/119

Annotation Meaning

AnalyticsDetails.query.hierarchyBinding.value This annotation contains, depending on $parameter), the element name and a

Scope: #ELEMENT

Evaluation Runtime (Engine): Analytic m

Value Descri

String(512)

AnalyticsDetails.query.hierarchyBinding.variableSequence This annotation allows you to specify theUIs.

In case �lters or parameters are not annorder they appear in the CDS document.

Scope: #ELEMENT

Evaluation Runtime (Engine): Analytic m

Value Descri

Integer This nuthe use

AnalyticsDetails.query.scaling For measures, restricted measures and cused.

Scope: #ELEMENT

Evaluation Runtime (Engine): This annowill be ignored.

Value Descri

Integer: Integer numberfrom 0 to 9.

Numbe

AnalyticsDetails.query.totals For attributes you can set the behavior fo

Scope: #ELEMENT

Evaluation Runtime (Engine): These ann

Value Descri

HIDE Totals elemen

SHOW In addset for

NoteYou can also use the annotationConsumption.filter.hierarchy

Page 15: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 15/119

Annotation Meaning

AnalyticsDetails.query.variableSequence If user input is necesssary for the paramcan be speci�ed with this annotation.

Scope: #PARAMETER, #ELEMENT

Evaluation Runtime (Engine): UIs will crinput or elements with �lters (consumptsequence of user prompts at runtime. If after the annotated ones - in the order th

Value Descri

Integer Order contai

AnalyticsDetails.query.hierarchySettings.hidePostedNodesValues For some hierarchies (typical example: Cposted values on their own (and not just are displayed as separate rows in the repcan be suppressed.

Scope: #ELEMENT

Evaluation Runtime (Engine):

Value Descri

Boolean true i

AnalyticsDetails.query.elementHierarchy.parent Measures, restricted measures and calcustructure of the Analytic Query. To achieannotated with @AnalyticsDetails.hierarchically below the speci�ed parent

Scope:#ELEMENT

Evaluation Runtime (Engine):

Value Descri

elementRef Alias oentry.

AnalyticsDetails.query.elementHierarchy.initiallyCollapsed If true, the hierarchy node represented bapplicable if the annotated entry has chi

Scope:#ELEMENT

Evaluation Runtime (Engine):

Value Descri

Boolean true i

AnalyticsDetails.resultValueSource This annotation in�uences the list of valucharacteristic.

Scope: #ELEMENT

Evaluation Runtime (Engine): When thecharacteristic if there are posted values

Value Descri

CUBE All valu

Page 16: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 16/119

ExamplesExample 1

Calculated Elements

Example 2

Display hierarchy selection: Specify the hierarchy directly.

Annotation Meaning

DIMENSION All valu

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,

@AnalyticsDetails.query.formula : 'NDIV0($projection.absolute_margin / revenue ) * 100'

1 as relative_margin, @AnalyticsDetails.query.formula : 'CASE WHEN $projection.relative_margin > 20 THEN revenue ELSE 0 1 as revenue_for_margin_gt_20

}

Sample Code

@Analytics.query : true

define view costcenter_reporting

with parameters

cost_center_hier_param : String

as select from costcenters

{

...

@AnalyticsDetails.query : {

displayHierarchy: #ON,

hierarchyInitialLevel: 3, // three levels of the hierarchy will be opened at start

hierarchySettings{hidePostedNodesValues: true }, // don't show posted node values

hierarchyBinding :

Page 17: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 17/119

Example 3

Use of $session variables, especially $session.system_date.

The system supports variables like $session.system_date for different use cases:

in cube parameters

in queries on time-dependent master data in where clauses

in paths to time-dependent attributes or texts

in restricted key �gures

Related InformationDefaultAggregation Annotations

[ { type : #CONSTANT, value : 'CONTR_AREA_10' },

{ type : #PARAMETER, value : 'cost_center_hier_param' }

]

}

costcenter, // hierarchy node filter

costs,

...

}

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

_CostCenter[1: DateTo >= $session.system_date and DateFrom <= $session.system_date]._Text[1: L

Sample Code

case when PostingDate = $session.system_date

Page 18: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 18/119

Consumption AnnotationsDe�ne a speci�c behavior that relates to the consumption of CDS content through domain-speci�c frameworks.

Scope and De�nition

Usage

@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; };

Page 19: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 19/119

Via these annotations, the speci�c behavior is de�ned which is related to the consumption of CDS content. This metadata makesno assumptions about the concrete consumption technology/infrastructure, but it is applicable across multiple consumptiontechnologies (e.g. Analytics or OData).

Annotation Meaning

Consumption.defaultValue This annotation enables speci�cation of a default value for

Scope: #PARAMETER

Evaluation Runtime (Engine): This annotation will be inter

Values:

This value is either proposed to the end user or implicitly sview whenever the end user does not explicitly specify a ditransparent for the CDS runtime, which means that the Vilevel. Therefore, the consumption framework is responsiblas a parameter binding when the view is invoked.

Consumption.derivation This annotation enables derivation of the value for a paramby selecting a row from a given entity (table).

An element can be annotated with Consumption.derivConsumption.filter is present. The derivation is then empty derivation of a hidden and mandatory parameter/�

Scope: #ELEMENT, #PARAMETER

Evaluation Runtime (Engine): This annotation will be inter

Consumption.derivation.binding.targetElement This sub-annotation enables provision of a parametrizationlookupEntity or procedure.

Value Description

elementRef

Consumption.derivation.binding.targetParameter This annotation enables provision of a parametrization for lookupEntity procedure. This sub-annotation speci�esprocedure.

Value Description

parameterRef

Consumption.derivation.binding.type This sub-annotation speci�es how the target is �lled (by a element).

The following enumerations (String (10)) are provided

Value Description

#ELEMENT

NoteThe defaultValue annotation is only allowed for Viewvalues can only be speci�ed within �lters. Hence, the [email protected] has to be us

NoteAnnotation of a non-�ltered element of the projection list

Page 20: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 20/119

Annotation Meaning

#PARAMETER

#CONSTANT

Consumption.derivation.binding.value This sub-annotation contains, depending on the type, the c(without : or $parameter) or the element name.

Value Description

String (512) constant value, parameter namelement name

Consumption.derivation.lookupEntity Reads the result to �ll the parameter.

Values: Description

entityRef

Consumption.derivation.resultElement Element of the entity/scalar export parameter of the proce

Values: Description

elementRef

Consumption.derivation.resultElementHigh Element of the intervall export parameter of the procedure

Values: Description

elementRef

Consumption.derivation.resultHierarchyNode.nodeTypeElement This annotation has to reference a �eld in the lookup entityConsumption.derivation either resultElement or

A chargeable node is a node with node type equal to the el

There is the need to distinguish between the node (a set of

If the selected value forConsumption.derivation.resultHierarch

then the leaf will be addressed.

If the value is equal to the element, for which it is uthere is no node with such a name, then the leaf is

NoteIf parameter values are used in this sub-annotation, the cdeclared before the parameter that is to be derived.i

NoteAll provided annotation values are treated case sensitive.

Example1000/4711 is a costcenter which has further costcenter

ExampleIf the selected record from the lookup entity is equal to (ncostCenter) = (space, 1000, 4711) means always the leaf.the node. If this does not exist, then it is interpreted as a

Page 21: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 21/119

Annotation Meaning

Values: Description

elementRef This is a �eld in the lookup viedescribes the node type. The vnodeType, have to be element nview (@ObjectModel.dataC

Consumption.derivation.resultHierarchyNode.mapping The view de�ned in lookupEntity contains �elds which can hierarchy node view. The mapping of the �elds is describedConsumption.derivation.resultHierarchyNode

and can be omitted, if the �eldnames in the lookup entity cview.

Array of: Description

hierarchyElement :

elementRef

lookupElement:

elementRef

Consumption.filter This annotation enables �ltering elements of the underlyinexecuting a query on the view.

Scope: #ELEMENT

Evaluation Runtime (Engine):

SADL - Translates the following CDS annotations inannotations:

Consumption.filter.defaultValue

Consumption.filter.hidden

Consumption.filter.mandatory

Consumption.filter.multipleSele

Consumption.filter.selectionTyp

Analytic Manager supports additionally to the undfollowing annotations:

Consumption.filter.defaultValue

Consumption.filter.defaultHiera

Consumption.filter.hierarchyBin

Consumption.filter.hierarchyBin

Consumption.filter.hierarchyBin

CautionConsumption.filter.de

an element name which desc

NoteThis element should be exposed by UIs. UIs based on Anavariables.

Page 22: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 22/119

Annotation Meaning

Consumption.filter.defaultValue This annotation can be used to provide a �xed default valutransparent for the CDS runtime, which means that the coextending the - This annotation will be interpreted by the a

The default value is either proposed to the end user or impof the view whenever the end user doesn’t explicitly specify

Value Description

Expression Characteristic members need tnoncompounded format.

Consumption.filter.defaultValueHigh This annotation, together with Consumption.filter.ddefault interval.

Value Description

Expression Characteristic members need tnoncompounded format.

Consumption.filter.defaultHierarchyNode.nodeType Consumption.filter.defaultHierarchyNode can Consumption.filter.selectionType = #HIERAR

In Consumption.filter.hierarchyBinding, the hie

The nodeType-annotation references to elements in the h

Value Description

elementRef

Consumption.filter.defaultHierarchyNode.node The node - This-annotation references to elements in the h

Array of: Description

element :

elementRef

value : expression Elements with value initial can

Consumption.filter.hidden The �lter will not be shown in the UIs. In combination with at runtime without user interaction.

Value Description

Boolean (true,

false)De�nes whether the �lter is hid

Default: true

Consumption.filter.hierarchyBinding.type This annotation determines how the key element is �lled (belement or by a user input �eld).

Value Description

#ELEMENT Name of an element, which hasvalue is used for this hierarchy

#PARAMETER Parameter name

#CONSTANT Constant

Page 23: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 23/119

Annotation Meaning

#USER_INPUT USER_INPUT is optional. It wilquery. It can contain a name. Uprovided with the same user inthe list of all values in accordanConsumption.filter.hie

Consumption.filter.hierarchyBinding.value This annotation contains, depending on the type, a literal v$parameter), the element name and an identi�er for the

Value Description

String(512)

Consumption.filter.hierarchyBinding.variableSequence This annotation allows you to specify the order of parametUIs.

In case �lters or parameters are not annotated, they are diorder of appearance in the CDS document.

Value Description

Integer This number de�nes the positioinput �eld.

Consumption.filter.mandatory To prompt the “Filter UI” to enforce a user entry for a (semdefault value exists (for example, de�ned through a CASE e

Value Description

Boolean (true,

false)

Consumption.filter.multipleSelections This annotation indicates the lines that can be entered on �the following selectionType values:

Value Description

selectionType

SINGLE andmultipleSelections

= true

IN list

selectionType

INTERVAL andmultipleSelections

= false

Single interval

NoteYou can also use the annotationAnalyticsDetails.query.hierarchyBinding.v

ExampleThe user deletes the proposal for a mandatory �lter in thmessage "Please enter a value for �lter ...". After the useris then sent to the engine. Therefore, the Filter UI ensuresengine is never performed for mandatory �lters.

Page 24: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 24/119

Annotation Meaning

selectionType

INTERVAL andmultipleSelections

= true

Several intervals

selectionType

RANGE andmultipleSelections

= true

Several ranges (complete (ABA

selectionType

HIERARCHY_NODE andmultipleSelections

= true/false

Single node, several nodes

Consumption.filter.selectionType This annotation determines how values can be entered.

Value Description

SINGLE Single value

INTERVAL Special case of a range with siBT.

RANGE A range is a complete (ABAP lik(including/excluding) and oper

HIERARCHY_NODE Hierarchy node (means everyth

Consumption.groupWithElement This annotation enables recognition of View/ Entity eleon the values of other elements and can only be understoo

Scope: #ELEMENT

Evaluation Runtime (Engine): This annotation will be inter

Value Description

elementRef

NoteWhenever such elements are used for querying grouped should also be included in the query's "group by" express

Page 25: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 25/119

Annotation Meaning

Consumption.hidden This annotation prevents �elds from being exposed by ODa�elds from being available to the client. This is necessary fparameters need to be �lled by the runtime engine, but mu

Scope: #ELEMENT, #PARAMETER

Evaluation Runtime (Engine):

SADL - Prevents �elds from being exposed by ODa

Analytic Manager - For #ELEMENT: In the Analyticevaluated if the element represents a measure. Typmeasure, which serves as an intermediate result anQuery result.

Value Description

Boolean (true,

false)De�nes whether �elds are avai

Default: true

Consumption.labelElement This annotation enables consumer frameworks (such as Uwhich elements the explanatory texts for the "identi�er" el

In cases where both the identifier elements and the teidentifier elements are annotated with the labelEleelement that contains the label text. A labelElement angroupWithElement annotation of the "text" element po

Scope: #ELEMENT, #PARAMETER

Evaluation Runtime (Engine): SADL - The referenced elemthe annotated �eld in OData exposure scenarios.

Value Description

elementRef

Consumption.semanticObject This annotation enables annotation of SAP-speci�c businestandardized business semantics covered by the @Semant

Consumers may leverage this enrichment for enhanced int

Scope: #ELEMENT, #PARAMETER, #TABLE FUNCTION, #

Evaluation Runtime (Engine): SADL - Translates CDS annoannotations.

NoteThe �eld will not be exposed to UIs.

NoteWe recommend to use ObjectModel.text.elementConsumption.labelElement annotation.

ExampleSAP Fiori has introduced the concept of intent-based navcombination of <semanticObject> <action>. A semSAP Fiori UIs to dynamically derive navigation targets for

Page 26: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 26/119

ExamplesExample 1

The annotations Consumption.labelElement and Consumption.quickInfo are used to link the corresponding text andID �elds:

Example 2

The annotation Consumption.groupWithElement is used to de�ne that the element CompanyName depends semanticallyon the element BuyerGuid. In the case of an aggregated table, the �elds can be displayed combined:

Annotation Meaning

Value Description

String For more information Based on

Consumption.valueHelp This annotation enables referencing of the association to athe value help object for the annotated element.

The ON condition of the referenced association speci�es horetrieved for the element. Generic UI consumers have to idand use the referenced association to retrieve the values.

Instead of de�ning the "Value element" of the value help viassociation, you can also specify the "value element" in theequal ON conditions for the "value element".

Scope: #ELEMENT, #PARAMETER

Evaluation Runtime (Engine):

SADL - Derives a default value help support from t

Analytic Manager

Value Description

elementRef

Sample Code

DEFINE VIEW SalesOrder AS SELECT FROM sepm_cds_sales_order AS so { key so.sales_order_id AS SalesOrderId, @Consumption.labelElement: 'CompanyName' @Consumption.quickInfoElement: 'CompanyDescription' so.buyer_guid AS BuyerGuid,

so.company_name AS CompanyName, so.description AS CompanyDescription }

Sample Code

DEFINE VIEW SalesOrder with parameters AS SELECT FROM sepm_cds_sales_order AS so {

Page 27: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 27/119

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:

Example 4

The annotation Consumption.defaultValue is used to specify default values for parameters. In this example, the currencyEUR is used:

Example 5

The annotation Consumption.valueHelp is used to expose an association as a value help. In this example, the CDS viewCurrencyCodeValueHelp is used for the �eld CurrencyCode:

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 }

Sample Code

DEFINE VIEW SalesOrder AS SELECT FROM sepm_cds_sales_order AS so ASSOCIATION [0..1] TO sepm_cds_business_partner AS _Customer on $projection.BuyerGuid = _Customer.business_partner_key { key so.sales_order_id AS SalesOrderId, @Consumption.hidden: true so.buyer_guid AS BuyerGuid, _Customer.company_name AS CompanyName }

Sample Code

DEFINE VIEW SalesOrder with parameters @Consumption.defaultValue: 'EUR' p_TargetCurrency : snwd_curr_code AS SELECT FROM sepm_cds_sales_order AS so { key so.sales_order_key AS NodeKey, $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 }

Page 28: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 28/119

Example 6

The association Consumption.semanticObject is used to assign semantic objects to CDS views or elements that can beused in the UI for intent-based navigation.

Example 7

The annotation Consumption.filter is used to enable �lters for values. In this example, product_hierarchy is �lteredfor several single values of calendar_day, and for one single interval of product.

Example 8

Sample Code

DEFINE VIEW CurrencyCodeValueHelp AS SELECT FROM currency_code { key CurrencyCode, CurrencyName, CurrencyDescription }

DEFINE VIEW SalesOrder AS SELECT FROM sepm_cds_sales_order AS so ASSOCIATION [0..1] TO CurrencyCodeValueHelp AS _Currency on $projection.BuyerGuid = _Customer.business_partner_key { so.sales_order_id AS SalesOrderId,

@Consumption.valueHelp: '_Currency' so.currency_code AS CurrencyCode,

so.gross_amount AS GrossAmount }

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, }

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 ... }

Page 29: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 29/119

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.

Example 9

This example shows how to specify hierarchy nodes as default value in the Consumption.filter annotation. A consumptionview should provide a prompt for a hierarchy node of a costcenter hierarchy with default 1000/ALL (HierarchyNode).

Example 10

This example shows how to enable the Consumption.derivation annotation to return hierarchy nodes. The annotationConsumption.derivation.resultHierarchyNode is used to return hierarchy nodes. Given a viewCostcenterResponsible with �elds �eld1, �eld2, �eld3, �eld4, and responsible. The query view should �lter by thecostcenter nodes the given responsible (parameter) is responsible for.

The hierarchy binding is derived from Consumption.filter.hierarchyBinding. Consumption.derivation can onlybe used in combination with Consumption.filter. Futhermore Consumption.filter.selectionType:#HIERARCHY_NODE has to be true.

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, ... }

Sample Code

@Consumption.filter{ selectionType: #HIERARCHY_NODE ; defaultHierarchyNode: { nodeType : ‘HierarchyNode’ ; node: [ { element: ‘ControllingArea’ ; value: { element: ‘HierarchyNode’ ; value: ‘A hierarchyBinding: [ … ] }; costCenter;

Sample Code

@Consumption.filter: { selectionType: #HIERARCHY_NODE ; hierarchyBinding: [ … ] }; @Consumption.derivation.resultHierarchyNode: { lookupEntity: ‘CostcenterResponsible’; nodeTypeElement: ‘field1’; mapping: [ { hierarchyElement : ‘ControllingArea’ ; lookupElement: ‘field2’ } ; { hierarchy Element: ‘CostCenter’ ; lookupElement: ‘field3’ }; { hierarchyElement: ‘HierarchyNode’ ; lookupElement: ‘field4’ } ] }; @Consumption.hidden: true; costCenter;

Page 30: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 30/119

DefaultAggregation AnnotationsSpeci�es aggregation behavior on element level

Scope and De�nition

Usage

Annotation Meaning

DefaultAggregation When the DefaultAggregation annotation has been speci�ed for an element, the correspondingelements 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 statementsyou 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,

COUNT, COUNT_DISTINCTAll these values determine the default aggregation of the measure.

FORMULA The value FORMULA indicates, that the element is a formula whichhas to be calculated after the operands have been determined byaggregation or calculation. It should never be aggregated.

Example: Margin : = Revenue / Cost. If in a report Margin should beshown per OrgUnit, then �rst the aggregates of Revenue and Costhave to be determined per OrgUnit and then the Margin has to becalculated per OrgUnit.

NONE This value indicates that the element is not a measure. Usuallythese 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 valuesFORMULA for formulas and NONE value (no aggregation takes place) for other select list entries. Since these are the default valuesassumed when DefaultAggregation is absent, this annotation may be omitted altogether (Exception: addressing of1ROWCOUNT - see example Counters and exception aggregation below).

ExamplesExample 1

Counters and exception aggregation

@Scope:[#ELEMENT] Annotation DefaultAggregation : String enum { NONE; SUM; MIN; MAX; AVG; COUNT; COUNT_DISTINCT; FORMULA

CautionThe analytic manager doesn't support the following values: AVG,COUNT, COUNT_DISTINCT.

Page 31: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 31/119

For CDS views representing master data reports (i.e. the FROM clause refers to a CDS view categoriezed as #DIMENSION), acounter of the different dimension values can be de�ned by combining the annotation DefaultAggregation: #SUM with aselect list entry containing constant value 1:

This way no exception aggregation is involved which leads to improved performance of the report.

Related InformationAnalyticsDetails Annotations

EnterpriseSearch Annotations

Scope and De�nition

Sample Code

@EndUserText.label: 'CostCenters per ControllingArea'

@Analytics.query: true

define view ControllingAreaView

as SELECT from CostCenterDimension {

controllingArea,

@DefaultAggregation: #SUM

1 as costCenterCount // because of #SUM aggregation this will be mapped to measure 1ROWCOUNT ge

}

NoteThis pattern can be combined with CAST statements (for reusing texts of DDIC data types) and/or CASE statements (forde�ning restricted measures). But you must not use other constants than 1 or add annotationAnalytcisDetails.query.formula.

NoteThese 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 customerprojects.

@Scope:[#VIEW, #TABLE_FUNCTION, #ENTITY] Annotation EnterpriseSearch { enabled : Boolean default true; }; @Scope:[#ELEMENT] Annotation EnterpriseSearch { expand : Boolean default true;

filteringFacet : { default }; defaultValueSuggestElement : true;

Page 32: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 32/119

Usage

Annotation Meaning

EnterpriseSearch.enabled De�nes if a CDS view is generally relevant for search scenarios based on SAPHANA Enterprise Search.

Scope: #View

Evaluation Runtime (Engine): Interpreted by Enterprise Search

Values:

Value Description

Boolean (true, false) De�nes whether a CDS view is relevant forEnterprise Search or not. If it is set to true asearch connector is created in Enterprise Searchautomatically.

Default: true

EnterpriseSearch.filteringFacet Speci�es that the element is to be considered as a request �eld which is usedfor facetted search (also named interactive navigation or guided navigation).

Scope: #Element

Evaluation Runtime (Engine): Interpreted by Enterprise Search

Values:

Value Description

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>'; }; };

NoteEnterpriseSearch annotations require the [email protected] for the same view.

Page 33: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 33/119

Annotation Meaning

{ default } De�nes weather the element is to be consideredas a request �eld in facetted search.Default: { default }

EnterpriseSearch.defaultValueSuggestElement Speci�es that the element is to be considered for suggestions (also namedtype-ahead or auto-completion function).

Scope: #Element

Evaluation Runtime (Engine): Interpreted by Enterprise Search

Values:

Value Description

Boolean (true, false) De�nes weather the element is to be consideredfor suggestions.

Default: true

Related InformationSearch Annotations

Hierarchy AnnotationsEnables 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 and De�nition

@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; }; };

Page 34: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 34/119

UsageThe parent-child hierarchy is based directly on the master data entities. The hierarchy is time-dependent if the master data entityis as well. The hierarchy is de�ned either by one parent element (with Hierarchy.parentChild.recurseBy) or by multipleparents (with Hierarchy.parentChild.recurse). A parent element describes a self-referencing relationship within themaster 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 parentelement. One or more parent-child hierarchies can be de�ned within the same master data entity.

On entity level the following metadata can be de�ned:

Annotation Meaning

Hierarchy.parentChild.directory For external hierarchies, the view of hierarchy nodes often contains tmultiple alternative hierarchies. A user is supposed to choose a singfor display, and his/her selection is used as a �lter when selecting frhierarchy node view. The directory annotation identi�es an assochierarchy directory association, from the hierarchy node view to a vcalled hierarchy directory), providing all available alternative hierarchierarchy node view.

Scope: #VIEW

Evaluation Runtime (Engine): Analytic manager: The hierarchy direas user input help, and a chosen hierarchy directory entry is used to nodes via the hierarchy directory association.

Value Description

associationRef Name of the hierarchy directory to �lter the nodes

Hierarchy.parentChild.label User-friendly name of the hierarchy.

Scope: #VIEW

Evaluation Runtime (Engine): Analytic manager: This name can be input help for Hierarchy.parentChild.name.

Values (optional):

Value Description

String Description of the hierarchy.

NoteA 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”.

Page 35: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 35/119

Annotation Meaning

Hierarchy.parentChild.multipleParents Indicates that multiple parents might occur in the hierarchy.

Scope: #VIEW

Evaluation Runtime (Engine): The analytic manager can handle hiemultiple roots. This annotation is only relevant for engines that cannmultiple roots.

Value Description

Boolean (true, false) De�nes whether multiple parentthe hierarchy or not.

Default: true

Hierarchy.parentChild.name Technical name of the hierarchy. Only relevant if the view de�nes oneonly, and Hierarchy.parentChild.directory is not used.

Scope: #VIEW

Evaluation Runtime (Engine): Analytic manager: The hierarchy is acqueries or in program logic later on via this name.

Value Description

String Technical name of the hierarchy.

Hierarchy.parentChild.orphanedNode.handling De�nes how nodes without a parent (more precisely with a parent thoccur as a child) are processed.

Scope: #VIEW

Evaluation Runtime (Engine): Depending on the annotation value, thmanager will ignore orphaned nodes, treat them as root nodes, put tstep parent node or raise an error.

Value Description

ROOT_NODES Treat nodes as root nodes (defau

ERROR Stop processing and show an er

IGNORE Ignore nodes and remove them fhierarchy.

STEPPARENT_NODE Put nodes under a step parent n

NoteIn a geographic hierarchy for example, you might want to assign thTurkey to the continents Europe and Asia.

CautionWe need to distinguish the above use case from the following one: hierarchy YEAR, QUARTER, MONTH January under 2011 and Janua2012 are not the same member with multiple parents. They are diffJanuaries.

Page 36: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 36/119

Annotation Meaning

Hierarchy.parentChild.orphanedNode.stepParentNodeId De�nes how nodes without a parent (more precisely with a parent thoccur as a child) are processed.

Scope: #VIEW

Evaluation Runtime (Engine): Analytic manager:

With the annotationHierarchy.parentChild.orphanedNode.handling

STEPPARENT_NODE this annotation contains the node ID(s)parent node(s).

With parent-child hierarchies, you need to de�ne a step parefor each component (each parent-child combination).

Value Description

stepParentNodeId node ID(s) of the step parent nod

Hierarchy.parentChild.recurse.child If the underlying view de�nition does not contain an association de�parent-child relationship but only “normal” elements, this annotatioused to de�ne the children.

Scope: #VIEW

Evaluation Runtime (Engine): Analytic manager

Value Description

array of elementRef; The element names de�ne the kof the “child”.

Hierarchy.parentChild.recurse.parent If the underlying view de�nition does not contain an association de�parent-child relationship but only “normal” elements, this annotatioused to de�ne the parents.

Scope: #VIEW

Evaluation Runtime (Engine): Analytic manager

Value Description

array of elementRef; The element names de�ne the kof the “parent”.

Hierarchy.parentChild.recurseBy De�nes the parent-child relationship in a hierarchy based on an existassociation from hierarchy node to its parent node in the same view.

Scope: #VIEW

Evaluation Runtime (Engine): Analytic manager

Value Description

elementRef The name of the parent-child assneeds to be speci�ed here.

Hierarchy.parentChild.rootNode.visibility Using this annotation, you can de�ne dedicated metadata for how tonode(s) in the hierarchy.

Scope: #VIEW

Evaluation Runtime (Engine): Depending on the annotation value, thmanager might add an extra root node to the hierarchy. The label of the value of Hierarchy.parentChild.label.

Page 37: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 37/119

ExamplesExample 1

Parent Child Hierarchy for Views with Associations:

Annotation Meaning

Value Description

ADD_ROOT_NODE_IF_DEFINED The system will add the root nodhierarchy if it is explicitly de�nedsystem will not add an extra arti�node. This is the default.

ADD_ROOT_NODE The system will always add an asingle root node to the hierarchynodes are descendants of this no

DO_NOT_ADD_ROOT_NODE The system will not add an arti�root node to the hierarchy.

Hierarchy.parentChild.siblingsOrder.by Hierarchy.parentChild.siblingsOrder de�nes the order othe same parent.

Hierarchy.parentChild.siblingsOrder.by de�nes the elewhich contains the values to be ordered.

Scope: #VIEW

Evaluation Runtime (Engine): The analytic manager sorts all childrein the given order.

Value Description

elementRef element name

Hierarchy.parentChild.siblingsOrder.direction Hierarchy.parentChild.siblingsOrder de�nes the order othe same parent.

Hierarchy.parentChild.siblingsOrder.direction de�norder of values with the same parent is “ascending” or “descending”

Scope: #VIEW

Evaluation Runtime (Engine): The analytic manager sorts all childrein the given order.

Value Description

ASC The sort order is ascending (defa

DESC The sort order is descending.

Sample Code

@Analytics : { dataCategory : #DIMENSION, replicationEnabled } @Hierarchy.parentChild : [ { name : ‘Organisation’, recurseBy : ‘Manager’} ] entity Employee { key ID : String(8); Manager : Association to this; ... };

Page 38: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 38/119

Example 2

Parent Child Hierarchy for Views without Associations:

Example 3

Hierarchy Directory Association:

ObjectModel AnnotationsProvide de�nitions of structural as well as transactional related aspects of the business data model

Scope and De�nition

Sample Code

@Analytics : { dataCategory : #DIMENSION, replicationEnabled } @Hierarchy.parentChild : [ { name : ‘Organisation’, recurse : { parent : [ ‘Manager’ ] , child : [ ‘ID’] } } ] entity Employee { key ID : String(8); Manager : String(8); ... };

Sample Code

@Analytics : { dataCategory : #HIERARCHY } @Hierarchy.parentChild : { recurseBy : ‘ParentNode’, directory: ‘CostCenterHierarchyDirectory’ } entity CostCenterHierarchyNode { key CostCenterHierarchyDirectory : Association to CostCenterHierarchyDirectory; key HierarchyNode : CostCenterHierarchyNode; ParentNode : Association to this; ... };

@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;

Page 39: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 39/119

Usage

Annotation Meaning

ObjectModel.association.type[ ] De�nes the association type that is used for de�ninview hierarchy.

Scope: [ELEMENT]

Evaluation Runtime (Engine):

SADL: In�uences the scope of the OData au(@OData.publish:true): All views that aview hierarchy are automatically included inservice.

BOPF: In�uences the scope of the BOPF Bugeneration(@ObjectModel.transactionalProcetrue): All views that are included in the viewautomatically included in the same BOPF bu

Values:

Value Description

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; };

Page 40: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 40/119

Annotation Meaning

#TO_COMPOSITION_CHILD Within the composthere must be a#TO_COMPOSITIO

association leadingview of a given view

#TO_COMPOSITION_PARENT Views that do not rthe hierarchy mustto their compositioannotated with#TO_COMPOSITIO

#TO_COMPOSITION_ROOT Additionally, viewsrepresent the root #TO_COMPOSITIO

for performance reauthorization checrestrictions) basedroot views).

NOTE: In such a cathe hierarchy [email protected]

true .

ObjectModel.compositionRoot De�nes the root of a compositional hierarchy

Scope: [VIEW]

ObjectModel.createEnabled If this annotation has value true, it is allowed to cre

Scope: [VIEW]

Evaluation Runtime (Engine):

SADL: Exposes this information

BOPF: Rejects create requests that do not pfor this �eld (in case of static �eld control). 'EXTERNAL_CALCULATION', the create pin a BOPF property determination (dynamic

ObjectModel.dataCategory De�nes the category of data that is represented by values.

Scope: [VIEW]

Evaluation Runtime (Engine): In ABQL joins betweeentity without explicit language key handling will be(0,1) association, where the language key is defaultelanguage.

Values:

Value Description

#TEXT Indicates that the represents texts. Uelement is of type

NOTE: Within the Valways language-d

Page 41: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 41/119

Annotation Meaning

#HIERARCHY Indicates that the hierarchy-related dheader informatioinformation.

ObjectModel.deleteEnabled If this annotation has value true, it is allowed to deinstances.

Scope: [VIEW]

Evaluation Runtime (Engine):

SADL: Exposes this information

BOPF: Rejects delete requests that do not pfor this �eld (in case of static �eld control). 'EXTERNAL_CALCULATION', the delete pin a BOPF property determination (dynamic

ObjectModel.enabled If this annotation has the value true, the corresponor association) is supported at runtime.

Scope: [ELEMENT]

Evaluation Runtime (Engine): SADL: Exposes this i

ObjectModel.entityChangeStateId This annotation is related to a single �eld that contaof an active document. The change state is always uthe document is changed. Usually, �elds like last chhash values, or version counters are used as Entit

Scope: [VIEW]

ObjectModel.foreignKey.association De�nes association to a view that represents a valuthe annotated �led. The annotated �eld must be vaannotated representative key �eld of the target viewtarget cardinality of the association has to be 1.

Scope: [ELEMENT]

Evaluation Runtime (Engine):

Analytic Manager: Uses associated view asthe annotated �eld.

SADL: Derives a default value help support relationship.

ObjectModel.hierarchy.association This annotation can be added to the key �eld that sassociation to a hierarchy view. The hierarchy view dhierarchy for the instances of the current view and [email protected]: #HIERARCHY

Scope: [ELEMENT]

Evaluation Runtime (Engine):

Analytic Manager: Uses associated view for hierarc

Page 42: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 42/119

Annotation Meaning

ObjectModel.lifecle.enqueue.expiryBehavior The creation of an exclusive draft related to an existcauses an exclusive durable lock of the active documlifecycle.enqueue.* annotations allow to ovedefaults for the durable lock expiration handling. Aftime, the durable exclusive lock on the active documreleased. This period of time is de�ned by the expira

Enqueue Expiration Behavior:

RELATIVE_TO_ENQUEUE_START - The pefrom the point in time the exclusive durableinitially acquired.

RELATIVE_TO_LAST_CHANGE - The intervperiod of inactivity (no modifying roundtripsdocument), after that the exclusive durableremoved

Scope: [VIEW]

Evaluation Runtime (Engine): The lifecycle servicesunlock active documents accordingly to the de�nedbehavior.

ObjectModel.lifecle.enqueue.expiryInterval Using this annotation, you can specify an interval toduration.The value must be compliant to the dayTimeDura(http://www.w3.org/TR/xmlschema11-2/#dayTime

Scope: [VIEW]

ObjectModel.lifecle.enqueue.notificationBeforeExpiryInterval To notify the draft processor in advance before the eplace, a noti�cation will be send. The default warninoverruled by the help of annotationnotificationBeforeExpiryInterval using tdayTimeDuration format (http://www.w3.org/TR2/#dayTimeDuration).

Scope: [VIEW]

ObjectModel.lifecle.processing.expiryBehavior After the durable lock expiration phase has been proexclusive draft, the durable lock of its active documHowever for draft-aware applications it is still not aldraft related to the same active document until the existing draft is expired.

The lifecycle.processing.* annotations alloglobal defaults for the draft processing expiration hcertain period of time, the processor is removed froand a different user is allowed to create a new draft active document. In that case, the �rst draft is deletediting for the �rst draft can be continued at a later

The default processing expiration settings can be ovlifecycle.enqueue.* annotations by the help oduration interval and noti�cation interval.

Scope: [VIEW]

Evaluation Runtime (Engine): The lifecycle servicesthe processing status of a draft accordingly to the dexpiration behavior.

Page 43: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 43/119

Annotation Meaning

ObjectModel.lifecle.processing.expiryInterval Using this annotation, you can specify an interval toduration interval.

Scope: [VIEW]

ObjectModel.lifecle.processing.notificationBeforeExpiryInterval Using this annotation, you can specify an interval tonoti�cation interval.

Scope: [VIEW]

ObjectModel.mandatory If this annotation has value true, the �eld must be consumer when executing a modi�cation.

Scope: [ELEMENT]

Evaluation Runtime (Engine):

SADL: Exposes this information

BOPF: Rejects modi�cations that do not prothis �eld (in case of static �eld control). Wit'EXTERNAL_CALCULATION', the mandatocalculated in a BOPF property determinatiocontrol).

ObjectModel.modelCategory Each business object can semantically be categorizmodel setting

Scope: [VIEW]

Evaluation Runtime (Engine): The model category runtime effect but is used for a semantic grouping, fbrowsers.

Values:

Value Description

#BUSINESS_OBJECT View that represenobject

ObjectModel.readOnly If this annotation has the value true, the �eld mustthe consumer.

Scope: [ELEMENT]

Evaluation Runtime (Engine):

SADL: Exposes this information

BOPF: Rejects modi�cations when updatingde�ned as @ObjectModel.readOnly: tstatic �eld control). With the value'EXTERNAL_CALCULATION', the readonlycalculated in a BOPF property determinatiocontrol).

Page 44: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 44/119

Annotation Meaning

ObjectModel.representativeKey Most speci�c element (�eld or managed associatio(indicated by the keyword KEY) that represents the is based on. This element shall be used as the anchokey relationships (except for text views): The foreigncorresponding to the representative key representscan be called representative foreign key element. Thassociation is de�ned on the representative foreign name of the representative key typically equals the represented by the view.

For non-text views it is the key element for which thvalue list/check table. For text views(@ObjectModel.dataCategory: #TEXT) it ideelement to which the text �elds relate to.

The representative key element has to be modelled there is only one primary key �eld (no implicit deriv

A view may only become a target of a foreign key asrepresentative key element (exception: language demay not be used as targets of foreign key relationsh

Scope: [VIEW]

Evaluation Runtime (Engine): Analytic Manager: Ingrouping by the entity and the hierarchical represenare handled using the representative foreign key �e

ObjectModel.semanticKey[ ] Identi�es an instance of an entity from business perhuman-readable �eld values. It does neither containdependent nor other technical components (for exaindicator). Thus it may be ambiguous resulting in mrecords/instances of a view that may need to be �ltinformation (for example: current date, preferred la

For a given entity, only a single semantic key is de�n

Scope: [VIEW]

Evaluation Runtime (Engine): UI: Uses semantic keand navigation.

ObjectModel.text.association De�nes the associated view (annotated [email protected]: #TEXT), whichdescriptions for the annotated �eld.

NOTE: The usage of this annotation excludes the [email protected].

Scope: [ELEMENT]

Evaluation Runtime (Engine):

SADL - Enriches the OData entity type of thtextual description of the target view applyilanguage �ltering. The name of the auto-genwill be composed out of the annotated �eld constant suffix _Text. This OData property is�rst text �eld of the associated target CDS [email protected]:true.

Analytic Manager - Uses the associated vieannotated �eld.

Page 45: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 45/119

Annotation Meaning

ObjectModel.text.element[ ] Establishes the conjunction of a �eld with its descriindependent texts.NOTE: The usage of this annotation excludes the [email protected].

Scope: [ELEMENT]

Evaluation Runtime (Engine): SADL - First text �eldannotation array will be handled as descriptive text in OData exposure scenarios.

ObjectModel.transactionalProcessingEnabled Enables the transactional runtime support. It may oroot view level (@ObjectModel.compositionRo

Scope: [VIEW]

Evaluation Runtime (Engine):

BOPF: Depending on the speci�ed @Objec>Persistence information, we can distingscenarios:

a) writeActivePersistence: Active daCDS view) is directly modi�ed by the transa(without having any kind of draft).

b) writeDraftPersistence: Active dataCDS view) is only indirectly modi�ed by a dr

c) writeActivePersistence & writeDBoth the draft and the active data are writtetransactional runtime.

ObjectModel.transactionalProcessingDelegated Indicates that transactional accesses to the view artransactional runtime of the underlying view ([email protected]

may only be de�ned on root view level(@ObjectModel.compositionRoot:true).

Scope: [VIEW]

Evaluation Runtime (Engine):

SADL: Uses the information to delegate reqtransactional runtime

ObjectModel.updateEnabled If this annotation has value true, it is allowed to upinstances.

Scope: [VIEW]

Evaluation Runtime (Engine):

SADL: Exposes this information

BOPF: Rejects modi�cation requests that dtrue for this �eld (in case of static �eld con'EXTERNAL_CALCULATION', the update pin a BOPF property determination (dynamic

Page 46: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 46/119

ExamplesExample 1

This example demonstrates how you can de�ne a compositional hierarchy.

Example 2

Annotation Meaning

ObjectModel.writeActivePersistence De�nes the DDIC database table name of the [email protected]

Scope: [VIEW]

ObjectModel.writeDraftPersistence De�nes the DDIC database table name of the draft [email protected]

Scope: [VIEW]

ObjectModel.writeEnabled - Deprecated! Enables the transactional runtime support. It may oroot view level (@ObjectModel.compositionRo

Scope: [VIEW]

Evaluation Runtime (Engine):

BOPF - Depending on the speci�ed persistence infodistinguish between the folllowing scenarios:

a) writeActivePersistence: Active data (de�nis directly modi�ed by the transactional runtime (wkind of draft).

b) writeDraftPersistence: Active data (de�neis only indirectly modi�ed by a draft.

c) writeActivePersistence & writeDraftPethe draft and the active data are written by the trans

CautionDo not use this annotation an more! It is replaced ObjectModel.transactionalProcessingE

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, ... }

define view I_SalesOrderItem association [1..1] to I_SalesOrder as _SalesOrder ... { @ObjectModel.association.type: [#TO_COMPOSITION_ROOT, #TO_COMPOSITION_PARENT] _SalesOrder, ... }

Page 47: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 47/119

This example demonstrates how you can de�ne foreign key relationship.

Example 3

This example demonstrates how you can de�ne language-dependent texts

Example 4

This example demonstrates how you can de�ne language-independent texts

Example 5

This example demonstrates how you can de�ne the transactional behavior

Sample Code

define view I_SalesOrderItem association [0..1] to I_Material as _Material on $projection.Material = _Material.Material ... { @ObjectModel.foreignKey.association: ’_Material’ Material, _Material, ... }

@ObjectModel.representativeKey: ’Material’ define view I_Material ... { key Material, ... }

Sample Code

define view I_Material association [0..*] to I_MaterialText as _Text ... { @ObjectModel.text.association: ’_Text’ key Material, _Text, ... }

@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, ... }

Sample Code

define view I_Plant ... { @ObjectModel.text.element: [’PlantName’] key Plant, @Semantics.text: true PlantName, ... }

Page 48: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 48/119

OData AnnotationsCapture OData-related aspects to expose data gained from a CDS entity in an OData service.

Scope and De�nition

Usage

Annotation Meaning

OData.publish OData.publish is intended for generating an OData service.

Scope: [VIEW, TABLE_FUNCTION]

Evaluation Runtime (Engine): SADL

Values:

Value Description

true Has to be set to generate an OData service

false De�nes that this CDS entity cannot be exposed for an OData service

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

@ObjectModel.compositionRoot: true @ObjectModel.transactionalProcessingEnabled: true @ObjectModel.writeDraftPersistence: ‘<DraftDDICTable>’ define view I_MaterialWithDraft ... { ... }

@Scope:[#VIEW, #TABLE_FUNCTION] Annotation OData { publish : Boolean default true; };

NoteWhen the CDS entity is activated, the OData service is generated automatically. After activation, it can be opened from theABAP Element Information popup of the corresponding database table.

Subsequently, the OData service also needs to be activated in the transaction /IWFND/MAINT_SERVICE manually.

Sample Code

Page 49: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 49/119

Related InformationExpose CDS View as an OData Service

Search AnnotationsThis annotation marks a view as searchable. You de�ne the fuzziness threshold as well as the speci�cs of term mappings atelement level.

Scope and De�nition

Usage

Annotation Meaning

Search.searchable De�nes if a CDS view or entity is generally relevant for search scenarios. This annotation must beset in case other search-related annotations are being de�ned for elements of the respective CDSview or entity. The annotation offers a general switch and a means to quickly detect whether aview is relevant or not.

Scope: #View

Evaluation Runtime (Engine): Interpreted by Enterprise Search and SADL

Values:

Value Description

Boolean (true, false) De�nes whether a view is relevant for search or not.

Default: true

@OData.publish:true define view SEPM_I_SalesOrder as select from snwd_so { ... }

@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); };

Page 50: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 50/119

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 becausenot all elements (e.g. internal keys) do qualify for this kind of access.

Scope: #Element

Evaluation Runtime (Engine): Interpreted by Enterprise Search and SADL

Values:

Value Description

Boolean (true, false) De�nes weather the element is to be considered in a freestylesearch.Default: true

Search.ranking Speci�es how relevant the values of an element are for ranking, if the freestyle search termsmatch the element value.

Scope: #Element

Evaluation Runtime (Engine) : Interpreted by Enterprise Search

Values:

Value Description

HIGH The element is of high relevancy; this holds usually for ID andtheir 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 thiselement 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.

Scope: #Element

Evaluation Runtime (Engine): Interpreted by SADL

Values:

Value Description

NoteA fuzzy search enables a certain degree of error tolerance and returns records even if thesearch term contains additional or missing characters or other types of spelling errors.

NoteTo perform a fuzzy search you have to set the search mode to fuzzy in the customizingsettings of your ABAP system. Find the customizing node under SAP NetWeaverImplementation Guide Search and Operational Analytics Enterprise Search SearchCon�guration Set Parameters for Federated Search .

If in the customizing a value for Fuzzy Similarity is present, the value of the parameterSearch.fuzzinessThreshold will become void.

Page 51: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 51/119

Annotation Meaning

Decimal (3,2) The least level of fuzziness the element has to have to beconsidered in a fuzzy search at all, e.g. 0.7.

The value can be between 0 and 1.

We recommend using the default value 0.7 to start with. Lateron, you can �ne-tune the search settings based on yourexperiences with the search. You can also �ne-tune the searchusing feedback collected from your users. A value between 0.7and 0.99 would be most useful. Use 1 for exact matches.

Search.termMappingDictionary Speci�es the table that holds the term mappings (synonyms) to be considered in the context of asearch on this view.

Scope: #Element

Evaluation Runtime (Engine): No engine usage right now. Reserved for future usage.

Values:

Value Description

String(128) De�nes the term mapping dictionary, e.g. a table or entity.

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 thiscolumn. This concept has the aim to enable overarching term mapping dictionaries while beingable 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 AnnotationsUsed by the core engines for data processing, analytics, and data consumption

Scope and De�nition

@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;

Page 52: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 52/119

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;

Page 53: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 53/119

Usage

Semantic annotations are used to inform the client as to which of the elements contain a phone number, a part of a name oraddress, 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�cbehavior in the provider/core infrastructure (through dedicated operations or conversion functions).

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; };

Page 54: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 54/119

Semantic annotations allow the standardizing of semantics that only have an impact on the consumption side (such as telephonenumber, mail address, city, and so on).

Annotation Meaning

Annotations belonging to Semantics.address follow the vCard standard (RFC6350 )

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations (Exception: Semantics.address.n

Values:

Semantics.address.type[ ] Description

Values:

String(10)

The following enumerations are provided:

Value Description

HOME Home address

WORK Work address

PREF Preferred addressDefault

OTHER Other address

Semantics.address.city Boolean defaulttrue

The annotated �eld contains a plain-text string that contains the name of a city

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]

Evaluation Runtime (Engine): Interpreted by ABAP Runtime Environment

Values:

Semantics.amount.currencyCode elementRef The annotated �eld contains a monetary amount, and the corresponding curre

Page 55: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 55/119

Annotation Meaning

Annotations belonging to Semantics.businessDate contain information about changes of database table records.

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine): *Business data often carries time validities. When accessing data, one usually intends to get the most current omandatory for the engine to know the semantics in order to carry out a generic validity evaluation.

Values:

Semantics.businessDate.at* Boolean defaulttrue

The annotated �eld indicates that the column contains the key dates and not i

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 obusiness point of view.Technical validity: The from date is different from the point in time when theconfused with dates contained in the data part.

Semantics.businessDate.to*

Semantics.businessDate.lastChangedAt The annotated �eld is the date/time when the database table record was modIt 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 changrelevant, for example, for the ranking of a search result.

Annotations belonging to Semantics.calendar follow the iCalendar standard (RFC5545 )

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations

Values: Boolean default true

Semantics.calendar.dayOfMonth Boolean defaulttrue

The value of the annotated �eld is a day number relative to a calendar month.

Semantics.calendar.dayOfYear The value of the annotated �eld is a day number relative to a calendar year.

Semantics.calendar.month The value of the annotated �eld encodes a calendar month number as a stringdigits.

Semantics.calendar.quarter The value of the annotated �eld encodes a calendar quarter number as a stringdigit.

NoteMany 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 annowould yield incorrect results.

Example1 - 31

Example1 - 366

ExampleThe string matches the regex pattern 0[1-9]|1[0-2]

ExampleThe string matches the regex pattern [1-4]

Page 56: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 56/119

Annotation Meaning

Semantics.calendar.week The value of the annotated �eld encodes a calendar week number as a string fdigits.

Semantics.calendar.year The value of the annotated �eld encodes a year number as a string following thoptional minus sign for years B.C., followed by at least four digits.

Semantics.calendar.yearMonth The value of the annotated �eld encodes a calendar year and month as a stringconsisting of an optional minus sign for years B.C., followed by at least six digitJanuary to December.

Semantics.calendar.yearQuarter The value of the annotated �eld encodes a calendar year and quarter as a strinconsisting of an optional minus sign for years B.C., followed by at least �ve dig

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 digitin the year.

Annotations belonging to Semantics.calendarItem follow the iCalendar standard (RFC5545 ) for representing and exchanging calendaring ajournal entries, and free or busy information, independent of any particular calendar service or protocol

Scope: [ELEMENT, PARAMETER]

Values:

Semantics.calendarItem.categories Boolean defaulttrue

The value of the annotated �eld is used to specify categories or subtypes of thsearching 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 thinformation within an individual calendar entry.The default value is PUBLIC. Other values are PRIVATE, CONFIDENTIAL, iananame (experimental, non-standard parameter).

Semantics.calendarItem.completed The value of the annotated �eld de�nes the date and time that a to-do was act

ExampleThe string matches the regex pattern 0[1-9]|[1-4][0-9]|5[2-3]

ExampleThe string matches the regex pattern -?([1-9][0-9]{3,}|0[0-9]{3})

ExampleThe string matches the regex pattern -?([1-9][0-9]{3,}|0[0-9]{3})

ExampleThe string matches the regex pattern -?([1-9][0-9]{3,}|0[0-9]{3})

ExampleThe string matches the regex pattern -?([1-9][0-9]{3,}|0[0-9]{3})

NoteApplications must treat x-name and iana-token values they do not recognize

Page 57: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 57/119

Annotation Meaning

Semantics.calendarItem.contact The value of the annotated �eld is used to represent contact information or altassociated 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

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

Annotations belonging to Semantics.contact follow the vCard standard (RFC6350 )

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations

Values:

Semantics.contact.type Value: String

The following enumerations are provided:

Value Description

PERSON Content relates to an individual

ORGANIZATION Content relates to an organization, company, etc.

Semantics.contact.birthDate Boolean defaulttrue

This annotated �eld contains the birth date of the individual.

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.

ExampleLOCATION:Conference Room - F123\, Bldg. 002LOCATION;ALTREP="http://xyzcorp.com/conf-rooms/f123.vcf

Page 58: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 58/119

Annotation Meaning

Semantics.currencyCode This annotation tags a �eld containing a currency code

This can be either an ISO code or an SAP currency code (data type CUKY).

Scope: [ELEMENT]

Evaluation Runtime (Engine): Interpreted by ABAP Runtime Environment

Value: Boolean default true

Annotations belonging to Semantics.email follow RFC5322 ).

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations

Semantics.email.type Description

Values: String

The following enumerations are provided:

Value Description

HOME Private email address

WORK Business email address

PREF Preferred email address

OTHER Other email address

Semantics.email.address Boolean defaulttrue

The value of the annotation contains the addresses of the sender and the recipmailbox or a group of mailboxes.

Semantics.email.bcc The value of the annotation contains the recipient list that receive an email, burecipients of the same email.

Semantics.email.body The value of the annotation contains lines of US-ASCII characters.

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 oreceives a message for delivery or further processing.

Semantics.email.sender The value of the annotated �eld speci�es the mailbox of the agent responsibleexample, 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

NoteThe attribute address should be used in case a mail address is included – independent from the specialized semantics from, sender, to,

Page 59: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 59/119

Annotation Meaning

Annotations belonging to Semantics.�scal are required for time-based calculations in analytical use cases.

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine): Some attributes contain the respective information (as plain integers), and the processor needs the semantics

Values (optional): Boolean default true

Semantics.�scal.period Boolean defaulttrue

A �scal period is covered by �nancial reports, for example, an annual report coreport 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.

Semantics.�scal.year The value of the annotated �eld encodes a �scal year number as a string followdigits.

Semantics.�scal.yearPeriod The value of the annotated �eld encodes a �scal year and period as a string folseven digits. The last three digits represent the �scal period in the year.

Semantics.�scal.yearVariant The value of the annotated �eld encodes a �scal year variant, which describes match the calendar year.

Annotations belong to Semantics.geoLocation contain geo-coordinates for depicting data on a map.

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine):

Values:

Semantics.geoLocation.cartoId Boolean defaulttrue

Semantics.geoLocation.latitude The value of the annotated �eld speci�es the latitude of the location such as a

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.

Semantics.language This annotation identi�es a language.

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData a

Values (optional): Boolean default true

Semantics.languageReference This annotation references a �eld that identi�es languages. You can use this annotation if you can

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine):

Values (optional): elementRef

ExampleThe string matches the regex pattern [0-9]{3}

ExampleThe string matches the regex pattern [1-9][0-9]{3}

ExampleThe string matches the regex pattern ([1-9][0-9]{3})([0-9]{3})

Page 60: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 60/119

Annotation Meaning

Semantics.mimeType This annotation describes the mime type of a resource (identi�ed by a URL or directly available as

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine):

This is required when accessing the document content, for example, in a content crawl, during texviewing.

In UIs, documents are usually presented with an icon that symbolizes their mime type.

Values: Boolean default true

Annotations belonging to Semantics.name follow the vCard standard (RFC6350 ).

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations

Values:

Semantics.name.additionalName Boolean defaulttrue

The value of the annotation contains the second �rst name of an individual.

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.nickName The value of the annotation contains the nickname 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.

Annotations belonging to Semantics.organization follow the vCard standard (RFC6350 ).

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations

Values:

Semantics.organization.name Boolean defaulttrue

The value of the annotated �eld contains the organization name.

Semantics.organization.role The value of the annotated �eld specify the function or part played in a particu

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

Scope: [ELEMENT, PARAMETER]

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

ExampleROLE:Project Leader

Page 61: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 61/119

Annotation Meaning

Annotations belonging to Semantics.systemDate specify the date/time that is recorded by the technical infrastructure/database.

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine):

Values:

Semantics.systemDate.createdAt Boolean defaulttrue

Timestamp when database record was created.

Semantics.systemDate.lastChangedAt Timestamp when database record was last changed.

Annotations belonging to Semantics.telephone follow the vCard standard RFC5322 )

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations

Values: String(10)

Semantics.telephone.type Values: default #PREF

The following enumerations are provided:

Value Description

CELL Cell phone

FAX Fax

HOME Private phone

PAGER Pager

PREF Preferred phone

TEXT Phone that supports text messages (SMS)

TEXT_PHONE Telecommunication device for people with hearing or speech difficulties

VIDEO Video conferencing phone

VOICE Voice phone

WORK Business phone

Semantics.text This annotation identi�es a human-readable text that is not necessarily language-dependent.

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData a

Values: Boolean default true

Semantics.time This annotation is used to indicate a date semantic for the NVARCHAR-based ABAP type TIMS.

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine):

Value : Boolean default true

NoteThe sub-annotations have the same semantics as the equally named attributes of the businessDate annotation. The difference is that valand are recorded by the database.

Page 62: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 62/119

Examples

Example 1

The following CDS view fetches the contact data. Here, the annotations assign to the corresponding �elds the relevant semanticinformation, such as �rst name, last name, and so on.

Annotation Meaning

Semantics.unitOfMeasure This annotation tags a �eld as containing a unit of measure.

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine):

Values: Boolean default true

Annotations belonging to Semantics.url contain a URL, and its mime type is contained in the referenced second �eld.

Scope: [ELEMENT, PARAMETER]

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 whenIn 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, thresponsible should be used.

Scope: [ELEMENT, PARAMETER]

Evaluation Runtime (Engine):

Values:

Semantics.user.createdBy Boolean defaulttrue

The value of the annotated �eld speci�es who created a data record.

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

NoteThere seems to be currently no internationally recognized standard list for units of measure ava

Sample Code

DEFINE VIEW ContactPerson ... ASSOCIATION [1..1] TO FormattedName AS _FormattedName ON ... { ... @Semantics.name.givenName FirstName,

@Semantics.name.additionalName MiddleName,

@Semantics.name.familyName LastName,

Page 63: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 63/119

Example 2

The following CDS view fetches sales order items. Here, the annotations assign the units and currencies to the corresponding�elds.

Example 3

The following CDS view fetches geographic data of cities annotating the corresponding location �elds according to a standardizedformat:

@Semantics.user.id SystemUser,

Initials,

GenderCode,

AddressUUID,

@Semantics.telephone.type: [#WORK, #PREF] PhoneNumber,

@Semantics.telephone.type: [#FAX] FaxNumber,

@Semantics.telephone.type: [#CELL] MobilePhoneNumber,

@Semantics.eMail.address EmailAddress,

PreferredLanguage,

@Semantics.contact.birthDate BirthDate,

@Semantics.name.fullName _FormattedName.FormattedContactName, ... }

Sample Code

DEFINE VIEW SalesOrderItem as select from ... { ... @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, ... }

Sample Code

Page 64: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 64/119

Example 4

The following CDS view fetches language-dependant data annotating the corresponding language �elds and text �elds:

UI AnnotationsRepresent semantic views on business data through the use of speci�c patterns that are completely independent of UItechnologies.

Scope and De�nition

DEFINE VIEW myGeoAttributeView as select from ... { @Semantics.address.city cartoid,

@Semantics.geoLocation.longitude Longitude,

@Semantics.geoLocation.latitude latitude,

@Semantics.geoLocation.normalizedName name }

Sample Code

DEFINE VIEW chartOfAccountsTexts AS SELECT FROM ... { key ktopl AS chartOfAccounts,

@Semantics.language: true key spras AS language,

@Semantics.text: true ktplt AS chartOfAccountsName }

@Scope:[#VIEW, #TABLE_FUNCTION, #ENTITY] Annotation UI { headerInfo { typeName : String(40); typeNamePlural : String(40); typeImageUrl : String; imageUrl : 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;

Page 65: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 65/119

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

Page 66: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 66/119

{ 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;

Page 67: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 67/119

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;

Page 68: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 68/119

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;

Page 69: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 69/119

UsageThe focus of OData UI vocabulary developed by SAP is on usage patterns of data in UIs, not on UI patterns. The vocabulary iscompletely independent of the UI technologies or devices that consume the data. The usage patterns of data used by the ODataUI vocabulary represent certain semantic views on business data. Some of them are very generic, others are based on the conceptof 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 CDSviews, 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.

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; }; };

Page 70: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 70/119

Annotation Meaning

Annotations belonging to UI.badge represent a business card view.

Scope: [VIEW, TABLE_FUNCTION, ENTITY]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations

Values:

UI.badge.headLine Annotations belonging to UI.badge.headLine represent a property of tytypes STANDARD, WITH_NAVIGATION_PATH, and WITH_URL.

The OData annotations DataFieldAbstract are the basis for all DataFieoptional labels that can trigger navigation to related data, or execute a

UI.badge.headLine.criticality elementRef This annotation can be speci�STANDARD. This annotation revalues 0, 1, 2, or 3. The criticalvalue 0, the criticality value Necriticality value Critical is rvalue Positive is re�ected b

For more information, see Crit

UI.badge.headLine.iconURL String This annotation contains the Uoptional.

UI.badge.headLine.label String (60) This annotation contains a lanlabel of the annotated elementvia the value is used. The elem

UI.badge.headLine.targetElement elementRef This annotation represents theview. The path is converted to This annotation, you can link f�oorplan to a target element. YUI.badge.headLine.targetElemUI.badge.headLine.type of typefor example, provide backgrouon the object view �oorplan.

UI.badge.headLine.type This enumeration annotation exactly speci�es what type of the type henumeration type determines which CDS elements are required or ava

Values:

String

The following enumerations are provided:

Value Description

STANDARD DefaultMaps to standard DataField. Yodisplayed without any addition

A standard DataField refers to

When you use this type, you ca

label

value

criticality

Page 71: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 71/119

Annotation Meaning

WITH_NAVIGATION_PATH Maps to DataFieldWithNavigat

DataFieldWithNavigationPath value pair that refers to a propde�nition consists of a link to nnavigation property provided bannotation �le.

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

targetElement

WITH_URL Maps to DataFieldWithURL.

DataFieldWithURL is based onthat refers a property of the Oa URL to navigate to a new targ

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

url

UI.badge.headLine.url elementRef This annotation represents thecontains a navigation URL. Youwhen you use the annotation UWITH_URL.

UI.badge.headLine.value elementRef This annotation refers to a valusame view, specify the elemento a value, specify the path to t

UI.badge.imageUrl elementRef This annotation represents a pan image representing the ent

UI.badge.mainInfo The content of UI.badge.mainInfo annotations is highlighted on the baproperty of type UI.DataFieldAbstract restricted to the types STANDARWITH_URL.

The OData annotations DataFieldAbstract are the basis for all DataFieoptional labels that can trigger navigation to related data, or execute a

ExampleWhen users open a badge, thbadge.

Page 72: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 72/119

Annotation Meaning

UI.badge.mainInfo.criticality elementRef This annotation can be speci�STANDARD. This annotation revalues 0, 1, 2, or 3. The criticalvalue 0, the criticality value Necriticality value Critical is rvalue Positive is re�ected b

For more information, see Crit

UI.badge.mainInfo.iconURL String This annotation contains the Uoptional.

UI.badge.mainInfo.label String (60) This annotation contains a lanfor main information on badgeIf omitted, the label of the annelement referenced via the val

UI.badge.mainInfo.targetElement elementRef This annotation represents theview. The path is converted to This annotation, you can link f�oorplan to a target element. YUI.badge.mainInfo.targetElemUI.badge.mainInfo.type of typefor example, provide backgrouon the object view �oorplan.

UI.badge.mainInfo.type This enumeration annotation exactly speci�es what type of the type henumeration type determines which CDS elements are required or ava

Values:

String

The following enumerations are provided:

Value Description

STANDARD DefaultMaps to standard DataField. Yodisplayed without any addition

A standard DataField refers to

When you use this type, you ca

label

value

criticality

Page 73: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 73/119

Annotation Meaning

WITH_NAVIGATION_PATH Maps to DataFieldWithNavigat

DataFieldWithNavigationPath value pair that refers to a propde�nition consists of a link to nnavigation property provided bannotation �le.

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

targetElement

WITH_URL Maps to DataFieldWithURL.

DataFieldWithURL is based onthat refers a property of the Oa URL to navigate to a new targ

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

url

UI.badge.mainInfo.url elementRef This annotation represents thecontains a navigation URL. Youwhen you use the annotation U

UI.badge.mainInfo.value elementRef This annotation refers to a valusame view, specify the elemento a value, specify the path to t

UI.badge.secondaryInfo The content of UI.badge.secondaryInfo annotations is subordinate to tannotations. This annotation represents a property of type UI.DataFielSTANDARD, WITH_NAVIGATION_PATH, and WITH_URL.

The OData annotations DataFieldAbstract are the basis for all DataFieoptional labels that can trigger navigation to related data, or execute a

UI.badge.secondaryInfo.criticality elementRef This annotation can be speci�is STANDARD. This annotationthe values 0, 1, 2, or 3. The critvalue 0, the criticality value Necriticality value Critical is rvalue Positive is re�ected b

For more information, see Crit

UI.badge.secondaryInfo.iconURL String This annotation contains the Uoptional.

Page 74: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 74/119

Annotation Meaning

UI.badge.secondaryInfo.label String (60) This annotation contains a lanfor secondary information on bIf omitted, the label of the annelement referenced via the val

UI.badge.secondaryInfo.targetElement elementRef This annotation represents theview. The path is converted to This annotation, you can link f�oorplan to a target element. YUI.badge.secondaryInfo.targetUI.badge.secondaryInfo.type omight, for example, provide baopened on the object view �oo

UI.badge.secondaryInfo.type This enumeration annotation exactly speci�es what type of the type henumeration type determines which CDS elements are required or ava

Values:

String

The following enumerations are provided:

Value Description

STANDARD DefaultMaps to standard DataField. Yodisplayed without any addition

A standard DataField refers to

When you use this type, you ca

label

value

criticality

WITH_NAVIGATION_PATH Maps to DataFieldWithNavigat

DataFieldWithNavigationPath value pair that refers to a propde�nition consists of a link to nnavigation property provided bannotation �le.

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

targetElement

Page 75: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 75/119

Annotation Meaning

WITH_URL Maps to DataFieldWithURL.

DataFieldWithURL is based onthat refers a property of the Oa URL to navigate to a new targ

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

url

UI.badge.secondaryInfo.url elementRef This annotation represents thecontains a navigation URL. YouUI.badge.secondaryInfo.url whUI.badge.secondaryInfo.type o

UI.badge.secondaryInfo.value elementRef This annotation refers to a valusame view, specify the elemento a value, specify the path to t

UI.badge.title Annotations belonging to UI.badge.titlerepresent a property of type UISTANDARD, WITH_NAVIGATION_PATH, and WITH_URL. UI.badge.title

The OData annotations DataFieldAbstract are the basis for all DataFieoptional labels that can trigger navigation to related data, or execute a

UI.badge.title.criticality elementRef This annotation can be speci�This annotation references to 2, or 3. The criticality value Necriticality value Negative is rCritical is re�ected by the vPositive is re�ected by the v

For more information, see Crit

UI.badge.title.iconURL String This annotation contains the Uoptional.

UI.badge.title.label String (60) This annotation contains a lanfor titles on badges.If omitted, the label of the annelement referenced via the val

UI.badge.title.targetElement elementRef This annotation represents theview. The path is converted to This annotation, you can link f�oorplan to a target element. YUI.badge.title.targetElement wUI.badge.title.type of type WITexample, provide background the object view �oorplan.

Page 76: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 76/119

Annotation Meaning

UI.badge.title.type This enumeration annotation exactly speci�es what type of the type henumeration type determines which CDS elements are required or ava

Values:

String

The following enumerations are provided:

Value Description

STANDARD DefaultMaps to standard DataField. Yodisplayed without any addition

A standard DataField refers to

When you use this type, you ca

label

value

criticality

WITH_NAVIGATION_PATH Maps to DataFieldWithNavigat

DataFieldWithNavigationPath value pair that refers to a propde�nition consists of a link to nnavigation property provided bannotation �le.

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

targetElement

WITH_URL Maps to DataFieldWithURL.

DataFieldWithURL is based onthat refers a property of the Oa URL to navigate to a new targ

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

url

Page 77: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 77/119

Annotation Meaning

UI.badge.title.url elementRef This annotation represents thecontains a navigation URL. Youyou use the annotation UI.bad

UI.badge.title.value elementRef This annotation refers to a valusame view, specify the elemento a value, specify the path to t

UI.badge.typeImageUrl String This annotation contains the UThe element is is optional.

Annotations belonging to UI.chart are used to show a visual representation of aggregated data.

Scope: [VIEW, TABLE_FUNCTION, ENTITY]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations

Values: array of

UI.chart.actions Annotations belonging to UI.chart.actions are used to add actions to c

Values: array of

UI.chart.actions.dataAction String This annotation can be used ifannotation references the techObject Processing Framework string pattern is BOPF:<tech

UI.chart.actions.invocationGrouping Description: This annotation expresses how multiple invocations of thgrouped. This annotation is optional. This annotation needs to be spectype FOR_ACTION.

Values:

String

The following enumerations are provided:

Value Description

ISOLATED DefaultDescribes the error handling wselected instances:

The action is executedwhich the action canno

ExampleWhen users open an overviewrelated to the entity type to wbelong to.

ExampleA user selects �ve iteOne item cannot be cother four items are

Page 78: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 78/119

Annotation Meaning

CHANGE_SET Describes the error handling wselected instances:

If an action cannot be instances, the action isinstances.

UI.chart.actions.label String(40) This annotation contains a lanfor charts.If omitted, the label of the annelement referenced via the val

UI.chart.actions.semanticObjectAction String This annotation can be used inFOR_INTENT_BASED_NAVIGAof an action on the semantic [email protected]�ning view.

UI.chart.actions.type Description: This annotation is used to de�ne the type of an action tha

Values:

String

The following enumerations are provided:

Value Description

FOR_ACTION Maps to DataFieldForAction.

DataFieldForAction is based onaction. For example, a button ilabel.

For more information, see Acti

When you use this type, you ca

label

invocationGrouping

When you use this type, you m

dataAction

ExampleA user selects �ve iteOne item cannot be ccopied.

Page 79: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 79/119

Annotation Meaning

FOR_INTENT_BASED_NAVIGATION Maps to DataFieldForIntentBa

DataFieldForIntentBasedNavigsemantic object.

For more information, see Bas

When you use this type, you ca

label

When you use this type, you m

semanticObjectAction

UI.chart.chartType Description: This enumeration annotation speci�es the type of graphiappropriate for the data in the annotated view or entity. The element is

Values:

String

The following enumerations are provided:

Value Description

COLUMN This annotation represents onmore measures on the y-axis (

COLUMN_STACKED This annotation represents a s

COLUMN_STACKED_100 This annotation represents a 1

BAR This annotation represents onmore measures on the x-axis (

BAR_STACKED This annotation represents a s

BAR_STACKED_100 This annotation represents a 1

AREA This annotation represents onmore measures on the y-axis (

AREA_STACKED This annotation represents a s

AREA_100 This annotation represents a 1

HORIZONTAL_AREA This annotation represents onmore measures on the x-axis (

HORIZONTAL_AREA_STACKED This annotation represents a s

HORIZONTAL_AREA_100 This annotation represents a 1

LINE This annotation represents onmore measures on the y-axis (

PIE This annotation represents onmeasure for the size of a segm

DONUT

SCATTER This annotation represents twA third and fourth dimension f

BUBBLE This annotation represents twand one measure for the size o

Page 80: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 80/119

Annotation Meaning

RADAR This annotation represents thrspider web.

HEAT_MAP This annotation represents twand one measure that is mapp

TREE_MAP This annotation represents onmeasure for the rectangle sizemapped to a color code.

WATERFALL This annotation represents onmeasure for the y-axis.

BULLET This annotation represents an semantic color on the top of thscaling factor, along with the tdisplayed vertically.

VERTICAL_BULLET This annotation represents an color on the top of the backgrofactor, along with the thresholdhorizontally.

UI.chart.description String (120) This annotation contains a [email protected] of theelement is optional.

UI.chart.dimensions array of elementRef This annotation is an array of odiscrete axes of a chart. The ex

UI.chart.dimensionsAttributes Annotations belonging to UI.chart.dimensionsAttributes are used to sp

Values: array of

UI.chart.dimensionsAttributes.dimension elementRef This annotation de�nes the dimmust reference an element tha

UI.chart.dimensionsAttributes.role Description: This annotation de�nes the manner in which a dimensiondifferently for each chart type.

Values:

String

The following enumerations are provided:

Value Description

CATEGORY This annotation determines th

ExampleLine chart: Dimensions for wup the X-axis (category axis)role, the �rst dimension is us

Page 81: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 81/119

Annotation Meaning

SERIES This annotation determines th

UI.chart.measures array of elementRef This annotation is an array of znumeric axes of a chart. The e

UI.chart.measureAttributes Annotations belonging to UI.chart.measureAttributes are used to spec

Values: array of

UI.chart.measureAttributes.asDataPoint Boolean default true This annotation de�nes whethpoints in addition to a chart. Tannotation needs to have an a

UI.chart.measureAttributes.measure elementRef This annotation de�nes the memust reference an element thahas a UI.dataPoint annotation.

UI.chart.measureAttributes.role Description: This annotation de�nes the manner in which a measure isdifferently for each chart type.

Values:

String

The following enumerations are provided:

Value Description

AXIS_1 This annotation determines th

AXIS_2 This annotation determines th

AXIS_3 This annotation determines th

UI.chart.title String (60) This annotation contains a [email protected] of the annis optional.

UI.chart.quali�er String (120) This annotation is used to grouneed to specify a quali�er as nchart can be referenced by the

ExampleLine chart: Dimensions for wthe line segments of the chadimension value. If multiple dvalues of all such dimensionsdimension and a color is assi

ExampleBubble chart: The �rst measif none exists, the �rst measuif none exists, the �rst measuassigned to the feed UID valu

NoteFor an example, see the desc

NoteFor an example, see the desc

Page 82: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 82/119

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:

UI.dataPoint.criticality elementRef This annotation can be speci�This annotation references to 2, or 3. The criticality value Necriticality value Negative is rCritical is re�ected by the vPositive is re�ected by the v

For more information, see Crit

UI.dataPoint.criticalityCalculation Annotations belonging to UI.dataPoint.criticalityCalculation can be usecriticality in the criticality element. The criticality can be calculated bacriticalityCalculation annotations.

UI.dataPoint.criticalityCalculation.improvementDirection Description: This annotation calculates the criticality based on a specinformation, see Trend-Criticality Calculation.

Values:

String

The following enumerations are provided:

Value Description

MINIMIZEValues under tolerance(positive)

Values between toleradeviationRangeHighVa

Values beyond deviatio(negative)

TARGETValues under deviation(negative)

Values between deviattoleranceRangeLowVa

Values between toleratoleranceRangeHighVa

Values between toleradeviationRangeHighVa

Values beyond deviatio(negative)

Page 83: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 83/119

Annotation Meaning

MAXIMIZEValues under deviation(negative)

Values between deviattoleranceRangeLowVa

Values beyond toleran(positive)

UI.dataPoint.criticalityCalculation.deviationRangeHighValue DecimalFloat This annotation contains a condeviation value before the criti

UI.dataPoint.criticalityCalculation.deviationRangeHighValueElement elementRef This annotation contains a refedeviation value before the criti

UI.dataPoint.criticalityCalculation.deviationRangeLowValue DecimalFloat This annotation contains a condeviation value before the criti

UI.dataPoint.criticalityCalculation.deviationRangeLowValueElement elementRef This annotation contains a refedeviation value before the criti

UI.dataPoint.criticalityCalculation.toleranceRangeHighValue DecimalFloat This annotation contains a convalue of the tolerance range.

UI.dataPoint.criticalityCalculation.toleranceRangeHighValueElement elementRef This annotation contains a refevalue of the tolerance range.

NoteIf you use This annotation, yoUI.dataPoint.criticalityCalcul

NoteIf you use This annotation, yoUI.dataPoint.criticalityCalcul

NoteIf you use This annotation, yoUI.dataPoint.criticalityCalcul

NoteIf you use This annotation, yoUI.dataPoint.criticalityCalcul

NoteIf you use This annotation, yoUI.dataPoint.criticalityCalcul

NoteIf you use This annotation, yoUI.dataPoint.criticalityCalcul

Page 84: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 84/119

Annotation Meaning

UI.dataPoint.criticalityCalculation.toleranceRangeLowValue DecimalFloat This annotation contains a conof the tolerance range.

UI.dataPoint.criticalityCalculation.toleranceRangeLowValueElement elementRef This annotation contains a refevalue of the tolerance range.

UI.dataPoint.description String (120) This annotation contains a [email protected] is use

UI.dataPoint.forecastValue elementRef This annotation references a vquarterly results, for example.

UI.dataPoint.longDescription String (250) This annotation contains a detelement is optional.

UI.dataPoint.maximumValue Integer This annotation speci�es the m

UI.dataPoint.minimumValue Integer This annotation speci�es the m

UI.dataPoint.referencePeriod All UI.dataPoint.referencePeriod annotations are optional. You either uUI.dataPoint.referencePeriod.description, or UI.dataPoint.referencePeUI.dataPoint.referencePeriod.end.

UI.dataPoint.referencePeriod.description String (120) This annotation describes the example "Oct 2012". Typical pa

UI.dataPoint.referencePeriod.end elementRef This annotation contains a refeperiod.

UI.dataPoint.referencePeriod.start This annotation contains a refeperiod.

NoteIf you use This annotation, yoUI.dataPoint.criticalityCalcul

NoteIf you use This annotation, yoUI.dataPoint.criticalityCalcul

ExampleYou can display a KPI using tdescription of this KPI can beUI.dataPoint.description ann

ExampleYou can display a KPI using thovering over this KPI can beUI.dataPoint.longDescription

Page 85: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 85/119

Annotation Meaning

UI.dataPoint.responsible elementRef This annotation contains an aswith @Semantics.name, @[email protected], or @Sem

For more information, see Pers

For an overview of @SemanticAnnotations.

UI.dataPoint.responsibleName String (120) This annotation can be used aelement. Only the name of the

UI.dataPoint.targetValue DecimalFloat This annotation speci�es the telement.

UI.dataPoint.targetValueElement elementRef This annotation speci�es the treference to an element.

UI.dataPoint.title String (60) This annotation contains the tomitted only if the @EndUserTmandatory.

NoteIf you use This annotation, yoUI.dataPoint.responsibleNam

NoteIf you use This annotation, yoUI.dataPoint.responsible.

ExampleYou create a KPI in which yoube reached at the end of a spUI.dataPoint.targetValue tha

NoteIf you use This annotation, doUI.dataPoint.targetValueElem

ExampleYou create a KPI that referenregions that need to be reachregion. This is the UI.dataPoivalue depending on the regio

NoteIf you use This annotation, doUI.dataPoint.targetValue.

ExampleYou can display a KPI using tKPI can be displayed using th

Page 86: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 86/119

Annotation Meaning

UI.dataPoint.trend elementRef reference to an element; valid

1 = StrongUp (arrow

2 = Up (arrow diagonic

3 = Sideways (horizo

4 = Down (arrow diago

5 = StrongDown (arro

For more information, see Tren

UI.dataPoint.trendCalculation Annotations belonging to UI.dataPoint.trendCalculation can be used athe trend element. The trend can be calculated based on the values of

UI.dataPoint.trendCalculation.downDifference DecimalFloat This annotation contains a conresults in a down-trend.

UI.dataPoint.trendCalculation.downDifferenceElement elementRef This annotation contains a referesults in a down-trend.

UI.dataPoint.trendCalculation.isRelativeDifference Boolean default false This annotation expresses if thdifferences or relative differenc

UI.dataPoint.trendCalculation.referenceValue elementRef This annotation speci�es the ra reference to an element.

UI.dataPoint.trendCalculation.strongDownDifference DecimalFloat This annotation contains a conresults in a strong down-trend

UI.dataPoint.trendCalculation.strongDownDifferenceElement elementRef This annotation contains a referesults in a strong down-trend

NoteIf you use This annotation, yoUI.dataPoint.trendCalculatio

NoteIf you use This annotation, yoUI.dataPoint.trendCalculatio

ExampleYour reference value is 10, andifference of these two valuethese two values is 1.2.

NoteIf you use This annotation, yoUI.dataPoint.trendCalculatio

NoteIf you use This annotation, yoUI.dataPoint.trendCalculatio

Page 87: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 87/119

Annotation Meaning

UI.dataPoint.trendCalculation.strongUpDifference DecimalFloat This annotation contains a conresults in a strong up-trend.

UI.dataPoint.trendCalculation.strongUpDifferenceElement elementRef This annotation contains a referesults in a strong up-trend.

UI.dataPoint.trendCalculation.upDifference DecimalFloat This annotation contains a conresults in an up-trend.

UI.dataPoint.trendCalculation.upDifferenceElement elementRef This annotation contains a referesults in an up-trend.

UI.dataPoint.valueFormat All UI.dataPoint.valueFormat annotations are optional. For more informResponsible and Reference Period.

UI.dataPoint.valueFormat.numberOfFractionalDigits Integer This annotation contains the n

.

UI.dataPoint.valueFormat.scaleFactor DecimalFloat This annotation contains the s

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

NoteIf you use This annotation, yoUI.dataPoint.trendCalculatio

NoteIf you use This annotation, yoUI.dataPoint.trendCalculatio

NoteIf you use This annotation, yoUI.dataPoint.trendCalculatio

NoteIf you use This annotation, yoUI.dataPoint.trendCalculatio

ExampleIf the element value is 1, one 34.5.

ExampleA value 1000 displayed with

Page 88: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 88/119

Annotation Meaning

UI.�eldGroup.criticality elementRef This annotation can be speci�This annotation references to 2, or 3. The criticality value Necriticality value Negative is rCritical is re�ected by the vPositive is re�ected by the v

For more information, see Crit

UI.�eldGroup.dataAction String This annotation can be used ifelement references the techniaObject Processing Framework <technical name of act

UI.�eldGroup.exclude Boolean default true This annotation allows excludiannotation on the derived viewoptional.

For more information, see Inhe

UI.�eldGroup.groupLabel String (60) This annotation contains langufor the �eld group. The �rst ococcurrences for the same quaoptional.

UI.�eldGroup.iconURL String This annotation contains the Uoptional.

UI.�eldGroup.importance This annotation expresses the importance of dataFields or other annoexample, in dynamic rendering approaches with responsive design pat

If no importance is de�ned, the �eld group item is treated like having i

Values:

String

The following enumerations are provided:

Value Description

HIGH -

MEDIUM -

LOW -

UI.�eldGroup.invocationGrouping This annotation expresses how multiple invocations of the same actionannotation is optional. This annotation needs to be speci�ed if you use

Values:

String enum

The following enumerations are provided:

Value Description

ExampleYou de�ned several �eld groups for an item's object view �oorplan. Tdisplayed always, get importance HIGH. This ensures that these �eldwhen the page is rendered on a small display.

Page 89: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 89/119

Annotation Meaning

ISOLATED DefaultDescribes the error handling wselected instances:

The action is executedwhich the action canno

CHANGE_SET Describes the error handling wselected instances:

If an action cannot be instances, the action isinstances.

UI.�eldGroup.label String (60) This annotation contains a lanfor labeling a group of �elds.If omitted, the label of the annelement referenced via the val

UI.�eldGroup.position DecimalFloat With This annotation you specannotation is mandatory.

UI.�eldGroup.quali�er String (120) This annotation is used to grouneed to specify a quali�er as ncorrect �eld group can be refe

UI.�eldGroup.semanticObjectAction String This annotation can be used inFOR_INTENT_BASED_NAVIGAWITH_INTENT_BASED_NAVIGname of an action on the semafrom @Consumption.semanticthe de�ning view.

UI.�eldGroup.targetElement elementRef This annotation represents theview. The path is converted to This annotation, you can link f�oorplan to a target element. YUI.�eldGroup.targetElement wUI.�eldGroup.type of type WITexample, provide background the object view �oorplan.

ExampleA user selects �ve iteOne item cannot be cother four items are

ExampleA user selects �ve iteOne item cannot be ccopied.

ExampleYou can specify the sequencan item's object view �oorpla

Page 90: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 90/119

Annotation Meaning

UI.�eldGroup.type This enumeration annotation exactly speci�es what type of the type henumeration type determines which CDS elements are required or ava

Values:

String

The following enumerations are provided:

Value Description

FOR_ACTION Maps to DataFieldForAction.

DataFieldForAction is based onaction. For example, a button ilabel.

For more information, see Acti

When you use this type, you ca

label

invocationGrouping

When you use this type, you m

dataAction

AS_ADDRESS Maps to DataFieldForAnnotati

DataFieldForAnnotation is useEdm.AnnotationPath abstract vCard.Address or UI.DataPoint

When you use this type, you ca

label

value

AS_DATAPOINT Maps to DataFieldForAnnotati

For more information, see Data

When you use this type, you ca

label

value

FOR_INTENT_BASED_NAVIGATION Maps to DataFieldForIntentBa

DataFieldForIntentBasedNavigsemantic object.

For more information, see Bas

When you use this type, you ca

label

When you use this type, you m

semanticObjectAction

Page 91: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 91/119

Annotation Meaning

STANDARD DefaultMaps to standard DataField. Yodisplayed without any addition

A standard DataField refers to

When you use this type, you ca

label

value

criticality

WITH_NAVIGATION_PATH Maps to DataFieldWithNavigat

DataFieldWithNavigationPath value pair that refers to a propde�nition consists of a link to nnavigation property provided bannotation �le.

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

targetElement

WITH_URL Maps to DataFieldWithURL.

DataFieldWithURL is based onthat refers a property of the Oa URL to navigate to a new targ

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

url

Page 92: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 92/119

Annotation Meaning

WITH_INTENT_BASED_NAVIGATION Maps to DataFieldWithIntentB

DataFieldWithIntentBasedNavbe rendered as a hyperlink.

This annotation is displayed liksimilar to type FOR_INTENT_Binformation, see With URL and

When you use this type, you ca

label

value

When you use this type, you m

semanticObjectAction

UI.�eldGroup.url elementRef This annotation represents thecontains a navigation URL. Youyou use the annotation UI.�eld

UI.�eldGroup.value elementRef This annotation refers to a valuType AS_ADDRESS:

Value element must noannotated. Use [email protected]�ed name) a

Value element must beCDS view is [email protected] o

If you want to referencindirectly associated, u

All other types:

Value element must noin this case the annota

Value element must beThe value is a path to a

Annotations belonging to UI.headerInfo describe an entity, its title, and an optional short description, the name of its entity in singular and pluindividual entity.

Scope: [VIEW, TABLE_FUNCTION, ENTITY]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations

Values:

UI.headerInfo.description Annotations belonging to UI.headerInfo.description represent a propeto the types STANDARD, WITH_NAVIGATION_PATH, and WITH_URL. Uoptional.

The OData annotations DataFieldAbstract are the basis for all DataFieoptional labels that can trigger navigation to related data, or execute a

Page 93: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 93/119

Annotation Meaning

UI.headerInfo.description.criticality elementRef This annotation can be speci�description is STANDARD.Thiselement that has the values 0,re�ected by the value 0, the crthe value 1, the criticality valueand the criticality value Posit

For more information, see Crit

UI.headerInfo.description.iconURL String This annotation contains the Uoptional.

UI.headerInfo.description.label String (60) This annotation contains a lanfor descriptions in page heade�oorplans are SAP Fiori �oorpIf omitted, the label of the annelement referenced via the val

UI.headerInfo.description.targetElement elementRef This annotation represents theview. The path is converted to This annotation, you can link f�oorplan to a target element. YUI.headerInfo.description.targUI.headerInfo.description.typemight, for example, provide baopened on the object view �oo

UI.headerInfo.description.type This enumeration annotation exactly speci�es what type of the type henumeration type determines which CDS elements are required or ava

Values:

String

The following enumerations are provided:

Value Description

STANDARD DefaultMaps to standard DataField. Yodisplayed without any addition

A standard DataField refers to

When you use this type, you ca

label

value

criticality

Page 94: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 94/119

Annotation Meaning

WITH_NAVIGATION_PATH Maps to DataFieldWithNavigat

DataFieldWithNavigationPath value pair that refers to a propde�nition consists of a link to nnavigation property provided bannotation �le.

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

targetElement

WITH_URL Maps to DataFieldWithURL.

DataFieldWithURL is based onthat refers a property of the Oa URL to navigate to a new targ

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

url

WITH_INTENT_BASED_NAVIGATION Maps to DataFieldWithIntentB

DataFieldWithIntentBasedNavbe rendered as a hyperlink

This annotation is displayed liksimilar to type FOR_INTENT_Binformation, see With URL and

When you use this type, you ca

label

When you use this type, you m

semanticObjectAction

value

UI.headerInfo.description.url elementRef This annotation represents thecontains a navigation URL. YouUI.headerInfo.description.url wUI.headerInfo.description.type

UI.headerInfo.description.value This annotation refers to a valusame view, specify the elemento a value, specify the path to t

Page 95: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 95/119

Annotation Meaning

UI.headerInfo.imageUrl elementRef This annotation represents a pan image representing the ent

UI.headerInfo.title Annotations belonging to UI.headerInfo.title represent a property of tytypes STANDARD, WITH_NAVIGATION_PATH, WITH_URL, and [email protected] annotations are mandatory and are usually used theader of an item's object page..

The OData annotations DataFieldAbstract are the basis for all DataFieoptional labels that can trigger navigation to related data, or execute a

UI.headerInfo.title.criticality elementRef This annotation can be speci�STANDARD. This annotation isview �oorplan. This annotationthe values 0, 1, 2, or 3. The critvalue 0, the criticality value Necriticality value Critical is rvalue Positive is re�ected b

For more information, see Crit

UI.headerInfo.title.iconURL String This annotation contains the Uoptional.

UI.headerInfo.title.label String (60) This annotation contains a lanfor titles in page headers of ob�oorplans are SAP Fiori �oorpIf omitted, the label of the annelement referenced via the val

UI.headerInfo.title.targetElement elementRef This annotation represents theview. The path is converted to This annotation, you can link f�oorplan to a target element. YUI.headerInfo.title.targetElemeUI.headerInfo.title.type of typeexample, provide background the object view �oorplan.

UI.headerInfo.title.type This enumeration annotation exactly speci�es what type of the type henumeration type determines which CDS elements are required or ava

Values:

String

The following enumerations are provided:

Value Description

ExampleWhen users open an item frorelated to that item as part o

Page 96: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 96/119

Annotation Meaning

STANDARD DefaultMaps to standard DataField. Yodisplayed without any addition

A standard DataField refers to

When you use this type, you ca

label

value

criticality

WITH_NAVIGATION_PATH Maps to DataFieldWithNavigat

DataFieldWithNavigationPath value pair that refers to a propde�nition consists of a link to nnavigation property provided bannotation �le.

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

targetElement

WITH_URL Maps to DataFieldWithURL.

DataFieldWithURL is based onthat refers a property of the Oa URL to navigate to a new targ

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

url

Page 97: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 97/119

Annotation Meaning

WITH_INTENT_BASED_NAVIGATION Maps to DataFieldWithIntentB

DataFieldWithIntentBasedNavbe rendered as a hyperlink.

This annotation is displayed liksimilar to type FOR_INTENT_Binformation, see With URL and

When you use this type, you ca

label

When you use this type, you m

semanticObjectAction

value

UI.headerInfo.title.url elementRef This annotation represents thecontains a navigation URL. Youwhen you use the annotation U

UI.headerInfo.title.value This annotation refers to a valusame view, specify the elemento a value, specify the path to t

UI.headerInfo.typeImageUrl String This annotation contains the UThe element is is optional.

UI.headerInfo.typeName String(60) This annotation represents theelement is required and can [email protected] is speci�e

UI.headerInfo.typeNamePlural This annotation represents a limandatory.

UI.hidden This annotation allows to show or hide data �elds based on the state osee Field Hiding.

Scope: [ELEMENT]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into

Value: Boolean default true

Annotation belonging to UI.identi�cation represent an ordered collection of speci�c data �elds that together with headerInfo identi�es an ent

Scope: [ELEMENT]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations

Values: array of

ExampleWhen users open a SAP Fiorrelated to the entity type to wbelong to.

ExampleThis annotation is displayed in the General Information section in the body of the object view �oorplan of an item, for example.

Page 98: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 98/119

Annotation Meaning

UI.identi�cation.criticality elementRef This annotation can be speci�STANDARD.This annotation revalues 0, 1, 2, or 3. The criticalvalue 0, the criticality value Necriticality value Critical is rvalue Positive is re�ected b

For more information, see Crit

UI.identi�cation.dataAction String This annotation can be used ifThe element references the teObject Processing Framework <technical name of act

UI.identi�cation.exclude Boolean default true This annotation allows excludiannotation on the derived viewoptional.

For more information, see Inhe

UI.identi�cation.iconURL String This annotation contains the Uoptional. This could be a telep

UI.identi�cation.importance This annotation expresses the importance of dataFields or other annoexample, in dynamic rendering approaches with responsive design pat

If no importance is de�ned, the identi�cation item is treated like havin

Values:

String

The following enumerations are provided:

Value Description

HIGH -

MEDIUM -

LOW -

UI.identi�cation.invocationGrouping This annotation expresses how multiple invocations of the same actionannotation is optional. This annotation needs to be speci�ed if you useFOR_ACTION.

Values:

String enum

The following enumerations are provided:

Value Description

ExampleYou de�ned several entries for the General Information section for aentries that need to be displayed always, get importance HIGH. This in the section when this section is rendered on a small display.

Page 99: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade9677… 99/119

Annotation Meaning

ISOLATED DefaultDescribes the error handling wselected instances:

The action is executedwhich the action canno

CHANGE_SET Describes the error handling wselected instances:

If an action cannot be instances, the action isinstances.

UI.identi�cation.label String (60) This annotation contains a lanthe body section of an item's oIf omitted, the label of the annelement referenced via the val

UI.identi�cation.position DecimalFloat With This annotation you spec�oorplan. This annotation is m

UI.identi�cation.semanticObjectAction String This annotation can be used inFOR_INTENT_BASED_NAVIGAWITH_INTENT_BASED_NAVIGname of an action on the semafrom @Consumption.semanticthe de�ning view.

UI.identi�cation.targetElement elementRef This annotation represents theview. The path is converted to This annotation, you can link f�oorplan to a target element. YUI.identi�cation.targetElemenUI.identi�cation.type of type Wexample, provide background the object view �oorplan.

ExampleA user selects �ve iteOne item cannot be cother four items are

ExampleA user selects �ve iteOne item cannot be ccopied.

ExampleWhen users open the object General Information sectiongeneral information about th

Page 100: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 100/119

Annotation Meaning

UI.identi�cation.type This enumeration annotation exactly speci�es what type of the type henumeration type determines which CDS elements are required or ava

Values:

String

The following enumerations are provided:

Value Description

FOR_ACTION Maps to DataFieldForAction.

DataFieldForAction is based onaction. For example, a button ilabel.

For more information, see Acti

When you use this type, you ca

label

invocationGrouping

When you use this type, you m

dataAction

AS_ADDRESS Maps to DataFieldForAnnotati

DataFieldForAnnotation is useEdm.AnnotationPath abstract vCard.Address or UI.DataPoint

When you use this type, you ca

label

value

AS_DATAPOINT Maps to DataFieldForAnnotati

For more information, see Data

When you use this type, you ca

label

value

FOR_INTENT_BASED_NAVIGATION Maps to DataFieldForIntentBa

DataFieldForIntentBasedNavigsemantic object.

For more information, see Bas

When you use this type, you ca

label

When you use this type, you m

semanticObjectAction

Page 101: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 101/119

Annotation Meaning

STANDARD DefaultMaps to standard DataField. Yodisplayed without any addition

A standard DataField refers to

When you use this type, you ca

label

value

criticality

WITH_NAVIGATION_PATH Maps to DataFieldWithNavigat

DataFieldWithNavigationPath value pair that refers to a propde�nition consists of a link to nnavigation property provided bannotation �le.

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

targetElement

WITH_URL Maps to DataFieldWithURL.

DataFieldWithURL is based onthat refers a property of the Oa URL to navigate to a new targ

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

url

Page 102: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 102/119

Annotation Meaning

WITH_INTENT_BASED_NAVIGATION Maps to DataFieldWithIntentB

DataFieldWithIntentBasedNavbe rendered as a hyperlink.

This annotation is displayed liksimilar to type FOR_INTENT_Binformation, see With URL and

When you use this type, you ca

label

value

When you use this type, you m

semanticObjectAction

UI.identi�cation.url elementRef This annotation represents thecontains a navigation URL. Youyou use the annotation UI.iden

UI.identi�cation.value elementRef This annotation refers to a valuType AS_ADDRESS:

Value element must noannotated. Use [email protected]�ed name) a

Value element must beCDS view is [email protected] o

If you want to referencindirectly associated, u

All other types:

Value element must noin this case the annota

Value element must beThe value is a path to a

Annotations belonging to UI.lineItem represent an ordered collection of data �elds that is used to represent data from multiple data instancessee Columns.

Scope: [ELEMENT]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations

Values: array of

UI.lineItem.criticality elementRef This annotation can be speci�annotation references to anoth3. The criticality value Neutravalue Negative is re�ected bCritical is re�ected by the vPositive is re�ected by the v

For more information, see Crit

Page 103: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 103/119

Annotation Meaning

UI.lineItem.dataAction String This annotation can be used ifelement references the techniaObject Processing Framework string pattern is BOPF:<tech

UI.lineItem.exclude Boolean default true This annotation allows excludiannotation on the derived viewoptional.

For more information, see Inhe

UI.lineItem.iconURL String This annotation contains the Uoptional.

UI.lineItem.importance This annotation expresses the importance of dataFields or other annoexample, in dynamic rendering approaches with responsive design pat

If no importance is de�ned, the line item is treated like having importa

Values:

String

The following enumerations are provided:

Value Description

HIGH -

MEDIUM -

LOW -

UI.lineItem.invocationGrouping This annotation expresses how multiple invocations of the same actionannotation is optional. This annotation needs to be speci�ed if you use

Values:

String enum

The following enumerations are provided:

Value Description

ISOLATED DefaultDescribes the error handling wselected instances:

The action is executedwhich the action canno

ExampleYou de�ned a table with several columns. The columns that need to bHIGH. This ensures that these columns are displayed in a table when

ExampleA user selects �ve iteOne item cannot be cother four items are

Page 104: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 104/119

Annotation Meaning

CHANGE_SET Describes the error handling wselected instances:

If an action cannot be instances, the action isinstances.

UI.lineItem.label String (60) This annotation contains a lanfor column titles in tables headIf omitted, the label of the annelement referenced via the val

UI.lineItem.position DecimalFloat With This annotation you specannotation is mandatory.

UI.lineItem.quali�er String (120) This annotation is used to grouIf you want to use more than odistinguish them on the UI.

UI.lineItem.semanticObjectAction String This annotation refers to the nThe semantic object is taken fderived via an association from

UI.lineItem.targetElement elementRef This annotation represents theview. The path is converted to This annotation, you can link f�oorplan to a target element. YUI.lineItem.targetElement wheof type WITH_NAVIGATION_PAbackground information to an �oorplan.

UI.lineItem.type This enumeration annotation exactly speci�es what type of the type henumeration type determines which CDS elements are required or ava

Values:

String

The following enumerations are provided:

Value Description

ExampleA user selects �ve iteOne item cannot be ccopied.

Page 105: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 105/119

Annotation Meaning

FOR_ACTION Maps to DataFieldForAction.

DataFieldForAction is based onaction. For example, a button ilabel.

For more information, see Acti

When you use this type, you ca

label

invocationGrouping

When you use this type, you m

dataAction

AS_ADDRESS Maps to DataFieldForAnnotati

DataFieldForAnnotation is useEdm.AnnotationPath abstract vCard.Address or UI.DataPoint

When you use this type, you ca

label

value

AS_DATAPOINT Maps to DataFieldForAnnotati

For more information, see Data

When you use this type, you ca

label

value

FOR_INTENT_BASED_NAVIGATION Maps to DataFieldForIntentBa

DataFieldForIntentBasedNavigsemantic object.

For more information, see Bas

When you use this type, you ca

label

When you use this type, you m

semanticObjectAction

Page 106: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 106/119

Annotation Meaning

STANDARD DefaultMaps to standard DataField. Yodisplayed without any addition

A standard DataField refers to

When you use this type, you ca

label

value

criticality

WITH_NAVIGATION_PATH Maps to DataFieldWithNavigat

DataFieldWithNavigationPath value pair that refers to a propde�nition consists of a link to nnavigation property provided bannotation �le.

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

targetElement

WITH_URL Maps to DataFieldWithURL.

DataFieldWithURL is based onthat refers a property of the Oa URL to navigate to a new targ

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

url

Page 107: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 107/119

Annotation Meaning

WITH_INTENT_BASED_NAVIGATION Maps to DataFieldWithIntentB

DataFieldWithIntentBasedNavbe rendered as a hyperlink.

This annotation is displayed liksimilar to type FOR_INTENT_Binformation, see With URL and

When you use this type, you ca

label

value

When you use this type, you m

semanticObjectAction

UI.lineItem.url elementRef This annotation represents thecontains a navigation URL. Youuse the annotation UI.lineItem

UI.lineItem.value elementRef This annotation refers to a valuType AS_ADDRESS:

Value element must noannotated. Use [email protected]�ed name) a

Value element must beCDS view is [email protected] o

If you want to referencindirectly associated, u

All other types:

Value element must noin this case the annota

Value element must beThe value is a path to a

UI.masked This annotation refers to, for example, passwords or pass phrases. Thevalue in clear text upon explicit user interaction. For more information

Scope: [ELEMENT]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into

Value: Boolean default true

UI.multiLineText This annotation contains text that is rendered as multiple lines. For mo

Scope: [ELEMENT]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into

Value: Boolean default true

Page 108: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 108/119

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

UI.selectionField.element elementRef Optional element reference

Must be used when anpath to an element of tyou want to �lter a tabCDS view but in anoth

Must not be used whethis case the annotate

UI.selectionField.exclude Boolean default true This annotation allows excludiannotation on the derived viewoptional.

For more information, see Inhe

UI.selectionField.position DecimalFloat With This annotation you specused for �ltering. This annotat

UI.selectionField.quali�er String (120) This annotation is used to grouneed to specify a quali�er as ncorrect selection �eld can be r

Annotations belonging to UI.statusInfo represent a list of abstract data �elds that convey the status of an entity. UI.statusInfo annotations areitem's object view �oorplan.

Scope: [ELEMENT]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into the corresponding OData annotations

Values: array of

UI.statusInfo.criticality elementRef This annotation can be speci�This annotation references to 2, or 3. The criticality value Necriticality value Negative is rCritical is re�ected by the vPositive is re�ected by the v

For more information, see Crit

ExampleYou de�ne a sales ordbusiness partners focountry information view but in the busin

ExampleWhen users open a SAP Fioritems, they might want to �ltdate, for example. They can slist. You specify what selectioso on.

Page 109: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 109/119

Annotation Meaning

UI.statusInfo.dataAction String This annotation can be used ifelement references the techniaObject Processing Framework <technical name of act

UI.statusInfo.exclude Boolean default true This annotation allows excludiannotation on the derived viewoptional.

For more information, see Inhe

UI.statusInfo.iconURL String This annotation contains the Uoptional.

UI.statusInfo.importance This annotation expresses the importance of dataFields or other annoexample, in dynamic rendering approaches with responsive design pat

If no importance is de�ned, the status info is treated like having impor

Values:

String

The following enumerations are provided:

Value Description

HIGH -

MEDIUM -

LOW -

UI.statusInfo.invocationGrouping This annotation expresses how multiple invocations of the same actionannotation is optional. This annotation needs to be speci�ed if you use

Values:

String enum

The following enumerations are provided:

Value Description

ISOLATED DefaultDescribes the error handling wselected instances:

The action is executedwhich the action canno

ExampleYou de�ned several statuses. The statuses that need to be displayedensures that these statuses are displayed in a table, for example, whdisplay.

ExampleA user selects �ve iteOne item cannot be cother four items are

Page 110: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 110/119

Annotation Meaning

CHANGE_SET Describes the error handling wselected instances:

If an action cannot be instances, the action isinstances.

UI.statusInfo.position DecimalFloat With This annotation you specare displayed. This annotation

UI.statusInfo.semanticObjectAction String This annotation can be used inFOR_INTENT_BASED_NAVIGAWITH_INTENT_BASED_NAVIGname of an action on the semafrom @Consumption.semanticthe de�ning view.

UI.statusInfo.targetElement elementRef This annotation represents theview. The path is converted to This annotation, you can link f�oorplan to a target element. YUI.statusInfo.targetElement wUI.statusInfo.type of type WITHexample, provide background the object view �oorplan.

UI.statusInfo.type This enumeration annotation exactly speci�es what type of the type henumeration type determines which CDS elements are required or ava

Values:

String

The following enumerations are provided:

Value Description

FOR_ACTION Maps to DataFieldForAction.

DataFieldForAction is based onaction. For example, a button ilabel.

For more information, see Acti

When you use this type, you ca

label

invocationGrouping

When you use this type, you m

dataAction

ExampleA user selects �ve iteOne item cannot be ccopied.

Page 111: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 111/119

Annotation Meaning

AS_ADDRESS Maps to DataFieldForAnnotati

DataFieldForAnnotation is useEdm.AnnotationPath abstract vCard.Address or UI.DataPoint

When you use this type, you ca

label

value

AS_CONTACT Maps to DataFieldForAnnotati

DataFieldForAnnotation is useEdm.AnnotationPath abstract vCard.Address or UI.DataPoint

When you use this type, you ca

label

value

AS_DATAPOINT Maps to DataFieldForAnnotati

For more information, see Data

When you use this type, you ca

label

value

FOR_INTENT_BASED_NAVIGATION Maps to DataFieldForIntentBa

DataFieldForIntentBasedNavigsemantic object. The navigatio

For more information, see Bas

When you use this type, you ca

label

When you use this type, you m

semanticObjectAction

STANDARD DefaultMaps to standard DataField. Yodisplayed without any addition

A standard DataField refers to

When you use this type, you ca

label

value

criticality

Page 112: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 112/119

Annotation Meaning

WITH_NAVIGATION_PATH Maps to DataFieldWithNavigat

DataFieldWithNavigationPath value pair that refers to a propde�nition consists of a link to nnavigation property provided bannotation �le.

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

targetElement

WITH_URL Maps to DataFieldWithURL.

DataFieldWithURL is based onthat refers a property of the Oa URL to navigate to a new targ

For more information, see With

When you use this type, you ca

label

value

When you use this type, you m

url

WITH_INTENT_BASED_NAVIGATION Maps to DataFieldWithIntentB

DataFieldWithIntentBasedNavbe rendered as a hyperlink.

This annotation is displayed liksimilar to type FOR_INTENT_Binformation, see With URL and

When you use this type, you ca

label

value

When you use this type, you m

semanticObjectAction

UI.statusInfo.url elementRef This annotation represents thecontains a navigation URL. Youyou use the annotation UI.stat

Page 113: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 113/119

Annotation Meaning

UI.statusInfo.value elementRef This annotation refers to a valuType AS_ADDRESS:

Value element must noannotated. Use [email protected]�ed name) a

Value element must beCDS view is [email protected] o

If you want to referencindirectly associated, u

All other types:

Value element must noin this case the annota

Value element must beThe value is a path to a

UI.textArrangement Description: This annotation speci�es the arrangement of code-text p

Scope: [VIEW]

Evaluation Runtime (Engine): SADL: Translates CDS annotations into

Values:

String

The following enumerations are provided:

Value Description

TEXT_FIRST The text is displayed in front o

TEXT_LAST The code is displayed in front o

TEXT_ONLY The text is displayed without t

TEXT_SEPARATE The text and the code are disp

ExampleEnglish (EN)

ExampleEN (English)

ExampleEnglish

Example

Language(Code)

Language

EN English

Page 114: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 114/119

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.

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.

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 additionalUI annotations are required to expose the search �eld or value help.

Example 4: @UI.identi�cation

Sample Code

... @UI.headerInfo: { typeNamePlural: 'Sales Orders' } define view ZExample_SalesOrder as select from sepm_cds_sales_order as so { ... }

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: 20 }, { qualifier: 'ValueList', position: 20 } ] so.customer.company_name as CompanyName,

@UI.lineItem: [ { position: 30 } ] so.currency_code as CurrencyCode,

@DefaultAggregation: #SUM @UI.lineItem: [ { position: 40 } ] so.gross_amount as GrossAmount }

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, ... }

Page 115: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 115/119

The annotation @UI.Identi�cation is used to de�ne which elements are shown on a detail page.

Example 5: @UI.�eldGroup

The annotation @UI.�eldGroup is used to group several �elds, for example, for sections of forms. Similar to the [email protected], the different �eld groups have unique quali�ers.

Example 6:@UI.badge

The annotation @UI.badge represents the view of a business card. A badge can be considered as the combination of theannotations @UI.headerInfo and @UI.identi�cation. The properties ImageUrl, TypeImageUrl, and Title correspond to theproperties from the annotation @UI.HeaderInfo. In addition to the Title property, the properties HeadLine, MainInfo andSecondaryInfo of the same format can be speci�ed.

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 }

Sample Code

define view ZExample_SalesOrder as select from sepm_cds_sales_order as so { @UI.identification: [ { qualifier: 'GeneralInformation', position: 10 } ] key so.sales_order_id as SalesOrder,

@UI.identification: [ { qualifier: 'GeneralInformation', position: 20 } ] so.customer.company_name as CompanyName,

@UI.identification: [ { qualifier: 'SalesData', position: 30 } ] so.currency_code as CurrencyCode,

@UI.identification: [ { qualifier: 'SalesData', position: 40 } ] so.gross_amount as GrossAmount }

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: {

Page 116: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 116/119

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 theelements that are supposed to be used in the chart. Additionally, a title and description can be provided.

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 areusually 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 tocalculate the corresponding values, but are not supposed to be displayed directly.

label: 'Billing Status', value: 'BillingStatus' -- Reference to element in projection-list } }

define view ZExample_SalesOrder as select from sepm_cds_sales_order as so { key so.sales_order_id as SalesOrder, so.customer.company_name as CompanyName, so.gross_amount as GrossAmount, so.billing_status as BillingStatus, ... }

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 }

define view ZExample_SalesOrder as select from sepm_cds_sales_order as so { key so.sales_order_id as SalesOrder, so.customer.company_name as CompanyName, so.currency_code as CurrencyCode,

@Semantics.amount.currencyCode: 'CurrencyCode' so.gross_amount as GrossAmount, ... }

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

Page 117: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 117/119

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 bythe client.

This annotation does not in�uence how data is transferred. If a �eld is marked as @UI.masked, dataof this �eld is still transferredto the client like any other property.

Example 10:@UI.multiLineText

The annotation @UI.multiLineText marks a �eld, for example a description, that is supposed to be displayed by controls thatsupport multiline-input, for example a text area.

Example 11: @UI.dataPoint

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.

so.criticality as AmountCriticality,

@UI.hidden so.trend as AmountTrend }

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, ... }

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, ... }

Page 118: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 118/119

The simplest variant of a data point consists of a value and a tile. In this case, only the value itself is exposed, without additionalinformation.

VDM AnnotationsAllow classifying views of the virtual data model in terms of their admissible reuse options and provisioned content

Scope and De�nition

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 forcustomers and partners is controlled by additional internal classi�cation of the views.

Annotation Meaning

VDM.viewType De�nes the type of a VDM view

Scope: #TABLE FUNCTION, #VIEW

Evaluation Runtime (Engine): None - Used for SAP internal structuring and interpretation of the CDSviews

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 BASICviews.

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,

@UI.dataPoint: { title: 'Gross Amount' }

@Semantics.amount.currencyCode: 'CurrencyCode' so.actual_amount as ActualAmount }

@Scope:[#VIEW, #TABLE_FUNCTION] Annotation VDM { viewType : String enum { BASIC; COMPOSITE; CONSUMPTION; }; private : Boolean default true; };

Page 119: SAP - ABAP Programming Model for SAP Fiori · EnterpriseSearch Annotations Hierarchy Annotations ObjectModel Annotations OData Annotations Search Annotations Semantics Annotations

12/10/2019

https://help.sap.com/http.svc/dynamicpdfcontentpreview?deliverable_id=20484268&topics=630ce9b386b84e80bfade967… 119/119

Annotation Meaning

CONSUMPTION views that serve for speci�c application purposes and may bede�ned based upon public interface (for example, BASIC andCOMPOSITE) views.

VDM.private Private interface (for example, BASIC and COMPOSITE) views represent technical helper views whichmay only be used by their de�ning responsibles.

Scope: #TABLE FUNCTION, #VIEW

Evaluation Runtime (Engine): Interpreted by ABAP Runtime Environment

ExamplesExample 1

De�ning a public basic VDM interface view:

Example 2

De�ning a private composite VDM interface view:

Sample Code

@VDM.viewType: #BASIC define view I_SalesOrder ... { key SalesOrder, ... }

Sample Code

@VDM.private: true @VDM.viewType: #COMPOSITE define view P_SalesOrderItemCube ... { key SalesOrder, ... }


Recommended