cancel
Showing results for 
Search instead for 
Did you mean: 

Currency Conversion directly in a CDS View

PSchmierer
Participant
0 Kudos
4,752

Hello together,

how can we implement a currency conversion directly in a CDS View in S4HC if the CDS View is exposed as API?

The CDS View cannot be published using the function currency_conversion() in a calculated field in the app "Custom CDS View".

currency_conversion(
    amount => I_BillingDocumentItem.NetAmount,
    source_currency => I_BillingDocumentItem.TransactionCurrency,
    target_currency => cast( 'USD' as ABAP.CUKY( 5 ) ),
    exchange_rate_date => I_BillingDocumentItem.CreationDate,
    exchange_rate_type => 'M',
    error_handling => 'FAIL_ON_ERROR',
    round => 'true',
    decimal_shift => 'true',
    decimal_shift_back => 'true'
  )

However displaying the data preview of the CDS View is showing the correct values. Publishing the CDS View is not allowed. As the following error mesage is displayed: 

Element contains a not supported formula.
APS_CCV_CHECK/008

We are also not able to derive the correct Exchange Rate from CDS View I_ExchangeRate as it is only containing one date (ExchangeRateEffectiveDate). So we are missing the DateTo as ExchangeRateEffectiveDate can be interpreted as DateFrom.

Best regards

Philipp

View Entire Topic
0 Kudos

Hello Philipp,

Were you able to get any solution for this Currency Conversion issue ?

Regards,

Ankit

PSchmierer
Participant
0 Kudos

Hello aks04 ,

I opend an SAP incident for that.

If you have any error messages or warning, refresh your browser and publish the CDS View. It works.

This issue shall be fixed in future releases.

Best regards

Philipp