Sapass

 Simplify SAP R/3 development with Excel VBA/VB RFC  
Home> Bapi>ExchangeRate



Index

ExchangeRate

ExchangeRate


In the SAP System exchange rates are used for translating monetary amounts into other currencies. The effective
exchange rate is calculated from the exchange rate number in the
exchange rates table and the exchange rate ratios stored in a separate database table.


Example: Average rate USD/ITL = 1.93458, Exch.rate ratio 1 : 1000.


=> Effective average rate: 1 USD = 1934.58 ITL.



A currency pair is made up of a from currency (USD in the above
example) and a to currency (ITL). The exchange rate ratio is also known as the exchange rate factor.


The exchange rate type enables exchange rates to be differentiated
using additional characteristics (e.g. average, buying, selling or
fixed rate). Thus the average rate between two currencies differs from the buying or selling rate.


In the SAP System exchange rates are client-specific, but not tied to any other organizational unit.


11-Dec-2005


Methods

Available Methods


  • Create : Insert an entry in table of exchange rates [ BAPI_EXCHANGERATE_CREATE ]
  • CreateMultiple : Insert one or more exchange rates in SAP tables [ BAPI_EXCHRATE_CREATEMULTIPLE ]
  • GetCurrentRates : List of exchange rates per exch.rate type and date [ BAPI_EXCHRATE_GETCURRENTRATES ]
  • GetDetail : Exchange rate stored for exch.rate type, currency pair, value date [ BAPI_EXCHANGERATE_GETDETAIL ]
  • GetFactors : Display relevant ratios for exchange rate [ BAPI_EXCHANGERATE_GETFACTORS ]
  • GetListRateTypes : List of all exchange rate types used for conversion [ BAPI_EXCHRATE_GETLISTRATETYPES ]
  • SaveReplica : Replication of currency rates [ BAPI_EXCHANGERATE_SAVEREPLICA ]

11-Dec-2005


Create

Create


The API method enables you to write an entry to the exchange ratetable. The system runs an authorization check to see if you are authorized to maintain the exchange rate tables.

The update process is started asynchronously in this BAPI. In order for
the update to be successfully completed, the program calling the BAPI must execute the order COMMIT WORK itself (external COMMIT).

Example

Example:

On June 1st, 1998, one Deutsche Mark (DEM) is worth 998 Italian Lira(ITL). An entry needs to be made in the foreign currency exchange table
for the average rate at this date. The structure can be filled out as follows:
Ex.type From curr. To curr. Rate From factor To factor
M DEM ITL 0.98800 1 1000


11-Dec-2005


CreateMultiple

CreateMultiple


The API method enables you to write one or more entries to the table ofexchange rates. The system checks you are authorized to maintain exchange rate tables.

The update process is started asynchronously in this BAPI. In order forthe update to be successfully completed, the program calling the BAPI must execute the order COMMIT WORK itself (external COMMIT).

Example

Example of a table entry:

On June 1st, 1998, one Deutsche Mark (DEM) is worth 998 Italian Lira(ITL). An entry needs to be made in the foreign currency exchange tablefor the average rate at this date. The structure can be filled out as follows:

Ex.type From curr. To curr. Rate From factor To factor
M DEM ITL 0.98800 1 1000

Notes

When the method has been run, the first line of the log table containsgeneral information about the update status. The other lines contain
valuation information on the separate lines of the specified exchange rate table.


11-Dec-2005


GetCurrentRates

GetCurrentRates


The API method enables you to read entries from the table of exchange rates. Only entries for a certain exchange rate type and a certain translation date are read. The system checks you are authorized to display exchange rate tables.

Notes


If an error message has appeared in the course of processing, theoutput structure will be blank. Messages are displayed in the RETURNparameter. You will find the return code and its meaning in the documentation for this parameter.


11-Dec-2005


GetDetail

GetDetail


The API method enables you to read an entry from the table of exchangerates. The system checks that you are authorized to display the exchange rate tables.

Example

Input:
M DEM ITL 10.03.1998
Output:
M DEM ITL 10.03.1998 0,9882 1 1000

After being adjusted in accordance with the exchange rate ratio, one Deutsche Mark is worth 988.20 Italien Lira on 10.03.1998.

Notes

If an error message has appeared in the course of processing, theoutput structure will be blank. Messages are displayed in the RETURN
parameter. You will find the return code and its meaning in the documentation for this parameter.


11-Dec-2005


GetFactors

GetFactors


Reads an exchange rate ratio pair from the table of exchange raterelations. The systems checks you are authorized to display this table.

Example

Input:
M DEM ITL 10.03.1998
Output:
1 1000

Notes

If an error message has appeared in the course of processing, the
output structure will be blank. Messages are displayed in the RETURNparameter. You will find the return code and its meaning in the documentation for this parameter.


11-Dec-2005


GetListRateTypes

GetListRateTypes


Reads all exchange rate types used in the R/3 System. The system checks you have authorization to display the data tobe read.

Notes

If an error message has appeared in the course of processing, theoutput structure will be blank. Messages are displayed in the RETURN
parameter. You will find the return code and its meaning in the documentation for this parameter.


11-Dec-2005


SaveReplica

SaveReplica


The API method enables you to replicate one or more entries from thetable of exchange rates in an external system. The system checks you have authorization for maintaining the exchange rate tables.

The update process is started asynchronously in this BAPI. In order for
the update to be successfully completed, the program calling the BAPI must execute the order COMMIT WORK itself (external COMMIT).

Example

Example for replicating an exchange rate:

On June 1st, 1998, one Deutsche Mark (DEM) is worth 998 Italian Lira
(ITL). An entry needs to be made in the foreign currency exchange tablefor the average rate at this date. The structure can be filled out as follows:
Ex.type From curr. To curr. Rate From factor To factor
M DEM ITL 0.98800 1 1000


11-Dec-2005