biuan SAP® BUSINESS ONE SDK
API Get Currency Rate

Description

Returns a Recordset object that contains the currency rate for a specified date and currency code.

See Currency sample.

Source table: ORTT.

Syntax

Visual Basic
Public Function GetCurrencyRate( _
   ByVal Currency As String, _
   ByVal Date As Date _
) As Recordset

Parameters

Currency
Specifies the currency code.
Date
Specifies the date for the currency exchange rate.

Return Type

A Recordset object that contains one field named CurrencyRate that holds the rate value.

SAP Business One returns 0 if the system cannot find the exchange rate.

Exceptions

-2000 The connection with the database has been disconnected.

Remarks

You can use this method to query the exchange rate between any currency and the local currency.

For example, if the local currency is US dollars, and you need the currency rate for EUR on January 10, 2002. Use the following line code:

vObj.GetCurrencyRate("eur", Date("10.01.2002"))

A result of 0.98 from the returned Recordset object means that on January 10, 2002 the exchange rate was 1 EUR = 0.98 USD.

Example

See Also



SAP® Business One is the trademark(s) or registered trademark(s) of SAP AG in Germany and in several other countries. Icons by Icons8 Contact
This website is not affiliated with, maintained, authorized, endorsed or sponsored by SAP AG or any of its affiliates