# Daily Central Bank Exchange Rate Import Interface

> A custom interface program that reads the daily exchange rates published by the central bank over the internet and writes them into the SAP rate table per rate type. It checks the deviation from the previous day, uses the last valid rate on holidays and reports the result by email.

- Type: Program, Custom development, Interface
- Module: FI
- Estimated effort: M (3–5 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/central-bank-exchange-rate-automatic-import/


## Why is the standard not enough?

OB08 is for entering rates by hand or copying them in the table view; someone has to enter them after the morning publication, and a delay or typo flows straight into invoices. The standard market data transfer expects specific data-provider formats and a separate setup; it does not read the central bank's XML feed directly.

### Closest standard alternatives

- OB08: For entering rates by hand; no automatic import or deviation check.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| TCURR | Exchange rates: rate type, currency pair, validity date and rate | Write | - | ECC + S/4 |
| TCURF | Ratio factors for the currency pair | Read | TCURF-KURST = TCURR-KURST AND TCURF-FCURR = TCURR-FCURR AND TCURF-TCURR = TCURR-TCURR | ECC + S/4 |
| TCURV | Exchange rate type definition | Read | TCURV-KURST = TCURR-KURST | ECC + S/4 |

## BAPIs and functions used

- READ_EXCHANGE_RATE: Reads the previous valid rate for the deviation check

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| P_KURST | Target rate type | Single value | TCURR-KURST | Yes |
| P_DATE | Rate date | Single value | SY-DATUM | Yes |
| S_FCURR | From currency | Range / multiple | TCURR-FCURR | No |
| P_TCURR | To currency | Single value | TCURR-TCURR | Yes |
| P_SRATE | Source rate (forex buying, forex selling, banknote buying, banknote selling) | Single value | - | Yes |
| P_MAXDEV | Allowed daily deviation (%) | Single value | - | No |
| P_HOLID | Copy the last rate to weekends and holidays | Checkbox | - | No |
| P_TEST | Test mode (list without writing to the table) | Checkbox | - | No |

## Result list columns

| Column | Source |
|---|---|
| Rate type | TCURR-KURST |
| From currency | TCURR-FCURR |
| To currency | TCURR-TCURR |
| Valid from | Calculated: TCURR-GDATU converted from inverted date format to a normal date |
| Rate | TCURR-UKURS |
| From factor | TCURR-FFACT |
| To factor | TCURR-TFACT |
| Previous rate | Calculated: Previous valid rate read with READ_EXCHANGE_RATE |
| Change % | Calculated: (Rate − previous rate) / previous rate × 100 |
| Status | Calculated: Written, copied (holiday), skipped (deviation) or error |
| Message | Calculated: Information or error message for the row |

## How does the program work?

1. A background job runs at a set time every working day; the central bank's daily rate file (XML) is read over HTTP. Connection and address are managed through the SM59 / STRUST settings.
2. For every currency in the file, the selected source rate (forex buying, forex selling, banknote) is mapped to an SAP rate type; the mapping lives in a settings table (e.g. forex buying → M, banknote selling → a separate rate type).
3. Ratio factors are read from TCURF; the unit in the file (e.g. 100 JPY) is converted by the factor. The rate type is validated against TCURV.
4. The previous valid rate is read with READ_EXCHANGE_RATE; if the daily deviation exceeds the P_MAXDEV percentage, the row is not written and a warning is issued.
5. Test mode only produces the list; a real run writes TCURR with the validity date in inverted date format (GDATU). On weekends and holidays, the last rate is copied to those days by selection; results and errors are emailed.

## Authorization objects

- S_EXCHRATE: Exchange rate maintenance authorization by rate type (for the background user)
- S_TABU_DIS: Maintenance authorization for the rate table's authorization group

## Frequently asked questions

### Can a source other than the central bank be used?

Yes. The reading layer is separate; your bank's rate service or another data provider can be connected with the same mapping table. A reader class is added for each new source according to its file format.

### What happens on weekends and public holidays?

If the central bank publishes no rate that day, the program uses the last valid rate. By selection this rate is also copied to the holiday dates; copied rows are shown with their own status in the list.

### Does it work on S/4HANA and in the cloud?

Yes. The rate table is the same on S/4HANA. With a clean core approach the write goes through the released exchange rate API, and the program can be built under ABAP Cloud rules.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=fi-exchange-rate-daily-import-interface
