For example, I developed a CDS view and automatically generated a Fiori Elements app that displays amounts in euros:

I expect to use the currency conversion feature of the CDS View, Currency Conversion, to convert the units of these amounts into US dollars.

You can use the conversion functions mentioned in this document.

Use the following highlighted code:

@AbapCatalog.sqlViewName: 'ZCTRAVELJERRY' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #CHECK @EndUserText.label: 'Consumption view from /DMO/I_TRAVEL_U' @Metadata.allowExtensions: true @Search.searchable: true define view Z_C_TRAVEL_DATA_JERRY as select from /DMO/I_Travel_U association [1..1] to /DMO/I_Agency as _Agency on $projection.AgencyID = _Agency.AgencyID association [1..1] to /DMO/I_Customer as _Customer on $projection.CustomerID = _Customer.CustomerID { key TravelID, @ObjectModel.text.association: '_Agency' AgencyID, CustomerID, concat_with_space(_Customer.Title, _Customer.LastName, 1) as Addressee, BeginDate, EndDate, BookingFee, TotalPrice, CurrencyCode, currency_conversion( amount => TotalPrice, source_currency => CurrencyCode, round => 'X', target_currency => cast('USD' as abap.cuky( 5 )), exchange_rate_date => cast('20200429' as abap.dats), error_handling => 'SET_TO_NULL' ) as PriceInUSD, @Search.defaultSearchElement: true @Search.fuzzinessThreshold: 0.90 Memo, Status, LastChangedAt, /* Associations */ _Agency, _Booking, _Currency, _Customer}

The final result:

The conversion effect is as follows: blue is the original euro unit and red is the new value converted through currency_conversion:

More of Jerry’s original articles can be found on “Wang Zixi “: