How to Load RBA Exchange Rates into SAP S/4HANA and ECC (TCURR / OB08)

Automate SAP's daily exchange rate maintenance with official Reserve Bank of Australia rates. A working ABAP report that posts RBA rates to TCURR through BAPI_EXCHANGERATE_CREATE, with translation ratios, quotation direction and SM36 scheduling explained.

In SAP, exchange rates live in table TCURR, keyed by exchange rate type (KURST), from-currency, to-currency and valid-from date. The standard rate type is M, and in many Australian companies someone maintains it by hand in transaction OB08 every afternoon, copying numbers off the RBA website.

This guide replaces that step with a small ABAP report that calls the Exchange Rates API and posts each rate through the standard BAPI_EXCHANGERATE_CREATE, scheduled daily as a background job.

Using a different system? See the ERP integration overview for SAP Business One, Xero, NetSuite, Business Central, Odoo and Excel.

Before You Start

The API returns rates as units of foreign currency per 1 AUD, which is how the RBA publishes them:

{
  "success": true,
  "timestamp": 1725080400,
  "base": "AUD",
  "date": "2025-08-31",
  "rates": {
    "USD": 0.643512,
    "EUR": 0.562934,
    "JPY": 96.8321
  }
}

Four things to get right for SAP:

  • Direction. Most Australian SAP systems keep rate type M as a direct quotation: AUD per n units of foreign currency, where n is the translation ratio in TCURF. So you post n / rate.
  • TWI and SDR. TWI (Trade-Weighted Index) is an index, not a currency, so skip it. SDR's ISO code is XDR; skip it unless you have XDR set up. The report below only posts the 18 real currencies.
  • Weekends and public holidays. The RBA doesn't publish on those days. SAP uses the most recent valid-from date on or before the posting date, so you only need to load the days the RBA publishes. Always use the date from the response as the valid-from date, never today's date.
  • Timing. The RBA publishes around 4 PM AEST. Schedule the job for 5 PM Sydney time or later on business days.

1. Create an HTTP destination

In SM59, create a type G (HTTP to external server) destination called ZRBA_FX_API:

  • Host: api.exchangeratesapi.com.au
  • Port: 443, SSL active (import the certificate chain in STRUST if needed)
  • Path prefix: leave empty

Keep the API key out of source code. Store it in a secure store your Basis team already uses (SSF, a restricted customising table or the BTP credential store).

2. The import report

REPORT zfx_rba_rates_import.

PARAMETERS: p_kurst TYPE kurst_curr DEFAULT 'M',
            p_test  AS CHECKBOX DEFAULT abap_true.

TYPES: BEGIN OF ty_rates,
         usd TYPE decfloat34, cny TYPE decfloat34, jpy TYPE decfloat34,
         eur TYPE decfloat34, krw TYPE decfloat34, gbp TYPE decfloat34,
         sgd TYPE decfloat34, inr TYPE decfloat34, thb TYPE decfloat34,
         nzd TYPE decfloat34, twd TYPE decfloat34, myr TYPE decfloat34,
         idr TYPE decfloat34, vnd TYPE decfloat34, cad TYPE decfloat34,
         hkd TYPE decfloat34, chf TYPE decfloat34, php TYPE decfloat34,
       END OF ty_rates,
       BEGIN OF ty_response,
         success TYPE abap_bool,
         date    TYPE string,
         base    TYPE string,
         rates   TYPE ty_rates,
       END OF ty_response.

DATA: lo_client   TYPE REF TO if_http_client,
      ls_response TYPE ty_response,
      ls_return   TYPE bapiret2.

