SAP BAPI_EXCHRATE_GETCURRENTRATES Function Module for Output Selected Exchange Rates and Factors from the SAP System









BAPI_EXCHRATE_GETCURRENTRATES is a standard bapi exchrate getcurrentrates SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Output Selected Exchange Rates and Factors from the SAP System processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for bapi exchrate getcurrentrates FM, simply by entering the name BAPI_EXCHRATE_GETCURRENTRATES into the relevant SAP transaction such as SE37 or SE38.

Function Group: BUS1093
Program Name: SAPLBUS1093
Main Program: SAPLBUS1093
Appliation area: F
Release date: 11-Oct-2000
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_EXCHRATE_GETCURRENTRATES pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'BAPI_EXCHRATE_GETCURRENTRATES'"Output Selected Exchange Rates and Factors from the SAP System
EXPORTING
DATE = "Date on Which Current Exchange Rates Are Read
* DATE_TYPE = 'V' "Date Type: See Long Text
* RATE_TYPE = 'M' "Exchange Rate Type
* SHOW_PROTOCOL = "Indicator: Display Log

TABLES
FROM_CURR_RANGE = "Import: Range Table for 'From' Currency
TO_CURRNCY_RANGE = "Import: Range Table for 'To' Currency
EXCH_RATE_LIST = "Export: List of Exchange Rates
RETURN = "Export: Table of Messages Reported
.



IMPORTING Parameters details for BAPI_EXCHRATE_GETCURRENTRATES

DATE - Date on Which Current Exchange Rates Are Read

Data type: BAPI1093_2-TRANS_DATE
Optional: No
Call by Reference: No ( called with pass by value option)

DATE_TYPE - Date Type: See Long Text

Data type: BAPI1093_2-DATE_TYPE
Default: 'V'
Optional: Yes
Call by Reference: No ( called with pass by value option)

RATE_TYPE - Exchange Rate Type

Data type: BAPI1093_1-RATE_TYPE
Default: 'M'
Optional: Yes
Call by Reference: No ( called with pass by value option)

SHOW_PROTOCOL - Indicator: Display Log

Data type: BAPI1093_2-SHOW_PROTOCOL
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for BAPI_EXCHRATE_GETCURRENTRATES

FROM_CURR_RANGE - Import: Range Table for 'From' Currency

Data type: BAPI1093_3
Optional: No
Call by Reference: No ( called with pass by value option)

TO_CURRNCY_RANGE - Import: Range Table for 'To' Currency

Data type: BAPI1093_4
Optional: No
Call by Reference: No ( called with pass by value option)

EXCH_RATE_LIST - Export: List of Exchange Rates

Data type: BAPI1093_0
Optional: No
Call by Reference: No ( called with pass by value option)

RETURN - Export: Table of Messages Reported

Data type: BAPIRET1
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for BAPI_EXCHRATE_GETCURRENTRATES Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_date  TYPE BAPI1093_2-TRANS_DATE, "   
lt_from_curr_range  TYPE STANDARD TABLE OF BAPI1093_3, "   
lv_date_type  TYPE BAPI1093_2-DATE_TYPE, "   'V'
lt_to_currncy_range  TYPE STANDARD TABLE OF BAPI1093_4, "   
lv_rate_type  TYPE BAPI1093_1-RATE_TYPE, "   'M'
lt_exch_rate_list  TYPE STANDARD TABLE OF BAPI1093_0, "   
lt_return  TYPE STANDARD TABLE OF BAPIRET1, "   
lv_show_protocol  TYPE BAPI1093_2-SHOW_PROTOCOL. "   

  CALL FUNCTION 'BAPI_EXCHRATE_GETCURRENTRATES'  "Output Selected Exchange Rates and Factors from the SAP System
    EXPORTING
         DATE = lv_date
         DATE_TYPE = lv_date_type
         RATE_TYPE = lv_rate_type
         SHOW_PROTOCOL = lv_show_protocol
    TABLES
         FROM_CURR_RANGE = lt_from_curr_range
         TO_CURRNCY_RANGE = lt_to_currncy_range
         EXCH_RATE_LIST = lt_exch_rate_list
         RETURN = lt_return
. " BAPI_EXCHRATE_GETCURRENTRATES




ABAP code using 7.40 inline data declarations to call FM BAPI_EXCHRATE_GETCURRENTRATES

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single TRANS_DATE FROM BAPI1093_2 INTO @DATA(ld_date).
 
 
"SELECT single DATE_TYPE FROM BAPI1093_2 INTO @DATA(ld_date_type).
DATA(ld_date_type) = 'V'.
 
 
"SELECT single RATE_TYPE FROM BAPI1093_1 INTO @DATA(ld_rate_type).
DATA(ld_rate_type) = 'M'.
 
 
 
"SELECT single SHOW_PROTOCOL FROM BAPI1093_2 INTO @DATA(ld_show_protocol).
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!