SAP Function Modules

FX_TERMIN_SCHNITTKURS SAP Function module - Schnittkurs eines Devisentermingeschäftes zu einem gegebenen Zeitpunkt







FX_TERMIN_SCHNITTKURS is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name FX_TERMIN_SCHNITTKURS into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: TVBA
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM FX_TERMIN_SCHNITTKURS - FX TERMIN SCHNITTKURS





CALL FUNCTION 'FX_TERMIN_SCHNITTKURS' "Schnittkurs eines Devisentermingeschäftes zu einem gegebenen Zeitpunkt
  EXPORTING
    abzins1 =                   "               Abzinsungsfaktor für Währung 1
    abzins2 =                   "               Abzinsungsfaktor für Währung 2
*   igkm1 =                     " jbd11-igkm
*   igkm2 =                     " jbd11-igkm
*   ifr1 =                      " jbd11-ifr
*   ifr2 =                      " jbd11-ifr
*   akt_datum = SY-DATUM        " sy-datum      aktuelles Datum
*   ausw_datum = SY-DATUM       " sy-datum      Datum, zu dem der Schnitttkurs berechnet wird
    spot =                      "               Kassakurs am Auswertungsdatum
    termin_stammdat =           " jbrbest       Stammdaten des Termingeschäftes
*   i_mseg =                    " jbrmseg
  IMPORTING
    termin_schnittkurs =        "               Schnittkurs als Betrag für AUSW_DATUM
    termin_waers =              " vtvmethod-waers  Währung des Schnittkurses
  TABLES
    termin_dat =                " jbrbeweg      Bewegungsdaten des Termingeschäftes
    exposure_tab =              " vtvcashfl
  EXCEPTIONS
    ERROR_CALCULATE_CURRENCY = 1  "             Fehler bei Umrechnung Hauswährung -> Ges.währung
    NO_TERMINDATA = 2           "               keine Stammdaten des Termingeschäftes
    PV_FACTOR_EQ_ZERO = 3       "               Abzinsungfaktor ist 0
    .  "  FX_TERMIN_SCHNITTKURS

ABAP code example for Function Module FX_TERMIN_SCHNITTKURS





The ABAP code below is a full code listing to execute function module FX_TERMIN_SCHNITTKURS including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_termin_schnittkurs  TYPE STRING ,
ld_termin_waers  TYPE VTVMETHOD-WAERS ,
it_termin_dat  TYPE STANDARD TABLE OF JBRBEWEG,"TABLES PARAM
wa_termin_dat  LIKE LINE OF it_termin_dat ,
it_exposure_tab  TYPE STANDARD TABLE OF VTVCASHFL,"TABLES PARAM
wa_exposure_tab  LIKE LINE OF it_exposure_tab .

DATA(ld_abzins1) = 'some text here'.
DATA(ld_abzins2) = 'some text here'.

SELECT single IGKM
FROM JBD11
INTO @DATA(ld_igkm1).


SELECT single IGKM
FROM JBD11
INTO @DATA(ld_igkm2).


SELECT single IFR
FROM JBD11
INTO @DATA(ld_ifr1).


SELECT single IFR
FROM JBD11
INTO @DATA(ld_ifr2).

DATA(ld_akt_datum) = '20210129'.
DATA(ld_ausw_datum) = '20210129'.
DATA(ld_spot) = 'some text here'.
DATA(ld_termin_stammdat) = '20210129'.
DATA(ld_i_mseg) = '20210129'.

"populate fields of struture and append to itab
append wa_termin_dat to it_termin_dat.

"populate fields of struture and append to itab
append wa_exposure_tab to it_exposure_tab. . CALL FUNCTION 'FX_TERMIN_SCHNITTKURS' EXPORTING abzins1 = ld_abzins1 abzins2 = ld_abzins2 * igkm1 = ld_igkm1 * igkm2 = ld_igkm2 * ifr1 = ld_ifr1 * ifr2 = ld_ifr2 * akt_datum = ld_akt_datum * ausw_datum = ld_ausw_datum spot = ld_spot termin_stammdat = ld_termin_stammdat * i_mseg = ld_i_mseg IMPORTING termin_schnittkurs = ld_termin_schnittkurs termin_waers = ld_termin_waers TABLES termin_dat = it_termin_dat exposure_tab = it_exposure_tab EXCEPTIONS ERROR_CALCULATE_CURRENCY = 1 NO_TERMINDATA = 2 PV_FACTOR_EQ_ZERO = 3 . " FX_TERMIN_SCHNITTKURS
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_termin_schnittkurs  TYPE STRING ,
ld_abzins1  TYPE STRING ,
it_termin_dat  TYPE STANDARD TABLE OF JBRBEWEG ,
wa_termin_dat  LIKE LINE OF it_termin_dat,
ld_termin_waers  TYPE VTVMETHOD-WAERS ,
ld_abzins2  TYPE STRING ,
it_exposure_tab  TYPE STANDARD TABLE OF VTVCASHFL ,
wa_exposure_tab  LIKE LINE OF it_exposure_tab,
ld_igkm1  TYPE JBD11-IGKM ,
ld_igkm2  TYPE JBD11-IGKM ,
ld_ifr1  TYPE JBD11-IFR ,
ld_ifr2  TYPE JBD11-IFR ,
ld_akt_datum  TYPE SY-DATUM ,
ld_ausw_datum  TYPE SY-DATUM ,
ld_spot  TYPE STRING ,
ld_termin_stammdat  TYPE JBRBEST ,
ld_i_mseg  TYPE JBRMSEG .

ld_abzins1 = 'some text here'.

"populate fields of struture and append to itab
append wa_termin_dat to it_termin_dat.
ld_abzins2 = 'some text here'.

"populate fields of struture and append to itab
append wa_exposure_tab to it_exposure_tab.

SELECT single IGKM
FROM JBD11
INTO ld_igkm1.


SELECT single IGKM
FROM JBD11
INTO ld_igkm2.


SELECT single IFR
FROM JBD11
INTO ld_ifr1.


SELECT single IFR
FROM JBD11
INTO ld_ifr2.

ld_akt_datum = '20210129'.
ld_ausw_datum = '20210129'.
ld_spot = 'some text here'.
ld_termin_stammdat = '20210129'.
ld_i_mseg = '20210129'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name FX_TERMIN_SCHNITTKURS or its description.