SAP FTR_REALTIME_RATE_SERVICE Function Module for Supplies Realtime Exchange Rates









FTR_REALTIME_RATE_SERVICE is a standard ftr realtime 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 for Supplies Realtime Exchange Rates 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 ftr realtime rate service FM, simply by entering the name FTR_REALTIME_RATE_SERVICE into the relevant SAP transaction such as SE37 or SE38.

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



Function FTR_REALTIME_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 'FTR_REALTIME_RATE_SERVICE'"Supplies Realtime Exchange Rates
EXPORTING
LEADCURR = "Leading Currency in Exchange Rate Quotation
FOLLCURR = "Following Currency in Exchange Rate Quotation
BASECURR = "Currency of Calculation Basis
MATURITY = "End of Term
RATETYPE_BID = "Rate Type
RATETYPE_ASK = "Rate Type
* RATETYPE_MID = "Rate Type
* PI_OREF_USEREXIT = "BAdI Interface IF_EX_FTR_FX_INT
* MODE = '2' "Datafeed: Operating Mode Function Module

IMPORTING
PE_FWD_BID = "Rate of Forex Transaction
PE_SPOT_BID = "Spot Rate
PE_SWAP_BID = "Swap Rate
PE_FWD_ASK = "Rate of Forex Transaction
PE_SPOT_ASK = "Spot Rate
PE_SWAP_ASK = "Swap Rate
PE_DATE_RATE = "Date and Time, Current (Application Server) Date
PE_TIME_RATE = "Date and Time, Current Application Server Time

TABLES
* RETURN = "Return Parameter

EXCEPTIONS
CUSTOMIZING_INCOMPLETE = 1 RATE_ERROR = 2 USER_EXIT_EXCEPTION = 3 SWAP_INCOMPLETE = 4
.



IMPORTING Parameters details for FTR_REALTIME_RATE_SERVICE

LEADCURR - Leading Currency in Exchange Rate Quotation

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

FOLLCURR - Following Currency in Exchange Rate Quotation

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

BASECURR - Currency of Calculation Basis

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

MATURITY - End of Term

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

RATETYPE_BID - Rate Type

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

RATETYPE_ASK - Rate Type

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

RATETYPE_MID - Rate Type

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

PI_OREF_USEREXIT - BAdI Interface IF_EX_FTR_FX_INT

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

MODE - Datafeed: Operating Mode Function Module

Data type: VTBDFMS-WORKMODUS
Default: '2'
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for FTR_REALTIME_RATE_SERVICE

PE_FWD_BID - Rate of Forex Transaction

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

PE_SPOT_BID - Spot Rate

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

PE_SWAP_BID - Swap Rate

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

PE_FWD_ASK - Rate of Forex Transaction

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

PE_SPOT_ASK - Spot Rate

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

PE_SWAP_ASK - Swap Rate

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

PE_DATE_RATE - Date and Time, Current (Application Server) Date

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

PE_TIME_RATE - Date and Time, Current Application Server Time

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

TABLES Parameters details for FTR_REALTIME_RATE_SERVICE

RETURN - Return Parameter

Data type: BAPIRET2
Optional: Yes
Call by Reference: Yes

EXCEPTIONS details

CUSTOMIZING_INCOMPLETE -

Data type:
Optional: No
Call by Reference: Yes

RATE_ERROR -

Data type:
Optional: No
Call by Reference: Yes

USER_EXIT_EXCEPTION -

Data type:
Optional: No
Call by Reference: Yes

