SAP Function Modules

RREX_VARIABLE_EXIT SAP Function module - SAP Exit for Variables







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

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


Pattern for FM RREX_VARIABLE_EXIT - RREX VARIABLE EXIT





CALL FUNCTION 'RREX_VARIABLE_EXIT' "SAP Exit for Variables
  EXPORTING
    i_vnam =                    " rszglobv-vnam  Name (ID) of a Report Variable
    i_vartyp =                  " rszglobv-vartyp  Type of a Report Variable
    i_vparsel =                 " rszglobv-vparsel  Parameter selection: Single value, interval, selection opt.
    i_iobjnm =                  " rszglobv-iobjnm  InfoObject
    i_s_cob_pro =               " rsd_s_cob_pro
    i_s_rkb1d =                 " rsr_s_rkb1d
    i_s_rkb1f =                 " rro01_s_rkb1f
    i_thx_var =                 " rro01_thx_var
*   i_step =                    " i
  IMPORTING
    e_t_range =                 " rsr_t_rangesid
    e_meeht =                   " rszglobv-meeht  Unit key
    e_mefac =                   " rszglobv-mefac  Quantity exponent
    e_waers =                   " rszglobv-waers  Currency Key
    e_whfac =                   " rszglobv-whfac  Currency exponent
    e_no_screen =               " rs_bool       Set variable to invisible on variable screen
    e_check_again =             " rs_bool       Process again in exit step 2
  EXCEPTIONS
    UNKNOWN_VARIABLE = 1        "
    UNEXPECTED_VARTYPE = 2      "
    INVALID_PERIV = 3           "
    NO_REPLACEMENT = 4          "
    .  "  RREX_VARIABLE_EXIT

ABAP code example for Function Module RREX_VARIABLE_EXIT





The ABAP code below is a full code listing to execute function module RREX_VARIABLE_EXIT 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_e_t_range  TYPE RSR_T_RANGESID ,
ld_e_meeht  TYPE RSZGLOBV-MEEHT ,
ld_e_mefac  TYPE RSZGLOBV-MEFAC ,
ld_e_waers  TYPE RSZGLOBV-WAERS ,
ld_e_whfac  TYPE RSZGLOBV-WHFAC ,
ld_e_no_screen  TYPE RS_BOOL ,
ld_e_check_again  TYPE RS_BOOL .


SELECT single VNAM
FROM RSZGLOBV
INTO @DATA(ld_i_vnam).


SELECT single VARTYP
FROM RSZGLOBV
INTO @DATA(ld_i_vartyp).


SELECT single VPARSEL
FROM RSZGLOBV
INTO @DATA(ld_i_vparsel).


SELECT single IOBJNM
FROM RSZGLOBV
INTO @DATA(ld_i_iobjnm).

DATA(ld_i_s_cob_pro) = 'Check type of data required'.
DATA(ld_i_s_rkb1d) = 'Check type of data required'.
DATA(ld_i_s_rkb1f) = 'Check type of data required'.
DATA(ld_i_thx_var) = 'Check type of data required'.
DATA(ld_i_step) = 'Check type of data required'. . CALL FUNCTION 'RREX_VARIABLE_EXIT' EXPORTING i_vnam = ld_i_vnam i_vartyp = ld_i_vartyp i_vparsel = ld_i_vparsel i_iobjnm = ld_i_iobjnm i_s_cob_pro = ld_i_s_cob_pro i_s_rkb1d = ld_i_s_rkb1d i_s_rkb1f = ld_i_s_rkb1f i_thx_var = ld_i_thx_var * i_step = ld_i_step IMPORTING e_t_range = ld_e_t_range e_meeht = ld_e_meeht e_mefac = ld_e_mefac e_waers = ld_e_waers e_whfac = ld_e_whfac e_no_screen = ld_e_no_screen e_check_again = ld_e_check_again EXCEPTIONS UNKNOWN_VARIABLE = 1 UNEXPECTED_VARTYPE = 2 INVALID_PERIV = 3 NO_REPLACEMENT = 4 . " RREX_VARIABLE_EXIT
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_e_t_range  TYPE RSR_T_RANGESID ,
ld_i_vnam  TYPE RSZGLOBV-VNAM ,
ld_e_meeht  TYPE RSZGLOBV-MEEHT ,
ld_i_vartyp  TYPE RSZGLOBV-VARTYP ,
ld_e_mefac  TYPE RSZGLOBV-MEFAC ,
ld_i_vparsel  TYPE RSZGLOBV-VPARSEL ,
ld_e_waers  TYPE RSZGLOBV-WAERS ,
ld_i_iobjnm  TYPE RSZGLOBV-IOBJNM ,
ld_e_whfac  TYPE RSZGLOBV-WHFAC ,
ld_i_s_cob_pro  TYPE RSD_S_COB_PRO ,
ld_e_no_screen  TYPE RS_BOOL ,
ld_i_s_rkb1d  TYPE RSR_S_RKB1D ,
ld_e_check_again  TYPE RS_BOOL ,
ld_i_s_rkb1f  TYPE RRO01_S_RKB1F ,
ld_i_thx_var  TYPE RRO01_THX_VAR ,
ld_i_step  TYPE I .


SELECT single VNAM
FROM RSZGLOBV
INTO ld_i_vnam.


SELECT single VARTYP
FROM RSZGLOBV
INTO ld_i_vartyp.


SELECT single VPARSEL
FROM RSZGLOBV
INTO ld_i_vparsel.


SELECT single IOBJNM
FROM RSZGLOBV
INTO ld_i_iobjnm.

ld_i_s_cob_pro = 'Check type of data required'.
ld_i_s_rkb1d = 'Check type of data required'.
ld_i_s_rkb1f = 'Check type of data required'.
ld_i_thx_var = 'Check type of data required'.
ld_i_step = 'Check type of data required'.

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 RREX_VARIABLE_EXIT or its description.