Child pages
  • Amount and Quantity Key Figures
Skip to end of metadata
Go to start of metadata

Please always define @Semantics.quantity.unitOfMeasure for a quantity key figure (a field with Data Type QUAN) in a CDS view

Please always define @Semantics.amount.currencyCode for an amount key figure (a field with Data Type CURR) in a CDS view

CDS code for a typical quantity field and a typical amount field looks like this:

With this, in transaction RSRTS_ODP_DIS we can see the quantity field depends on the unit field,  and the amount field depends on the currency field.

Example:

A CDS query will display incorrect currency value if @Semantics.amount.currencyCode is not defined on an amount field. Without currency code, the amount field is only interpreted by the system as a number. Therefore the necessary TCURX conversion will be skipped and values in currency JPY, HUF, CLP... etc will show wrong decimal in query result.

In a CUBE CDS, two amount key figures are defined as below.

Although FlightPrice and Price contains the same amount value, FlightPrice has currency code while Price has not.

Here is a simple CDS query:

Run query 2CZGLTCURXV in transaction RSRT with input currency=JPY, query result is:

The amount with currency code gets correct result: 106136 JPY

The amount without currency code simply gets the data stored in underlying table: 1061.36. This is incorrect as the value is not converted into correct external format based on TCURX setting.

The conversion logic is explained here.

 

 

  • No labels