START-OF-SELECTION.

  " 1. Call GET /latest via the SM59 destination
  cl_http_client=>create_by_destination(
    EXPORTING  destination = 'ZRBA_FX_API'
    IMPORTING  client      = lo_client
    EXCEPTIONS OTHERS      = 1 ).
  IF sy-subrc <> 0.
    MESSAGE 'HTTP destination ZRBA_FX_API not available' TYPE 'E'.
  ENDIF.

  cl_http_utility=>set_request_uri( request = lo_client->request
                                    uri     = '/latest' ).
  lo_client->request->set_header_field(
    name  = 'Authorization'
    value = |Bearer { zcl_fx_secrets=>get_rba_api_key( ) }| ). " your secure store

  lo_client->send( EXCEPTIONS OTHERS = 1 ).
  lo_client->receive( EXCEPTIONS OTHERS = 2 ).
  IF sy-subrc <> 0.
    MESSAGE 'Exchange Rates API call failed' TYPE 'E'.
  ENDIF.

  lo_client->response->get_status( IMPORTING code = DATA(lv_status) ).
  IF lv_status <> 200.
    MESSAGE |Exchange Rates API returned HTTP { lv_status }| TYPE 'E'.
  ENDIF.

  " 2. Parse JSON into the typed structure
  /ui2/cl_json=>deserialize(
    EXPORTING json = lo_client->response->get_cdata( )
    CHANGING  data = ls_response ).

  " RBA publication date 'YYYY-MM-DD' -> SAP date
  DATA(lv_valid_from) = CONV datum(
    replace( val = ls_response-date sub = '-' with = `` occ = 0 ) ).

  " 3. Post one TCURR entry per currency (TWI and SDR deliberately excluded)
  DATA(lt_currencies) = VALUE string_table(
    ( `USD` ) ( `CNY` ) ( `JPY` ) ( `EUR` ) ( `KRW` ) ( `GBP` )
    ( `SGD` ) ( `INR` ) ( `THB` ) ( `NZD` ) ( `TWD` ) ( `MYR` )
    ( `IDR` ) ( `VND` ) ( `CAD` ) ( `HKD` ) ( `CHF` ) ( `PHP` ) ).

  LOOP AT lt_currencies INTO DATA(lv_currency).
    ASSIGN COMPONENT lv_currency OF STRUCTURE ls_response-rates
      TO FIELD-SYMBOL(<lv_rate>).
    IF sy-subrc <> 0 OR <lv_rate> IS INITIAL.
      CONTINUE.
    ENDIF.

    " Translation ratio: MUST match TCURF for this rate type / pair.
    " These are common examples - check yours in OBBS.
    DATA(lv_factor) = SWITCH i( lv_currency
                        WHEN `JPY` OR `KRW` OR `INR` OR `THB` OR `PHP` OR `TWD` THEN 100
                        WHEN `IDR` OR `VND` THEN 1000
                        ELSE 1 ).

    " Direct quotation: AUD per <factor> units of foreign currency
    DATA(ls_rate) = VALUE bapi1093_0(
      rate_type   = p_kurst
      from_curr   = lv_currency
      to_currncy  = 'AUD'
      valid_from  = lv_valid_from
      exch_rate   = lv_factor / <lv_rate>
      from_factor = lv_factor
      to_factor   = 1 ).

    IF p_test = abap_true.
      WRITE: / lv_currency, lv_valid_from, ls_rate-exch_rate, '(test run)'.
      CONTINUE.
    ENDIF.

    CALL FUNCTION 'BAPI_EXCHANGERATE_CREATE'
      EXPORTING
        exch_rate = ls_rate
        upd_allow = abap_true   " overwrite if a rate already exists for this date
      IMPORTING
        return    = ls_return.

    IF ls_return-type CA 'EA'.
      WRITE: / lv_currency, 'ERROR:', ls_return-message.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = abap_true.
      WRITE: / lv_currency, lv_valid_from, ls_rate-exch_rate, 'posted'.
    ENDIF.
  ENDLOOP.

3. Schedule it

Create a background job in SM36 that runs ZFX_RBA_RATES_IMPORT with a variant where p_test is unticked. Schedule it daily at 17:00 Australia/Sydney. Check the job's spool output when you first go live, then compare a few rates in OB08 against the RBA's published table.

Things SAP Teams Ask About

  • Why invert? Most Australian SAP systems keep rate type M as a direct quotation (AUD per unit of foreign currency), and that's what the report posts. If your system uses indirect quotation for these pairs, post the API rate unchanged instead. Your FI consultant will know which convention you use.
  • Translation ratios (TCURF). The from_factor/to_factor you post must match the ratios in TCURF, or the BAPI rejects the entry. Ratios like 100 JPY or 1000 IDR also stop small rates losing precision in the 5-decimal EXCH_RATE field.
  • A separate rate type. Some companies keep RBA rates in their own rate type (e.g. ZRBA) so they can use them alongside a bank or treasury feed, then point the relevant company codes or valuation methods at it.
  • S/4HANA Cloud (public edition). You can't deploy classic ABAP reports there. Build the same flow in SAP Integration Suite instead: a timer-started iFlow that calls the API, maps the JSON and posts to the released exchange rate API for your release (look up "exchange rates" in the SAP Business Accelerator Hub). The transformation rules above still apply.
  • Business One? It's a different product with a different API. See loading RBA rates into SAP Business One.

Before You Go Live

  • Run it twice. upd_allow = abap_true means a second run overwrites rather than duplicates. Confirm that in a test client.
  • Alerting. If the job fails, someone should know before month-end. Route the job log to email or Teams, and check the API's /status endpoint when troubleshooting.
  • Backfill. When you first go live, load historical rates for open periods using /timeseries. Full history back to 2018 is on Professional and above.
  • Tell your auditors. Record in your accounting policy that rate type M (or ZRBA) holds the RBA's 4 PM AEST rates, loaded automatically.

Which Plan Do You Need?

A daily load uses about 22 requests a month, so Starter covers it. Move to Professional if you need history beyond the last 30 days for a backfill, or want a rate-published webhook to trigger the job as soon as rates arrive.

Ready to stop updating OB08 by hand? Get your free API key and try the report in a sandbox client today.


Data sourced from the Reserve Bank of Australia. We are not affiliated with or endorsed by the Reserve Bank of Australia.

SAP, S/4HANA and ABAP are trademarks of SAP SE. Code samples are provided as starting points. Test them in a sandbox or non-production environment and review them with your SAP team before using them in production.

For API documentation, visit Exchange Rates API Docs