SAP EXCHANGE_RATE_SERVICE Function Module for









EXCHANGE_RATE_SERVICE is a standard exchange rate service SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 exchange rate service FM, simply by entering the name EXCHANGE_RATE_SERVICE into the relevant SAP transaction such as SE37 or SE38.

Function Group: FVC0
Program Name: SAPLFVC0
Main Program:
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function EXCHANGE_RATE_SERVICE 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 'EXCHANGE_RATE_SERVICE'"
EXPORTING
I_BETRAG = "
* I_GDATU = SY-DATUM "
* I_KURS = "
* I_KURSBER = "
* I_BUKRS = "
I_WAEHRUNG_NACH = "
I_WAEHRUNG_VON = "
* I_READ_TCURR = 'X' "

IMPORTING
O_BETRAG = "
O_CURRDEC = "
O_DATUM_GUELTIG_AB = "
O_FAKTOR_NACH = "
O_FAKTOR_VON = "
O_KURS = "
O_DERIVED_RATE_TYPE = "
O_FIXED_RATE = "

EXCEPTIONS
NO_RATE_FOUND = 1 NO_FACTORS_FOUND = 2 NO_SPREAD_FOUND = 3 OVERFLOW = 4 NO_KURSTYP_FOUND = 5 NO_KURSBER_FOUND = 6 DERIVED_2_TIMES = 7
.



IMPORTING Parameters details for EXCHANGE_RATE_SERVICE

I_BETRAG -

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

I_GDATU -

Data type: SY-DATUM
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_KURS -

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

I_KURSBER -

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

I_BUKRS -

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

I_WAEHRUNG_NACH -

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

I_WAEHRUNG_VON -

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

I_READ_TCURR -

Data type:
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for EXCHANGE_RATE_SERVICE

O_BETRAG -

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

O_CURRDEC -

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

O_DATUM_GUELTIG_AB -

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

O_FAKTOR_NACH -

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

O_FAKTOR_VON -

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

O_KURS -

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

O_DERIVED_RATE_TYPE -

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

O_FIXED_RATE -

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

EXCEPTIONS details

NO_RATE_FOUND -

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

NO_FACTORS_FOUND -

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

NO_SPREAD_FOUND -

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

OVERFLOW -

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

NO_KURSTYP_FOUND -

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

NO_KURSBER_FOUND -

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

DERIVED_2_TIMES -

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

Copy and paste ABAP code example for EXCHANGE_RATE_SERVICE 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_i_betrag  TYPE STRING, "   
lv_o_betrag  TYPE STRING, "   
lv_no_rate_found  TYPE STRING, "   
lv_i_gdatu  TYPE SY-DATUM, "   SY-DATUM
lv_o_currdec  TYPE TCURX-CURRDEC, "   
lv_no_factors_found  TYPE TCURX, "   
lv_i_kurs  TYPE EXCHANGE-I_KURS, "   
lv_no_spread_found  TYPE EXCHANGE, "   
lv_o_datum_gueltig_ab  TYPE SY-DATUM, "   
lv_overflow  TYPE SY, "   
lv_i_kursber  TYPE TCURB-RKURSBER, "   
lv_o_faktor_nach  TYPE TCURF-TFACT, "   
lv_i_bukrs  TYPE T001-BUKRS, "   
lv_o_faktor_von  TYPE TCURF-FFACT, "   
lv_no_kurstyp_found  TYPE TCURF, "   
lv_o_kurs  TYPE TCURR-UKURS, "   
lv_i_waehrung_nach  TYPE TCURR-TCURR, "   
lv_no_kursber_found  TYPE TCURR, "   
lv_i_waehrung_von  TYPE TCURR-FCURR, "   
lv_derived_2_times  TYPE TCURR, "   
lv_o_derived_rate_type  TYPE TCURR-KURST, "   
lv_i_read_tcurr  TYPE TCURR, "   'X'
lv_o_fixed_rate  TYPE TCURR. "   

  CALL FUNCTION 'EXCHANGE_RATE_SERVICE'  "
    EXPORTING
         I_BETRAG = lv_i_betrag
         I_GDATU = lv_i_gdatu
         I_KURS = lv_i_kurs
         I_KURSBER = lv_i_kursber
         I_BUKRS = lv_i_bukrs
         I_WAEHRUNG_NACH = lv_i_waehrung_nach
         I_WAEHRUNG_VON = lv_i_waehrung_von
         I_READ_TCURR = lv_i_read_tcurr
    IMPORTING
         O_BETRAG = lv_o_betrag
         O_CURRDEC = lv_o_currdec
         O_DATUM_GUELTIG_AB = lv_o_datum_gueltig_ab
         O_FAKTOR_NACH = lv_o_faktor_nach
         O_FAKTOR_VON = lv_o_faktor_von
         O_KURS = lv_o_kurs
         O_DERIVED_RATE_TYPE = lv_o_derived_rate_type
         O_FIXED_RATE = lv_o_fixed_rate
    EXCEPTIONS
        NO_RATE_FOUND = 1
        NO_FACTORS_FOUND = 2
        NO_SPREAD_FOUND = 3
        OVERFLOW = 4
        NO_KURSTYP_FOUND = 5
        NO_KURSBER_FOUND = 6
        DERIVED_2_TIMES = 7
. " EXCHANGE_RATE_SERVICE




ABAP code using 7.40 inline data declarations to call FM EXCHANGE_RATE_SERVICE

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 DATUM FROM SY INTO @DATA(ld_i_gdatu).
DATA(ld_i_gdatu) = SY-DATUM.
 
"SELECT single CURRDEC FROM TCURX INTO @DATA(ld_o_currdec).
 
 
"SELECT single I_KURS FROM EXCHANGE INTO @DATA(ld_i_kurs).
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_o_datum_gueltig_ab).
 
 
"SELECT single RKURSBER FROM TCURB INTO @DATA(ld_i_kursber).
 
"SELECT single TFACT FROM TCURF INTO @DATA(ld_o_faktor_nach).
 
"SELECT single BUKRS FROM T001 INTO @DATA(ld_i_bukrs).
 
"SELECT single FFACT FROM TCURF INTO @DATA(ld_o_faktor_von).
 
 
"SELECT single UKURS FROM TCURR INTO @DATA(ld_o_kurs).
 
"SELECT single TCURR FROM TCURR INTO @DATA(ld_i_waehrung_nach).
 
 
"SELECT single FCURR FROM TCURR INTO @DATA(ld_i_waehrung_von).
 
 
"SELECT single KURST FROM TCURR INTO @DATA(ld_o_derived_rate_type).
 
DATA(ld_i_read_tcurr) = 'X'.
 
 


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!