Description | Query Exchange Rates |
Name | QueryExchangeRateIn_V1 |
Namespace | http://sap.com/xi/AP/IS/CurrencyAndExchangeRates/Global |
Product | SAP Business ByDesign |
Process component | Financial Market Data Management |
Process component namespace | http://sap.com/xi/AP/PC/FinancialMarketDataManagement/Global |
Deployment unit | Foundation |
Endpoint Activation | By Scoping of Process Component | Operations |
|
Release Status | Released |
Technical documentation on the SAP API Business Hub | Query Exchange Rates |
General web service documentation | A2X Web Services (SOAP) |
An interface to query exchange rates.
The Web service interface Query Exchange Rate In enables you to connect external applications to your solution and to query and read exchange rates in your system.
The Web service interface Query Exchange Rate In along with the Web service interface Manage Exchange Rate In is relevant if your company wants to access and manage exchange rates from external applications.
The Web service interface Query Exchange Rate In offers the operation Find by Elements.
Here is an example of a simple Web service request to search for all USD (US Dollar) to EUR (Euro) and CNY (Yuan Renminbi) exchange rates that are valid in March 2013:
<n0:ExchangeRateByElementsQuery_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <ExchangeRateSelectionByElements> <SelectionBySourceCurrencyCode> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryCurrencyCode>USD</LowerBoundaryCurrencyCode> </SelectionBySourceCurrencyCode> <SelectionByTargetCurrencyCode> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryCurrencyCode>EUR</LowerBoundaryCurrencyCode> </SelectionByTargetCurrencyCode> <SelectionByTargetCurrencyCode> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode> <LowerBoundaryCurrencyCode>CNY</LowerBoundaryCurrencyCode> </SelectionByTargetCurrencyCode> <SelectionByValidFromDateTime> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>9</IntervalBoundaryTypeCode> <LowerBoundaryDateTime>2013-03-01T00:00:00.0000000Z</LowerBoundaryDateTime> </SelectionByValidFromDateTime> <SelectionByValidToDateTime> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>7</IntervalBoundaryTypeCode> <LowerBoundaryDateTime>2013-03-31T23:59:59.9999999Z</LowerBoundaryDateTime> </SelectionByValidToDateTime> </ExchangeRateSelectionByElements> <ProcessingConditions> <QueryHitsUnlimitedIndicator>true</QueryHitsUnlimitedIndicator> </ProcessingConditions> </n0:ExchangeRateByElementsQuery_sync>
You can find general information about Web services, their structure and consumption in the Web Services documentation. Please open the Web Services document in a new window.
Description | Find exchange rates |
Name | FindByElements |
Synchronous | yes |
Release Status | Released |
To find exchange rates by elements.
The operation Find by Elements queries and reads exchange rates that are stored in the system. It is closely related to the operation Maintain Bundle of Web service interface Manage Exchange Rate In.
The operation does not calculate any exchange rates. For example, if the system only stores the USD to EUR exchange rates, the operation will not return a result if the EUR to USD exchange rates are requested.
Similarly, selections and calculations using a reference currency are not done. The caller has to provide the reference currency as selection criteria. Even if USD to EUR and EUR to CNY exchange rates exist in the system, the operation will not return a result if USD to CNY exchange rates are requested. The operation may return outdated exchange rates, e.g. a data set for CNY to USD although USD is the reference currency (first currency).
The request contains a node grouping the selection parameters and a node that specifies the processing conditions.
This node groups all selection parameters. The selection parameters are as follows:
Selection Parameter | Remark |
---|---|
SelectionByUUID | Selection by internal unique identifier of an exchange rate |
SelectionByTypeCode | Selection by exchange rate type code |
SelectionBySourceCurrencyCode | Selection by source currency |
SelectionByTargetCurrencyCode | Selection by target currency |
SelectionByValidFromDateTime | Selection by valid from date and time |
SelectionByValidToDateTime | Selection by valid to date and time |
For more information, see the documentation for the Maintain Bundle operation of the service interface Manage Exchange Rate In: Maintain Bundle.
Please note the restrictions regarding SelectionByValidFromDateTime and SelectionByValidToDateTime that are described below.
The response contains the list of found exchange rates, log items, and processing conditions.
Each result record is identified by exchange rate type, source and target currency, and the valid from date and time and provides three rates (BidRate, MidRate, AskRate) together with their three internal unique identifiers (BidExchangeRateUUID, MidExchangeRateUUID, AskExchangeRateUUID). The record contains three identifiers because the system stores the rates of the different categories (Bid, Mid, Ask) as separate entries. As the record itself has no own UUID the selection of packages by <LastReturnedObjectID> is not supported.
Additionally, the response provides the date and time when an exchange rate has been registered in the system (RegisterDateTime) and an indicator that describes whether an exchange rate has been invalidated (DeletedIndicator). In this case two entries are returned as a logical deletion always creates new entries.
In the system, exchange rates are stored with one combination of a date and a time that describes the valid from date and time. A valid to date and time does not exist explicitly. Therefore, the behavior of the two selection parameters is slightly different.
If you want to find all exchange rates that are valid within a certain period, you need to use 'greater than' as the IntervalBoundaryTypeCode and the start of the period as the LowerBoundaryDateTime of the selection parameter SelectionByValidFromDateTime. For SelectionByValidToDateTime, the IntervalBoundaryTypeCode needs to be set to 'less than' and LowerBoundaryDateTime contains the end of the period.
<n0:ExchangeRateByElementsQuery_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global"> <ExchangeRateSelectionByElements> <SelectionByValidFromDateTime> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>8</IntervalBoundaryTypeCode> <LowerBoundaryDateTime>2012-03-31T00:00:00.0000000Z</LowerBoundaryDateTime> </SelectionByValidFromDateTime> <SelectionByValidToDateTime> <InclusionExclusionCode>I</InclusionExclusionCode> <IntervalBoundaryTypeCode>6</IntervalBoundaryTypeCode> <LowerBoundaryDateTime>2013-03-31T23:59:59.9999999Z</LowerBoundaryDateTime> </SelectionByValidToDateTime> </ExchangeRateSelectionByElements> </n0:ExchangeRateByElementsQuery_sync>
Similarly, if you want to include the boundaries of the period, use 'greater than or equal to' and 'less than or equal to'. Please refer to the example on service interface level.
If you use 'equal to' as the IntervalBoundaryTypeCode for SelectionByValidFromDateTime, the service will only return those exchange rates with a valid from date and time that exactly match the LowerBoundaryDateTime.
For the IntervalBoundaryTypeCode of SelectionByValidToDateTime only 'less than' and 'less than or equal to' are supported. Any other input will be interpreted as 'less than or equal'. As SelectionByValidFromDateTime and SelectionByValidToDateTime are to be consider as a time interval complex selections (ranges, exclusion) are not supported. Use single values.