Central Bank Exchange Rates in SAP S/4HANA and ECC
Load official central-bank exchange rates into SAP table TCURR with BAPI_EXCHRATE_CREATEMULTIPLE, the RFTBFF00 market-data file, or the S/4HANA Cloud Import Foreign Exchange Rates app, fed from the AllRatesToday API.
GET /api/v1/central-bank/{bank}/latest (free key, one call per fetch) or the
keyless evaluation copy at /api/public/central-bank/{bank}?format=json.
Add ?source=USD&target=EUR for one resolved pair, format=xml or
format=csv for importers that do not read JSON, and api_key= on the URL
when the importer cannot send headers. Bank codes are on the
central bank coverage map.
Where SAP keeps rates
Every SAP finance system stores exchange rates in 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. Three supported ways load it programmatically, and the right one depends on the 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 |
Direction and ratios
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 published 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, factors 1 and 1. If your
controlling area wants the opposite direction, ask the API for it with source and target rather than
dividing yourself; the response then carries derived and method for the audit file.
Load through the BAPI
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']}") UPD_ALLOW lets a rerun overwrite the same date, which is what you want when a bank amends a table. Exchange
rate type M is the default for FI postings; use the type your valuation method names for month-end (often a
dedicated closing type).
File-based load
Where RFC is not available, generate the input for RFTBFF00 from the CSV format instead of JSON:
/api/v1/central-bank/ecb/latest?format=csv returns one row per pair with rate_date,
base, quote and value, which a short transformation turns into the program's fixed-width
layout. On S/4HANA Cloud the Import Foreign Exchange Rates app accepts the same columns from a spreadsheet;
format=xlsx on the endpoint gives you that file directly.
Notes
- Schedule the job after the bank's publication time; the schedule for each source 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.
- Do not derive cross rates in SAP from two bank tables unless the regulation permits it; the methodology page explains what the API computes and what it will not.
Other systems: Business Central · Xero · QuickBooks Online · SAP · Odoo · all integrations. Endpoint reference: Central Bank Rates.