SAP FOREX_SPOTVALUE_CALCULATE Function Module for Calculate Spot Value Date for Foreign Exchange Transactions
FOREX_SPOTVALUE_CALCULATE is a standard forex spotvalue calculate SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Calculate Spot Value Date for Foreign Exchange Transactions 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 forex spotvalue calculate FM, simply by entering the name FOREX_SPOTVALUE_CALCULATE into the relevant SAP transaction such as SE37 or SE38.
Function Group: TB01_ADDON
Program Name: SAPLTB01_ADDON
Main Program: SAPLTB01_ADDON
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function FOREX_SPOTVALUE_CALCULATE 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 'FOREX_SPOTVALUE_CALCULATE'"Calculate Spot Value Date for Foreign Exchange Transactions.
EXPORTING
* WAERS1 = "Currency 1
* WAERS2 = "Currency 2
* SKALID1 = "Calendar ID currency 1
* SKALID2 = "Calendar ID currency 2
DEALDATE = "Trading day
* DIRECTION = '+' "
* STEP = "No. of working days between contract date and spot date
* NO_MESSAGE = "Boolean Variable
IMPORTING
SPOT_VALUEDATE = "Spot value date
EXCEPTIONS
DATE_INVALID = 1 DATE_BEFORE_RANGE = 2 DATE_AFTER_RANGE = 3 FACTORY_CALENDAR_NOT_FOUND = 4
IMPORTING Parameters details for FOREX_SPOTVALUE_CALCULATE
WAERS1 - Currency 1
Data type: TB_WGSCHF1Optional: Yes
Call by Reference: No ( called with pass by value option)
WAERS2 - Currency 2
Data type: TB_WGSCHF2Optional: Yes
Call by Reference: No ( called with pass by value option)
SKALID1 - Calendar ID currency 1
Data type: SKALIDOptional: Yes
Call by Reference: No ( called with pass by value option)
SKALID2 - Calendar ID currency 2
Data type: SKALIDOptional: Yes
Call by Reference: No ( called with pass by value option)
DEALDATE - Trading day
Data type: TB_DVTRABOptional: No
Call by Reference: No ( called with pass by value option)
DIRECTION -
Data type:Default: '+'
Optional: Yes
Call by Reference: No ( called with pass by value option)
STEP - No. of working days between contract date and spot date
Data type: SPOTDAYSOptional: Yes
Call by Reference: No ( called with pass by value option)
NO_MESSAGE - Boolean Variable
Data type:Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for FOREX_SPOTVALUE_CALCULATE
SPOT_VALUEDATE - Spot value date
Data type: TB_DZTERMOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
DATE_INVALID - Date Invalid
Data type:Optional: No
Call by Reference: Yes
DATE_BEFORE_RANGE - Date Before Range
Data type:Optional: No
Call by Reference: Yes
DATE_AFTER_RANGE - Date After Range
Data type:Optional: No
Call by Reference: Yes
FACTORY_CALENDAR_NOT_FOUND - Factory Calender Not Found
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for FOREX_SPOTVALUE_CALCULATE 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_waers1 | TYPE TB_WGSCHF1, " | |||
| lv_date_invalid | TYPE TB_WGSCHF1, " | |||
| lv_spot_valuedate | TYPE TB_DZTERM, " | |||
| lv_waers2 | TYPE TB_WGSCHF2, " | |||
| lv_date_before_range | TYPE TB_WGSCHF2, " | |||
| lv_skalid1 | TYPE SKALID, " | |||
| lv_date_after_range | TYPE SKALID, " | |||
| lv_skalid2 | TYPE SKALID, " | |||
| lv_factory_calendar_not_found | TYPE SKALID, " | |||
| lv_dealdate | TYPE TB_DVTRAB, " | |||
| lv_direction | TYPE TB_DVTRAB, " '+' | |||
| lv_step | TYPE SPOTDAYS, " | |||
| lv_no_message | TYPE SPOTDAYS. " |
|   CALL FUNCTION 'FOREX_SPOTVALUE_CALCULATE' "Calculate Spot Value Date for Foreign Exchange Transactions |
| EXPORTING | ||
| WAERS1 | = lv_waers1 | |
| WAERS2 | = lv_waers2 | |
| SKALID1 | = lv_skalid1 | |
| SKALID2 | = lv_skalid2 | |
| DEALDATE | = lv_dealdate | |
| DIRECTION | = lv_direction | |
| STEP | = lv_step | |
| NO_MESSAGE | = lv_no_message | |
| IMPORTING | ||
| SPOT_VALUEDATE | = lv_spot_valuedate | |
| EXCEPTIONS | ||
| DATE_INVALID = 1 | ||
| DATE_BEFORE_RANGE = 2 | ||
| DATE_AFTER_RANGE = 3 | ||
| FACTORY_CALENDAR_NOT_FOUND = 4 | ||
| . " FOREX_SPOTVALUE_CALCULATE | ||
ABAP code using 7.40 inline data declarations to call FM FOREX_SPOTVALUE_CALCULATE
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_direction) | = '+'. | |||
Search for further information about these or an SAP related objects