SAP Function Modules

RM_COMPLEX_OPTION_STRIKE_CALC SAP Function module - Calculation of Strike of a Complex Option on the Horizon







RM_COMPLEX_OPTION_STRIKE_CALC 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 RM_COMPLEX_OPTION_STRIKE_CALC into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM RM_COMPLEX_OPTION_STRIKE_CALC - RM COMPLEX OPTION STRIKE CALC





CALL FUNCTION 'RM_COMPLEX_OPTION_STRIKE_CALC' "Calculation of Strike of a Complex Option on the Horizon
  EXPORTING
    i_akt_datum =               " sy-datum
    i_maturity =                " sy-datum      Date and Time, Current (Application Server) Date
    i_ul_fgcf =                 " tv0_beweg_tab
    i_meth_typ =                " tvm_meth_typ
    i_spot_in =                 " c
    i_spot_out =                " c
    i_opt_mseg =                " tv0_mseg_typ
* TABLES
*   c_error_itab =              " bapierr
  CHANGING
    c_opt_opti =                " tv0_opti_typ
    c_ul_best =                 " tv0_best_typ
  EXCEPTIONS
    NO_STRIKE_CURRENCY = 1      "
    NO_NOTTYPE = 2              "
    NO_STRIKE_CALCULATED = 3    "
    MARKET_DATA_SPOT = 4        "
    .  "  RM_COMPLEX_OPTION_STRIKE_CALC

ABAP code example for Function Module RM_COMPLEX_OPTION_STRIKE_CALC





The ABAP code below is a full code listing to execute function module RM_COMPLEX_OPTION_STRIKE_CALC 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:
it_c_error_itab  TYPE STANDARD TABLE OF BAPIERR,"TABLES PARAM
wa_c_error_itab  LIKE LINE OF it_c_error_itab .

DATA(ld_c_opt_opti) = 'Check type of data required'.
DATA(ld_c_ul_best) = 'Check type of data required'.
DATA(ld_i_akt_datum) = '20210129'.
DATA(ld_i_maturity) = '20210129'.
DATA(ld_i_ul_fgcf) = '20210129'.
DATA(ld_i_meth_typ) = '20210129'.
DATA(ld_i_spot_in) = '20210129'.
DATA(ld_i_spot_out) = '20210129'.
DATA(ld_i_opt_mseg) = '20210129'.

"populate fields of struture and append to itab
append wa_c_error_itab to it_c_error_itab. . CALL FUNCTION 'RM_COMPLEX_OPTION_STRIKE_CALC' EXPORTING i_akt_datum = ld_i_akt_datum i_maturity = ld_i_maturity i_ul_fgcf = ld_i_ul_fgcf i_meth_typ = ld_i_meth_typ i_spot_in = ld_i_spot_in i_spot_out = ld_i_spot_out i_opt_mseg = ld_i_opt_mseg * TABLES * c_error_itab = it_c_error_itab CHANGING c_opt_opti = ld_c_opt_opti c_ul_best = ld_c_ul_best EXCEPTIONS NO_STRIKE_CURRENCY = 1 NO_NOTTYPE = 2 NO_STRIKE_CALCULATED = 3 MARKET_DATA_SPOT = 4 . " RM_COMPLEX_OPTION_STRIKE_CALC
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 ELSEIF SY-SUBRC EQ 4. "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_c_opt_opti  TYPE TV0_OPTI_TYP ,
ld_i_akt_datum  TYPE SY-DATUM ,
it_c_error_itab  TYPE STANDARD TABLE OF BAPIERR ,
wa_c_error_itab  LIKE LINE OF it_c_error_itab,
ld_c_ul_best  TYPE TV0_BEST_TYP ,
ld_i_maturity  TYPE SY-DATUM ,
ld_i_ul_fgcf  TYPE TV0_BEWEG_TAB ,
ld_i_meth_typ  TYPE TVM_METH_TYP ,
ld_i_spot_in  TYPE C ,
ld_i_spot_out  TYPE C ,
ld_i_opt_mseg  TYPE TV0_MSEG_TYP .

ld_c_opt_opti = '20210129'.
ld_i_akt_datum = '20210129'.

"populate fields of struture and append to itab
append wa_c_error_itab to it_c_error_itab.
ld_c_ul_best = '20210129'.
ld_i_maturity = '20210129'.
ld_i_ul_fgcf = '20210129'.
ld_i_meth_typ = '20210129'.
ld_i_spot_in = '20210129'.
ld_i_spot_out = '20210129'.
ld_i_opt_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 RM_COMPLEX_OPTION_STRIKE_CALC or its description.