SAP DEVISEN_TERMINKURS Function Module for Berechnung des Terminkurses einer Devise
DEVISEN_TERMINKURS is a standard devisen terminkurs SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Berechnung des Terminkurses einer Devise 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 devisen terminkurs FM, simply by entering the name DEVISEN_TERMINKURS into the relevant SAP transaction such as SE37 or SE38.
Function Group: TVBA
Program Name: SAPLTVBA
Main Program: SAPLTVBA
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function DEVISEN_TERMINKURS 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 'DEVISEN_TERMINKURS'"Berechnung des Terminkurses einer Devise.
EXPORTING
* ONE_YEAR = 1 "Definition eines Jahres nach Zinsmethode
TK_DAYS_YEAR = "Anzahl von Tagen in Jahren (0.5->180 Tage)
* TK_DOMESTIC_RATE = 5 "Zins 2. Währung (Inland)
* TK_FOREIGN_RATE = 5 "Zins 1. Währung (Ausland)
* TK_PV_FACTOR_D = 1 "Abzinsungsfaktor 2. Währung (Inland)
* TK_PV_FACTOR_F = 1 "Abzinsungsfaktor 1. Währung (Ausland)
TK_SPOT = "Kassekurs
* TK_SPOT_FLT = "
* TK_ZINS_ABZINS = 0 "Berechnung auf Basis: 0=Zinsen, 1=Abzinsfakt.
IMPORTING
TK_FORWARD_RATE = "Terminkurs
TK_FWD_RATE_FLT = "
EXCEPTIONS
ZERO_NEG_DAYS_YEAR = 1 ZERO_NEG_SPOT = 2 ZERO_PV_FACTOR = 3
IMPORTING Parameters details for DEVISEN_TERMINKURS
ONE_YEAR - Definition eines Jahres nach Zinsmethode
Data type:Default: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)
TK_DAYS_YEAR - Anzahl von Tagen in Jahren (0.5->180 Tage)
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TK_DOMESTIC_RATE - Zins 2. Währung (Inland)
Data type: JBRBEWEG-PKONDDefault: 5
Optional: Yes
Call by Reference: No ( called with pass by value option)
TK_FOREIGN_RATE - Zins 1. Währung (Ausland)
Data type: JBRBEWEG-PKONDDefault: 5
Optional: Yes
Call by Reference: No ( called with pass by value option)
TK_PV_FACTOR_D - Abzinsungsfaktor 2. Währung (Inland)
Data type:Default: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)
TK_PV_FACTOR_F - Abzinsungsfaktor 1. Währung (Ausland)
Data type:Default: 1
Optional: Yes
Call by Reference: No ( called with pass by value option)
TK_SPOT - Kassekurs
Data type: KALKU-KURSGEOptional: No
Call by Reference: No ( called with pass by value option)
TK_SPOT_FLT -
Data type: FOptional: Yes
Call by Reference: Yes
TK_ZINS_ABZINS - Berechnung auf Basis: 0=Zinsen, 1=Abzinsfakt.
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for DEVISEN_TERMINKURS
TK_FORWARD_RATE - Terminkurs
Data type: KALKU-KURSGEOptional: No
Call by Reference: No ( called with pass by value option)
TK_FWD_RATE_FLT -
Data type: FOptional: No
Call by Reference: Yes
EXCEPTIONS details
ZERO_NEG_DAYS_YEAR - Laufzeit <= 0
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ZERO_NEG_SPOT - Kassekurs <= 0
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ZERO_PV_FACTOR - Abzinsungsfaktor = 0
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for DEVISEN_TERMINKURS 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_one_year | TYPE STRING, " 1 | |||
| lv_tk_forward_rate | TYPE KALKU-KURSGE, " | |||
| lv_zero_neg_days_year | TYPE KALKU, " | |||
| lv_tk_days_year | TYPE KALKU, " | |||
| lv_zero_neg_spot | TYPE KALKU, " | |||
| lv_tk_fwd_rate_flt | TYPE F, " | |||
| lv_zero_pv_factor | TYPE F, " | |||
| lv_tk_domestic_rate | TYPE JBRBEWEG-PKOND, " 5 | |||
| lv_tk_foreign_rate | TYPE JBRBEWEG-PKOND, " 5 | |||
| lv_tk_pv_factor_d | TYPE JBRBEWEG, " 1 | |||
| lv_tk_pv_factor_f | TYPE JBRBEWEG, " 1 | |||
| lv_tk_spot | TYPE KALKU-KURSGE, " | |||
| lv_tk_spot_flt | TYPE F, " | |||
| lv_tk_zins_abzins | TYPE F. " 0 |
|   CALL FUNCTION 'DEVISEN_TERMINKURS' "Berechnung des Terminkurses einer Devise |
| EXPORTING | ||
| ONE_YEAR | = lv_one_year | |
| TK_DAYS_YEAR | = lv_tk_days_year | |
| TK_DOMESTIC_RATE | = lv_tk_domestic_rate | |
| TK_FOREIGN_RATE | = lv_tk_foreign_rate | |
| TK_PV_FACTOR_D | = lv_tk_pv_factor_d | |
| TK_PV_FACTOR_F | = lv_tk_pv_factor_f | |
| TK_SPOT | = lv_tk_spot | |
| TK_SPOT_FLT | = lv_tk_spot_flt | |
| TK_ZINS_ABZINS | = lv_tk_zins_abzins | |
| IMPORTING | ||
| TK_FORWARD_RATE | = lv_tk_forward_rate | |
| TK_FWD_RATE_FLT | = lv_tk_fwd_rate_flt | |
| EXCEPTIONS | ||
| ZERO_NEG_DAYS_YEAR = 1 | ||
| ZERO_NEG_SPOT = 2 | ||
| ZERO_PV_FACTOR = 3 | ||
| . " DEVISEN_TERMINKURS | ||
ABAP code using 7.40 inline data declarations to call FM DEVISEN_TERMINKURS
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.| DATA(ld_one_year) | = 1. | |||
| "SELECT single KURSGE FROM KALKU INTO @DATA(ld_tk_forward_rate). | ||||
| "SELECT single PKOND FROM JBRBEWEG INTO @DATA(ld_tk_domestic_rate). | ||||
| DATA(ld_tk_domestic_rate) | = 5. | |||
| "SELECT single PKOND FROM JBRBEWEG INTO @DATA(ld_tk_foreign_rate). | ||||
| DATA(ld_tk_foreign_rate) | = 5. | |||
| DATA(ld_tk_pv_factor_d) | = 1. | |||
| DATA(ld_tk_pv_factor_f) | = 1. | |||
| "SELECT single KURSGE FROM KALKU INTO @DATA(ld_tk_spot). | ||||
Search for further information about these or an SAP related objects