After extensive troubleshooting with our technical team, we’ve identified and resolved the currency conversion issue. The problem involved all three focus areas: currency conversion logic in the CDS view, exchange rate table reference configuration, and analytics cache refresh timing.
Currency Conversion Logic Problem:
Our currency_conversion function was syntactically correct but had a logical flaw. We were using PricingDate as the exchange_rate_date, which meant historical pricing records always used the exchange rate valid on their original pricing date. For historical analysis, this is correct. But for current reporting where we want to see “today’s value” of historical prices, we needed a different approach.
We modified the CDS view to support both scenarios:
@Analytics.parameter: 'P_CONV_DATE'
currency_conversion(
amount => NetPrice,
source_currency => LocalCurrency,
target_currency => 'EUR',
exchange_rate_date => case
when :P_CONV_DATE = 'CURRENT' then $session.system_date
else PricingDate
end
)
This allows the report to use either historical rates (for trend analysis) or current rates (for current valuation).
Exchange Rate Table Reference Issue:
The more critical problem was that our BW extraction was using a separate exchange rate table. We have both embedded analytics (CDS-based) and BW reporting, and they were out of sync. The CDS view correctly read from S/4HANA’s TCURR table with updated rates, but BW’s /BI0/PEXCHRATE table still had old rates.
We implemented automatic synchronization:
- Created a custom program to extract exchange rates from TCURR to BW daily
- Modified the BW InfoPackage to include exchange rate master data in the daily load
- Set up a process chain to reload /BI0/PEXCHRATE immediately after exchange rate updates in S/4HANA
Analytics Cache Refresh Solution:
The third issue was multi-layered caching. Even after fixing the data sources, cached results persisted:
- CDS View Cache: Used transaction SFSW to clear the CDS view cache for our pricing analytics view
- Currency Conversion Cache: Ran transaction RSCUR to refresh the currency conversion buffer
- OLAP Cache: Cleared query-specific cache in transaction RSRCACHE for all pricing-related queries
- BW Cache: Invalidated BW query cache using transaction RSRT → ‘Delete OLAP Cache’
We also discovered that the currency_conversion function maintains an internal buffer that’s refreshed only nightly by default. We modified the CDS view to include:
@Analytics.settings.cacheExpirationTime: '1H'
This forces the currency conversion to refresh hourly instead of daily.
After implementing all changes, we tested with a pricing document from last month (when USD/EUR was 1.08). Using the ‘historical’ conversion mode, it correctly shows the old rate. Using ‘current’ mode, it now shows conversion at the new 1.12 rate. The report updates within one hour of any exchange rate changes.
One critical learning: When using BW alongside embedded analytics, exchange rate master data must be synchronized between systems. We now have a monitoring job that compares TCURR and /BI0/PEXCHRATE daily and alerts if they’re out of sync by more than 1%.
For anyone facing similar issues, I recommend checking the entire currency conversion pipeline: the CDS function parameters, the source exchange rate tables in both S/4HANA and BW (if applicable), and all caching layers from CDS to OLAP to application cache.