SAP TB_EVALUATION_CURRENCYPOSITION Function Module for Treasury: Valuation of Currency Position
TB_EVALUATION_CURRENCYPOSITION is a standard tb evaluation currencyposition SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Treasury: Valuation of Currency Position 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 tb evaluation currencyposition FM, simply by entering the name TB_EVALUATION_CURRENCYPOSITION into the relevant SAP transaction such as SE37 or SE38.
Function Group: TB16
Program Name: SAPLTB16
Main Program: SAPLTB16
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function TB_EVALUATION_CURRENCYPOSITION 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 'TB_EVALUATION_CURRENCYPOSITION'"Treasury: Valuation of Currency Position.
EXPORTING
DEAL = "
STICHTAG = "
* KURSTYP = "
* BARWERTART = "NPV Type
* POPUP_VTVBAR = 'X' "Kennzeichen manuelle Werterfassung
* TITLEVAL = "Kennzeichen ob Titelbewertung durchgeführt werden soll
* FLG_FAS = "Kennzeichen Hedge Management
IMPORTING
ANSCHAFFUNGSWERT_HW = "
HAUSWAEHRUNG = "
STICHTAGSWERT_HW = "
STICHTAGSWERT_FW = "
ANSCHAFFUNGSWERT_FW = "
BESTAND_FW = "
BEWERTUNGSKURS = "
BUCHWERT_HW = "
BUCHWERT_FW = "
ERFOLG_AKTUELL = "
ERFOLG_GEBUCHT = "
FREMDWAEHRUNG = "
TABLES
BESTEHENDE_BEWEGUNGEN = "
ERZEUGTE_BEWEGUNGEN = "
* VERARBEITETE_BEWEGUNGEN = "
EXCEPTIONS
ERROR_DEAL = 1 MORE_THAN_ONE_DEAL = 2 WRONG_KEY_DATE = 3 MORE_THAN_ONE_CURRENCY = 4 NO_FLOWTYPE = 5 ERROR_FAS = 6
IMPORTING Parameters details for TB_EVALUATION_CURRENCYPOSITION
DEAL -
Data type: VTBFHAOptional: No
Call by Reference: No ( called with pass by value option)
STICHTAG -
Data type: SY-DATUMOptional: No
Call by Reference: No ( called with pass by value option)
KURSTYP -
Data type: AT10B-KTYPSKOptional: Yes
Call by Reference: No ( called with pass by value option)
BARWERTART - NPV Type
Data type: VTVBAR-OKUARTOptional: Yes
Call by Reference: No ( called with pass by value option)
POPUP_VTVBAR - Kennzeichen manuelle Werterfassung
Data type: CDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
TITLEVAL - Kennzeichen ob Titelbewertung durchgeführt werden soll
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
FLG_FAS - Kennzeichen Hedge Management
Data type: COptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for TB_EVALUATION_CURRENCYPOSITION
ANSCHAFFUNGSWERT_HW -
Data type: VTBFHAPO-BHWBETROptional: No
Call by Reference: No ( called with pass by value option)
HAUSWAEHRUNG -
Data type: TCURC-WAERSOptional: No
Call by Reference: No ( called with pass by value option)
STICHTAGSWERT_HW -
Data type: VTBFHAPO-BHWBETROptional: No
Call by Reference: No ( called with pass by value option)
STICHTAGSWERT_FW -
Data type: VTBFHAPO-BZBETROptional: No
Call by Reference: No ( called with pass by value option)
ANSCHAFFUNGSWERT_FW -
Data type: VTBFHAPO-BZBETROptional: No
Call by Reference: No ( called with pass by value option)
BESTAND_FW -
Data type: VTBFHAPO-BZBETROptional: No
Call by Reference: No ( called with pass by value option)
BEWERTUNGSKURS -
Data type: TCURR-UKURSOptional: No
Call by Reference: No ( called with pass by value option)
BUCHWERT_HW -
Data type: VTBFHAPO-BHWBETROptional: No
Call by Reference: No ( called with pass by value option)
BUCHWERT_FW -
Data type: VTBFHAPO-BZBETROptional: No
Call by Reference: No ( called with pass by value option)
ERFOLG_AKTUELL -
Data type: VTBFHAPO-BHWBETROptional: No
Call by Reference: No ( called with pass by value option)
ERFOLG_GEBUCHT -
Data type: VTBFHAPO-BHWBETROptional: No
Call by Reference: No ( called with pass by value option)
FREMDWAEHRUNG -
Data type: TCURC-WAERSOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for TB_EVALUATION_CURRENCYPOSITION
BESTEHENDE_BEWEGUNGEN -
Data type: VTBFHAPOOptional: No
Call by Reference: No ( called with pass by value option)
ERZEUGTE_BEWEGUNGEN -
Data type: VTBFHAPOOptional: No
Call by Reference: No ( called with pass by value option)
VERARBEITETE_BEWEGUNGEN -
Data type: VTBFHAPOOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
ERROR_DEAL - keine relevanten Bewegungen vorhanden
Data type:Optional: No
Call by Reference: Yes
MORE_THAN_ONE_DEAL - System Error
Data type:Optional: No
Call by Reference: Yes
WRONG_KEY_DATE - Bewertung nach Stichtag vorhanden
Data type:Optional: No
Call by Reference: Yes
MORE_THAN_ONE_CURRENCY - System Error
Data type:Optional: No
Call by Reference: Yes
NO_FLOWTYPE - keine Bewegungsart im Customizing gefunden
Data type:Optional: No
Call by Reference: Yes
ERROR_FAS - Fehler bei Hedge Management
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for TB_EVALUATION_CURRENCYPOSITION 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_deal | TYPE VTBFHA, " | |||
| lv_error_deal | TYPE VTBFHA, " | |||
| lv_anschaffungswert_hw | TYPE VTBFHAPO-BHWBETR, " | |||
| lt_bestehende_bewegungen | TYPE STANDARD TABLE OF VTBFHAPO, " | |||
| lv_hauswaehrung | TYPE TCURC-WAERS, " | |||
| lv_stichtagswert_hw | TYPE VTBFHAPO-BHWBETR, " | |||
| lv_stichtagswert_fw | TYPE VTBFHAPO-BZBETR, " | |||
| lv_stichtag | TYPE SY-DATUM, " | |||
| lv_more_than_one_deal | TYPE SY, " | |||
| lv_anschaffungswert_fw | TYPE VTBFHAPO-BZBETR, " | |||
| lt_erzeugte_bewegungen | TYPE STANDARD TABLE OF VTBFHAPO, " | |||
| lv_kurstyp | TYPE AT10B-KTYPSK, " | |||
| lv_bestand_fw | TYPE VTBFHAPO-BZBETR, " | |||
| lv_wrong_key_date | TYPE VTBFHAPO, " | |||
| lt_verarbeitete_bewegungen | TYPE STANDARD TABLE OF VTBFHAPO, " | |||
| lv_barwertart | TYPE VTVBAR-OKUART, " | |||
| lv_bewertungskurs | TYPE TCURR-UKURS, " | |||
| lv_more_than_one_currency | TYPE TCURR, " | |||
| lv_buchwert_hw | TYPE VTBFHAPO-BHWBETR, " | |||
| lv_no_flowtype | TYPE VTBFHAPO, " | |||
| lv_popup_vtvbar | TYPE C, " 'X' | |||
| lv_titleval | TYPE C, " | |||
| lv_error_fas | TYPE C, " | |||
| lv_buchwert_fw | TYPE VTBFHAPO-BZBETR, " | |||
| lv_flg_fas | TYPE C, " | |||
| lv_erfolg_aktuell | TYPE VTBFHAPO-BHWBETR, " | |||
| lv_erfolg_gebucht | TYPE VTBFHAPO-BHWBETR, " | |||
| lv_fremdwaehrung | TYPE TCURC-WAERS. " |
|   CALL FUNCTION 'TB_EVALUATION_CURRENCYPOSITION' "Treasury: Valuation of Currency Position |
| EXPORTING | ||
| DEAL | = lv_deal | |
| STICHTAG | = lv_stichtag | |
| KURSTYP | = lv_kurstyp | |
| BARWERTART | = lv_barwertart | |
| POPUP_VTVBAR | = lv_popup_vtvbar | |
| TITLEVAL | = lv_titleval | |
| FLG_FAS | = lv_flg_fas | |
| IMPORTING | ||
| ANSCHAFFUNGSWERT_HW | = lv_anschaffungswert_hw | |
| HAUSWAEHRUNG | = lv_hauswaehrung | |
| STICHTAGSWERT_HW | = lv_stichtagswert_hw | |
| STICHTAGSWERT_FW | = lv_stichtagswert_fw | |
| ANSCHAFFUNGSWERT_FW | = lv_anschaffungswert_fw | |
| BESTAND_FW | = lv_bestand_fw | |
| BEWERTUNGSKURS | = lv_bewertungskurs | |
| BUCHWERT_HW | = lv_buchwert_hw | |
| BUCHWERT_FW | = lv_buchwert_fw | |
| ERFOLG_AKTUELL | = lv_erfolg_aktuell | |
| ERFOLG_GEBUCHT | = lv_erfolg_gebucht | |
| FREMDWAEHRUNG | = lv_fremdwaehrung | |
| TABLES | ||
| BESTEHENDE_BEWEGUNGEN | = lt_bestehende_bewegungen | |
| ERZEUGTE_BEWEGUNGEN | = lt_erzeugte_bewegungen | |
| VERARBEITETE_BEWEGUNGEN | = lt_verarbeitete_bewegungen | |
| EXCEPTIONS | ||
| ERROR_DEAL = 1 | ||
| MORE_THAN_ONE_DEAL = 2 | ||
| WRONG_KEY_DATE = 3 | ||
| MORE_THAN_ONE_CURRENCY = 4 | ||
| NO_FLOWTYPE = 5 | ||
| ERROR_FAS = 6 | ||
| . " TB_EVALUATION_CURRENCYPOSITION | ||
ABAP code using 7.40 inline data declarations to call FM TB_EVALUATION_CURRENCYPOSITION
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 BHWBETR FROM VTBFHAPO INTO @DATA(ld_anschaffungswert_hw). | ||||
| "SELECT single WAERS FROM TCURC INTO @DATA(ld_hauswaehrung). | ||||
| "SELECT single BHWBETR FROM VTBFHAPO INTO @DATA(ld_stichtagswert_hw). | ||||
| "SELECT single BZBETR FROM VTBFHAPO INTO @DATA(ld_stichtagswert_fw). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_stichtag). | ||||
| "SELECT single BZBETR FROM VTBFHAPO INTO @DATA(ld_anschaffungswert_fw). | ||||
| "SELECT single KTYPSK FROM AT10B INTO @DATA(ld_kurstyp). | ||||
| "SELECT single BZBETR FROM VTBFHAPO INTO @DATA(ld_bestand_fw). | ||||
| "SELECT single OKUART FROM VTVBAR INTO @DATA(ld_barwertart). | ||||
| "SELECT single UKURS FROM TCURR INTO @DATA(ld_bewertungskurs). | ||||
| "SELECT single BHWBETR FROM VTBFHAPO INTO @DATA(ld_buchwert_hw). | ||||
| DATA(ld_popup_vtvbar) | = 'X'. | |||
| "SELECT single BZBETR FROM VTBFHAPO INTO @DATA(ld_buchwert_fw). | ||||
| "SELECT single BHWBETR FROM VTBFHAPO INTO @DATA(ld_erfolg_aktuell). | ||||
| "SELECT single BHWBETR FROM VTBFHAPO INTO @DATA(ld_erfolg_gebucht). | ||||
| "SELECT single WAERS FROM TCURC INTO @DATA(ld_fremdwaehrung). | ||||
Search for further information about these or an SAP related objects