CDS Currency Conversion Example

 define view entity zsd_i_article_valuation
  as select from I_ProductValuationBasic
{
  key Product                                      as Article,
  key ValuationArea                                as ValuationArea,
  key ValuationType                                as ValuationType,
      @Semantics.amount.currencyCode: 'CurrencyCode'
      StandardPrice                                as StandardPrice,
      cast ('EUR' as abap.cuky)                    as CurrencyCode,
      Currency,
      @Semantics.amount.currencyCode: 'CurrencyCode'
      currency_conversion(
      client=>$session.client,
      amount => StandardPrice,
      source_currency => Currency,
      target_currency => cast ('EUR' as abap.cuky),
      round=>'X',
      exchange_rate_date => $session.system_date ) as Price
}

Добавить комментарий