Every SAP finance system stores exchange rates in one table, TCURR, keyed by exchange rate type (usually M for the standard rate), from-currency, to-currency and valid-from date. Transaction OB08 edits it by hand, and in a lot of systems that is still how the rates get there: someone copies a central bank table into OB08 every day or every month-end.
When the rate has to be a specific institution's, such as the ECB reference rate or the RBI table, you want a job that loads that table on a schedule, dated with the day the bank set it. This post covers the three load paths SAP supports, how to map the rate direction without doing arithmetic in SAP, and a short Python loader that posts through the BAPI. The data comes from the AllRatesToday central bank endpoint.
The full guide is at allratestoday.com/docs/integrations/sap/.
Pick the load path by deployment
| Deployment | Load path | Input |
|---|---|---|
| ECC, S/4HANA on-premise or private cloud | Function module BAPI_EXCHRATE_CREATEMULTIPLE via RFC | Rows built from the JSON response |
| ECC, S/4HANA on-premise | Program RFTBFF00 (market data file interface) | Fixed-format text file |
| S/4HANA Cloud, public edition | Fiori app Import Foreign Exchange Rates, or the Exchange Rate integration communication scenario (SAP_COM_0079) | Spreadsheet upload or SOAP |
All three end up in the same TCURR rows. The source side is the same too: one call to
GET /api/v1/central-bank/{bank}/latest returns the bank's latest table. Add ?source=USD&target=EUR for one resolved pair, format=xml or format=csv for importers that don't read JSON, and api_key= on the URL when the importer can't send headers.
Direction and ratios: map, don't divide
SAP stores a rate as to-currency per from-currency, with ratio factors (FROM_FACTOR, TO_FACTOR) for currencies quoted per 100 or 1,000 units.
The API returns the bank's own direction unmodified in base and quote, with value already per 1 unit of base. So the mapping is direct:
FROM_CURR = base TO_CURRNCY = quote EXCH_RATE = value FROM_FACTOR = 1, TO_FACTOR = 1 If your controlling area wants the opposite direction, don't invert the number yourself in the loader. Ask the API for it with source and target. The response then carries derived and method, which is what you want in the audit file when someone later asks where a rate came from.
Route 1: post through the BAPI
Where you have RFC access, BAPI_EXCHRATE_CREATEMULTIPLE is the simplest route. Here it is in Python with pyrfc, one call per bank per day:
import requests from pyrfc import Connection conn = Connection(ashost="sap.example.com", sysnr="00", client="100", user="RFCUSER", passwd="...") BANK, RATE_TYPE = "ecb", "M" t = requests.get(f"https://allratestoday.com/api/v1/central-bank/{BANK}/latest", headers={"Authorization": "Bearer art_live_your_key"}, timeout=10).json() valid_from = t["rate_date"].replace("-", "") # YYYYMMDD rows = [{ "RATE_TYPE": RATE_TYPE, "FROM_CURR": r["base"], "TO_CURRNCY": r["quote"], "VALID_FROM": valid_from, "EXCH_RATE": r["value"], "FROM_FACTOR": 1, "TO_FACTOR": 1, } for r in t["rates"]] res = conn.call("BAPI_EXCHRATE_CREATEMULTIPLE", EXCHRATE_LIST=rows, UPD_ALLOW="X") errors = [m for m in res["RETURN"] if m["TYPE"] in ("E", "A")] if errors: raise SystemExit(errors) conn.call("BAPI_TRANSACTION_COMMIT", WAIT="X") print(f"{len(rows)} rates loaded for {t['rate_date']}") A few details worth calling out:
-
VALID_FROMcomes fromrate_date, the date on the bank's table, not the day the job ran. A job that runs late still writes the right date. -
UPD_ALLOW="X"lets a rerun overwrite the same date. That's what you want when a bank amends a table, and it makes reruns safe in general. - Check
RETURNforEandAmessages before you commit. The BAPI doesn't raise on a bad row; it reports it there. - Rate type.
Mis the default for FI postings. For month-end valuation, use the type your valuation method names, which is often a dedicated closing type.
Route 2: file-based load with RFTBFF00
Where RFC isn't available, generate the input for RFTBFF00 from the CSV output instead of JSON:
/api/v1/central-bank/ecb/latest?format=csv That returns one row per pair with rate_date, base, quote and value. A short transformation turns those columns into the program's fixed-width layout.
Route 3: S/4HANA Cloud, public edition
On public edition, the Import Foreign Exchange Rates app accepts the same columns from a spreadsheet. format=xlsx on the endpoint gives you that file directly, so the "integration" can be as small as downloading one file and uploading it.
Customs rates are a different rate type
If you run SAP Global Trade Services, customs value has to be converted at the rate the customs authority of the clearance country set for the declaration date, not the M rate your postings use. GTS reads it from TCURR under the rate type assigned to each legal regulation, so each customs table gets its own rate type, loaded from /api/v1/customs/{country} and distributed to GTS with RFALEX00 (message type EXCHANGE_RATE). That setup has its own guide: Customs exchange rates in SAP GTS.
A ready-made package
If you'd rather not write the loader, the sap-official-exchange-rates repository has both routes ready to adapt: a SAP Integration Suite Groovy step that turns an API response into an EXCHANGE_RATE01 IDoc, and an ABAP report that posts with BAPI_EXCHRATE_CREATEMULTIPLE. The package guide covers setup.
Operational notes
- Schedule after the bank's publication time. Each source's schedule is on its bank page.
- Multi-entity groups with several statutory currencies run the loop once per bank code. Each run is one API call.
- Don't build cross rates in SAP from two bank tables unless the regulation permits it. The methodology page explains what the API computes and what it won't.
Links
- Guide: https://allratestoday.com/docs/integrations/sap/
- Covered banks and tax authorities: https://allratestoday.com/central-bank-rates-api/institutions/
- Other systems (Business Central, Xero, QuickBooks Online, Odoo): https://allratestoday.com/docs/integrations/
- API key: https://allratestoday.com/register/
Rates are redistributed from each institution's own publication. They are reference rates for accounting, tax and compliance, not dealing quotes.



