Symptom
When adding a calculation in a Custom CDS View and then publishing it, error occurs and error message shows that Reference Annotation is missing (Element XX: Missing XX reference annotation XXX.XXXX.XXXX."
Example: Element CALCULATED_FIELD: missing CALC reference annotation Semantics.quantity.unitOfMeasure".
Environment
SAP S/4HANA Cloud
Reproducing the Issue
- Go to Custom CDS Views.
- Open or create a Custom CDS View.
- In Elements tab add a calculation.
- Publish the Custom CDS View.
Cause
The "Semantic" and "Semantic Value" fields for the calculation are not maintained in the Element Properties tab.
Resolution
Go to "Element Properties" tab and add the Semantic Annotation for the calculation.
In the example above, the calculation is missing the Semantic "quantity.UnitOfMeasure" and the respective Semantic Value.
Please check in the table below the available Semantics:
Value |
Description |
---|---|
Semantics.Amount. CurrencyCode |
This attribute specifies that a field contains a monetary amount, and the corresponding currency code is contained in the semantic value field. |
Semantics.BusinessDate.At |
This attribute specifies that the field contains key dates. |
Semantics.BusinessDate.From |
This attribute specifies that the field is the date timestamp or start of an interval that defines the validity of the data of the database table record from a business point of view. Technical validity: The from date is different from the point in time when the record was created. The dates are not to be confused with dates contained in the data part. |
Semantics.BusinessDate.To |
This attribute specifies that the field is the date timestamp or end of an interval interval that defines the validity of the data of the database table record from a business point of view. Technical validity: The from date is different from the point in time when the record was created. The dates are not to be confused with dates contained in the data part. |
Semantics.Calendar.Month |
This attributes displays the field value as a calendar month numberof type string following the logical pattern MM consisting of two digits. |
Semantics.Calendar.Quarter |
This attribute displays the field value as a calendar quarter number of type strig following the logical pattern Q consisting of a single digit. |
Semantics.Calendar.Week |
This attribute displays the field value as a calendar week number of type string following the logical pattern WW consisting of two digits. |
Semantics.Calendar.Year |
This attribute displays the field value as a year number of type string following the logical pattern (-?)YYYY(Y*) consisting of an optional minus sign for years B.C., followed by at least four digits. |
Semantics.Calendar.YearMonth |
This attribute converts the field value into a calendar year and month as a string following the logical pattern (-?)YYYY(Y*)MM consisting of at least six digits, where the last two digits represent the months January to December. |
Semantics.Calendar.YearQuarter |
This attribute displays the field value as a calendar year and quarter of type string following the logical pattern (-)YYYY(Y*)Q , consisting of at least five digits, where the last digit represents the quarter. |
Semantics.Calendar.YearWeek |
This attribute displays the field value as a calendar year and week of type string following the logical pattern (-?)YYYY(Y*)WW consisting of at least six digits, where the last two digits represent week number in the year. |
Semantics.CurrencyCode |
This attribute identifies a semantic value as currency code that can then be used in ammount.currencycode fields as value. |
Semantics.FiscalPeriod |
A fiscal period is covered by financial reports, for example, an annual report covers a fiscal period of one year, but a quarterly report includes accounting data for three months. This attribute converts the field value into a fiscal period as a string following the logical pattern PPP consisting of three digits. This fiscal period usually is a quarter of a year. |
Semantics.FiscalYear |
This attribute converts a field value into a fiscal year number as a string following the logical pattern YYYY consisting of four digits. |
Semantics.Language |
This attribute identifies a field value as a language. |
Semantics.Quantity.UnitOfMeasure |
This attribute identifies the semantic value as a unit of measure related to a measured quantity. |
Semantics.SystemDate.CreatedAt |
This attribute represents the timestamp of when database record/ an object was created. |
Semantics.SystemDate.LastChangedAt |
This attribute represents the timestamp of an object was last changed. |
Semantics.Text |
This attribute identifies a human-readable text that is not necessarily language-dependent. |
Semantics.UnitofMeasure |
This attribute identifies the semantic value a unit of measure that can be used in quantity.unitofmeasure fields as value. |
See Also
SAP Help Portal | Semantic Values
SAP Help Portal | Element Properties
KBA 3169818 - The implementation of currency conversion in Custom CDS view
Keywords
conversion, calculation, calculated field, custom CDS view, element, element properties, semantic, semantic annotation, semantic value, quantity, unit of measure, CDS, publishing, error message, missing semantic annotation , KBA , BC-SRV-APS-GKE , Generic CDS Key User Editor , Problem