ORTT table in SAP Business One (Exchange Rates)

ORTT is the SAP Business One table of exchange rates (and CPI indexes): one row per currency and date with the rate in local currency. It has only a few columns, RateDate, Currency and Rate plus audit fields, and joins to the currencies table on ORTT.Currency = OCRN.CurrCode.

ORTT key fields

FieldWhat it holds
RateDateExchange rate date.
CurrencyCurrency code. Joins to OCRN.CurrCode.
RateCurrency rate.
DataSourceHow the rate was entered, for example I = interface, O = DI API, S = Service Layer.
UserSignUser who entered the rate. Joins to OUSR.USERID.
UserSign2User who last updated it.
UpdateDateDate of the last update.
LogInstancLog instance.

How ORTT relates to other tables

ORTT holds the rate history of each foreign currency in OCRN; Currency plus RateDate identifies a rate. Documents copy the rate they used into DocRate on the header, so posted documents do not change when a rate in ORTT is corrected later.

Common joins

  • ORTT T0 INNER JOIN OCRN T1 ON T1.CurrCode = T0.Currency (currency name and ISO code)
  • ORTT T0 LEFT JOIN OUSR T2 ON T2.USERID = T0.UserSign (who entered the rate)

When you use the ORTT table

Use ORTT to show the latest rate per currency, to find days with a missing rate before posting, to revalue open foreign-currency balances, and to check who imported the rates.

Example query: latest rate per currency

SQL Server

SELECT T0.Currency, T1.CurrName, T0.RateDate, T0.Rate
FROM ORTT T0
INNER JOIN OCRN T1 ON T1.CurrCode = T0.Currency
WHERE T0.RateDate = (SELECT MAX(T2.RateDate) FROM ORTT T2 WHERE T2.Currency = T0.Currency)
ORDER BY T0.Currency

SAP HANA (column names in double quotes)

SELECT T0."Currency", T1."CurrName", T0."RateDate", T0."Rate"
FROM ORTT T0
INNER JOIN OCRN T1 ON T1."CurrCode" = T0."Currency"
WHERE T0."RateDate" = (SELECT MAX(T2."RateDate") FROM ORTT T2 WHERE T2."Currency" = T0."Currency")
ORDER BY T0."Currency"

Paste either version in Tools → Queries → Query Generator. Need the other dialect for your own query? Use the SQL to HANA converter.

Common pitfall: Expecting a rate for every day

ORTT only has the dates someone entered or imported, so weekends and holidays are often missing. A join on RateDate = document date returns nothing for those days. Take the latest rate on or before the date with MAX(RateDate), or use the rate stored on the document (DocRate). See OCRN table (currencies).

Ready-made queries that use ORTT

  • Customer balances: All customers with a non-zero account balance, with credit limit and phone.

Questions about the ORTT table

What columns does ORTT have?

RateDate, Currency and Rate, plus DataSource, UserSign, UserSign2, UpdateDate and LogInstanc.

How do I get the latest exchange rate in SAP Business One?

Take the row with MAX(RateDate) per Currency in ORTT.

Does a document change when I correct a rate in ORTT?

No. Documents store the rate used in DocRate on the header.

Related tables

OCRN (Currencies) · OINV (A/R Invoice (header)) · search all SAP Business One tables

Sources: SAP Business One documentation and SDK (DI API database tables reference), SAP Help Portal.

Ready to get started?

Tell us what you need. You get a clear technical answer, a fixed scope and a price, usually within 24 hours.