SWAP_INCOMPLETE -

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for FTR_REALTIME_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:
lt_return  TYPE STANDARD TABLE OF BAPIRET2, "   
lv_leadcurr  TYPE TCURL-LWAERS, "   
lv_pe_fwd_bid  TYPE VTBFHAZU-KKURS, "   
lv_customizing_incomplete  TYPE VTBFHAZU, "   
lv_follcurr  TYPE TCURL-FWAERS, "   
lv_rate_error  TYPE TCURL, "   
lv_pe_spot_bid  TYPE VTBFHAZU-KKASSA, "   
lv_basecurr  TYPE VTBFHAPO-WBASIS, "   
lv_pe_swap_bid  TYPE VTBFHAZU-KSWAP, "   
lv_user_exit_exception  TYPE VTBFHAZU, "   
lv_maturity  TYPE VTBFHAZU-DELFZ, "   
lv_pe_fwd_ask  TYPE VTBFHAZU-KKURS, "   
lv_swap_incomplete  TYPE VTBFHAZU, "   
lv_pe_spot_ask  TYPE VTBFHAZU-KKASSA, "   
lv_ratetype_bid  TYPE TCURR-KURST, "   
lv_pe_swap_ask  TYPE VTBFHAZU-KSWAP, "   
lv_ratetype_ask  TYPE TCURR-KURST, "   
lv_pe_date_rate  TYPE SY-DATUM, "   
lv_ratetype_mid  TYPE TCURR-KURST, "   
lv_pe_time_rate  TYPE SY-UZEIT, "   
lv_pi_oref_userexit  TYPE IF_EX_FTR_FX_INT_EXIT, "   
lv_mode  TYPE VTBDFMS-WORKMODUS. "   '2'

  CALL FUNCTION 'FTR_REALTIME_RATE_SERVICE'  "Supplies Realtime Exchange Rates
    EXPORTING
         LEADCURR = lv_leadcurr
         FOLLCURR = lv_follcurr
         BASECURR = lv_basecurr
         MATURITY = lv_maturity
         RATETYPE_BID = lv_ratetype_bid
         RATETYPE_ASK = lv_ratetype_ask
         RATETYPE_MID = lv_ratetype_mid
         PI_OREF_USEREXIT = lv_pi_oref_userexit
         MODE = lv_mode
    IMPORTING
         PE_FWD_BID = lv_pe_fwd_bid
         PE_SPOT_BID = lv_pe_spot_bid
         PE_SWAP_BID = lv_pe_swap_bid
         PE_FWD_ASK = lv_pe_fwd_ask
         PE_SPOT_ASK = lv_pe_spot_ask
         PE_SWAP_ASK = lv_pe_swap_ask
         PE_DATE_RATE = lv_pe_date_rate
         PE_TIME_RATE = lv_pe_time_rate
    TABLES
         RETURN = lt_return
    EXCEPTIONS
        CUSTOMIZING_INCOMPLETE = 1
        RATE_ERROR = 2
        USER_EXIT_EXCEPTION = 3
        SWAP_INCOMPLETE = 4
. " FTR_REALTIME_RATE_SERVICE




ABAP code using 7.40 inline data declarations to call FM FTR_REALTIME_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 LWAERS FROM TCURL INTO @DATA(ld_leadcurr).
 
"SELECT single KKURS FROM VTBFHAZU INTO @DATA(ld_pe_fwd_bid).
 
 
"SELECT single FWAERS FROM TCURL INTO @DATA(ld_follcurr).
 
 
"SELECT single KKASSA FROM VTBFHAZU INTO @DATA(ld_pe_spot_bid).
 
"SELECT single WBASIS FROM VTBFHAPO INTO @DATA(ld_basecurr).
 
"SELECT single KSWAP FROM VTBFHAZU INTO @DATA(ld_pe_swap_bid).
 
 
"SELECT single DELFZ FROM VTBFHAZU INTO @DATA(ld_maturity).
 
"SELECT single KKURS FROM VTBFHAZU INTO @DATA(ld_pe_fwd_ask).
 
 
"SELECT single KKASSA FROM VTBFHAZU INTO @DATA(ld_pe_spot_ask).
 
"SELECT single KURST FROM TCURR INTO @DATA(ld_ratetype_bid).
 
"SELECT single KSWAP FROM VTBFHAZU INTO @DATA(ld_pe_swap_ask).
 
"SELECT single KURST FROM TCURR INTO @DATA(ld_ratetype_ask).
 
"SELECT single DATUM FROM SY INTO @DATA(ld_pe_date_rate).
 
"SELECT single KURST FROM TCURR INTO @DATA(ld_ratetype_mid).
 
"SELECT single UZEIT FROM SY INTO @DATA(ld_pe_time_rate).
 
 
"SELECT single WORKMODUS FROM VTBDFMS INTO @DATA(ld_mode).
DATA(ld_mode) = '2'.
 


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!