SAP FWEV_POSITION_VALUATION_SEC Function Module for Securities Key Date Valuation
FWEV_POSITION_VALUATION_SEC is a standard fwev position valuation sec SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Securities Key Date Valuation 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 fwev position valuation sec FM, simply by entering the name FWEV_POSITION_VALUATION_SEC into the relevant SAP transaction such as SE37 or SE38.
Function Group: FWEV
Program Name: SAPLFWEV
Main Program:
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function FWEV_POSITION_VALUATION_SEC 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 'FWEV_POSITION_VALUATION_SEC'"Securities Key Date Valuation.
EXPORTING
I_BTAGWR = "Current value in position currency
* I_IGN_INCONSISTENCY = ' ' "ignorieren von Inkonsistenzen zum Stichtag
* I_BTAGHW = "Tageswert in Hauswährung
I_FLAG_KOSTEN_VOLL = "Kennzeichen: Kosten voll abschreiben
I_GES = "Position Per Key Date
I_KURSBER = "Kursberechnungsart Devise
I_NOTIERUNG = "Quotation
I_SREVAC = "Kennzeichen Amortized Cost
I_STICHTAG = "Stichtag Bewertung
I_TZRPR = "Valuation Principle
IMPORTING
E_WERT = "Stichtagswerte und Bewertungsergebnis
EXCEPTIONS
ERROR_POSITION = 1
IMPORTING Parameters details for FWEV_POSITION_VALUATION_SEC
I_BTAGWR - Current value in position currency
Data type: REVAL-BKAUFWROptional: No
Call by Reference: No ( called with pass by value option)
I_IGN_INCONSISTENCY - ignorieren von Inkonsistenzen zum Stichtag
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_BTAGHW - Tageswert in Hauswährung
Data type: REVAL-BKAUFHWOptional: Yes
Call by Reference: No ( called with pass by value option)
I_FLAG_KOSTEN_VOLL - Kennzeichen: Kosten voll abschreiben
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
I_GES - Position Per Key Date
Data type: REVALOptional: No
Call by Reference: No ( called with pass by value option)
I_KURSBER - Kursberechnungsart Devise
Data type: TZBZ-RKURSBEROptional: No
Call by Reference: No ( called with pass by value option)
I_NOTIERUNG - Quotation
Data type: VWPANLA-SNOTIOptional: No
Call by Reference: No ( called with pass by value option)
I_SREVAC - Kennzeichen Amortized Cost
Data type: TZRCL-SREVACOptional: No
Call by Reference: No ( called with pass by value option)
I_STICHTAG - Stichtag Bewertung
Data type: SY-DATUMOptional: No
Call by Reference: No ( called with pass by value option)
I_TZRPR - Valuation Principle
Data type: TZRPROptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for FWEV_POSITION_VALUATION_SEC
E_WERT - Stichtagswerte und Bewertungsergebnis
Data type: TRPM_ST_WERTOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
ERROR_POSITION - Position inconsist.
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for FWEV_POSITION_VALUATION_SEC 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_e_wert | TYPE TRPM_ST_WERT, " | |||
| lv_i_btagwr | TYPE REVAL-BKAUFWR, " | |||
| lv_error_position | TYPE REVAL, " | |||
| lv_i_ign_inconsistency | TYPE C, " SPACE | |||
| lv_i_btaghw | TYPE REVAL-BKAUFHW, " | |||
| lv_i_flag_kosten_voll | TYPE REVAL, " | |||
| lv_i_ges | TYPE REVAL, " | |||
| lv_i_kursber | TYPE TZBZ-RKURSBER, " | |||
| lv_i_notierung | TYPE VWPANLA-SNOTI, " | |||
| lv_i_srevac | TYPE TZRCL-SREVAC, " | |||
| lv_i_stichtag | TYPE SY-DATUM, " | |||
| lv_i_tzrpr | TYPE TZRPR. " |
|   CALL FUNCTION 'FWEV_POSITION_VALUATION_SEC' "Securities Key Date Valuation |
| EXPORTING | ||
| I_BTAGWR | = lv_i_btagwr | |
| I_IGN_INCONSISTENCY | = lv_i_ign_inconsistency | |
| I_BTAGHW | = lv_i_btaghw | |
| I_FLAG_KOSTEN_VOLL | = lv_i_flag_kosten_voll | |
| I_GES | = lv_i_ges | |
| I_KURSBER | = lv_i_kursber | |
| I_NOTIERUNG | = lv_i_notierung | |
| I_SREVAC | = lv_i_srevac | |
| I_STICHTAG | = lv_i_stichtag | |
| I_TZRPR | = lv_i_tzrpr | |
| IMPORTING | ||
| E_WERT | = lv_e_wert | |
| EXCEPTIONS | ||
| ERROR_POSITION = 1 | ||
| . " FWEV_POSITION_VALUATION_SEC | ||
ABAP code using 7.40 inline data declarations to call FM FWEV_POSITION_VALUATION_SEC
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 BKAUFWR FROM REVAL INTO @DATA(ld_i_btagwr). | ||||
| DATA(ld_i_ign_inconsistency) | = ' '. | |||
| "SELECT single BKAUFHW FROM REVAL INTO @DATA(ld_i_btaghw). | ||||
| "SELECT single RKURSBER FROM TZBZ INTO @DATA(ld_i_kursber). | ||||
| "SELECT single SNOTI FROM VWPANLA INTO @DATA(ld_i_notierung). | ||||
| "SELECT single SREVAC FROM TZRCL INTO @DATA(ld_i_srevac). | ||||
| "SELECT single DATUM FROM SY INTO @DATA(ld_i_stichtag). | ||||
Search for further information about these or an SAP related objects