SAP Function Modules

RS_VARIANT_CONTENTS_RFC SAP Function module







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

Associated Function Group: SVAR_RFC
Released Date: Not Released
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM RS_VARIANT_CONTENTS_RFC - RS VARIANT CONTENTS RFC





CALL FUNCTION 'RS_VARIANT_CONTENTS_RFC' "
  EXPORTING
    report =                    " rsvar-report  Report Name
    variant =                   " rsvar-variant  Variant Name
*   move_or_write = 'W'         " rsvar-flag1
*   execute_direct = SPACE      " rsvar-flag1
  IMPORTING
    return =                    " bapiret2      Return Code
  TABLES
*   l_params =                  " vanz
*   l_params_nonv =             " vanz
*   l_selop =                   " vanz
*   l_selop_nonv =              " vanz
    valutab =                   " rsparams
*   valutabl =                  " rsparamsl
*   objects =                   " vanz
*   free_selections_desc =      " rsdynbrepi
*   free_selections_value =     " rsseldyn
  EXCEPTIONS
    VARIANT_NON_EXISTENT = 1    "
    VARIANT_OBSOLETE = 2        "               Report does not exist
    .  "  RS_VARIANT_CONTENTS_RFC

ABAP code example for Function Module RS_VARIANT_CONTENTS_RFC





The ABAP code below is a full code listing to execute function module RS_VARIANT_CONTENTS_RFC 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_return  TYPE BAPIRET2 ,
it_l_params  TYPE STANDARD TABLE OF VANZ,"TABLES PARAM
wa_l_params  LIKE LINE OF it_l_params ,
it_l_params_nonv  TYPE STANDARD TABLE OF VANZ,"TABLES PARAM
wa_l_params_nonv  LIKE LINE OF it_l_params_nonv ,
it_l_selop  TYPE STANDARD TABLE OF VANZ,"TABLES PARAM
wa_l_selop  LIKE LINE OF it_l_selop ,
it_l_selop_nonv  TYPE STANDARD TABLE OF VANZ,"TABLES PARAM
wa_l_selop_nonv  LIKE LINE OF it_l_selop_nonv ,
it_valutab  TYPE STANDARD TABLE OF RSPARAMS,"TABLES PARAM
wa_valutab  LIKE LINE OF it_valutab ,
it_valutabl  TYPE STANDARD TABLE OF RSPARAMSL,"TABLES PARAM
wa_valutabl  LIKE LINE OF it_valutabl ,
it_objects  TYPE STANDARD TABLE OF VANZ,"TABLES PARAM
wa_objects  LIKE LINE OF it_objects ,
it_free_selections_desc  TYPE STANDARD TABLE OF RSDYNBREPI,"TABLES PARAM
wa_free_selections_desc  LIKE LINE OF it_free_selections_desc ,
it_free_selections_value  TYPE STANDARD TABLE OF RSSELDYN,"TABLES PARAM
wa_free_selections_value  LIKE LINE OF it_free_selections_value .


DATA(ld_report) = some text here

DATA(ld_variant) = some text here

DATA(ld_move_or_write) = some text here

DATA(ld_execute_direct) = some text here

"populate fields of struture and append to itab
append wa_l_params to it_l_params.

"populate fields of struture and append to itab
append wa_l_params_nonv to it_l_params_nonv.

"populate fields of struture and append to itab
append wa_l_selop to it_l_selop.

"populate fields of struture and append to itab
append wa_l_selop_nonv to it_l_selop_nonv.

"populate fields of struture and append to itab
append wa_valutab to it_valutab.

"populate fields of struture and append to itab
append wa_valutabl to it_valutabl.

"populate fields of struture and append to itab
append wa_objects to it_objects.

"populate fields of struture and append to itab
append wa_free_selections_desc to it_free_selections_desc.

"populate fields of struture and append to itab
append wa_free_selections_value to it_free_selections_value. . CALL FUNCTION 'RS_VARIANT_CONTENTS_RFC' EXPORTING report = ld_report variant = ld_variant * move_or_write = ld_move_or_write * execute_direct = ld_execute_direct IMPORTING return = ld_return TABLES * l_params = it_l_params * l_params_nonv = it_l_params_nonv * l_selop = it_l_selop * l_selop_nonv = it_l_selop_nonv valutab = it_valutab * valutabl = it_valutabl * objects = it_objects * free_selections_desc = it_free_selections_desc * free_selections_value = it_free_selections_value EXCEPTIONS VARIANT_NON_EXISTENT = 1 VARIANT_OBSOLETE = 2 . " RS_VARIANT_CONTENTS_RFC
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 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_return  TYPE BAPIRET2 ,
ld_report  TYPE RSVAR-REPORT ,
it_l_params  TYPE STANDARD TABLE OF VANZ ,
wa_l_params  LIKE LINE OF it_l_params,
ld_variant  TYPE RSVAR-VARIANT ,
it_l_params_nonv  TYPE STANDARD TABLE OF VANZ ,
wa_l_params_nonv  LIKE LINE OF it_l_params_nonv,
ld_move_or_write  TYPE RSVAR-FLAG1 ,
it_l_selop  TYPE STANDARD TABLE OF VANZ ,
wa_l_selop  LIKE LINE OF it_l_selop,
ld_execute_direct  TYPE RSVAR-FLAG1 ,
it_l_selop_nonv  TYPE STANDARD TABLE OF VANZ ,
wa_l_selop_nonv  LIKE LINE OF it_l_selop_nonv,
it_valutab  TYPE STANDARD TABLE OF RSPARAMS ,
wa_valutab  LIKE LINE OF it_valutab,
it_valutabl  TYPE STANDARD TABLE OF RSPARAMSL ,
wa_valutabl  LIKE LINE OF it_valutabl,
it_objects  TYPE STANDARD TABLE OF VANZ ,
wa_objects  LIKE LINE OF it_objects,
it_free_selections_desc  TYPE STANDARD TABLE OF RSDYNBREPI ,
wa_free_selections_desc  LIKE LINE OF it_free_selections_desc,
it_free_selections_value  TYPE STANDARD TABLE OF RSSELDYN ,
wa_free_selections_value  LIKE LINE OF it_free_selections_value.


ld_report = some text here

"populate fields of struture and append to itab
append wa_l_params to it_l_params.

ld_variant = some text here

"populate fields of struture and append to itab
append wa_l_params_nonv to it_l_params_nonv.

ld_move_or_write = some text here

"populate fields of struture and append to itab
append wa_l_selop to it_l_selop.

ld_execute_direct = some text here

"populate fields of struture and append to itab
append wa_l_selop_nonv to it_l_selop_nonv.

"populate fields of struture and append to itab
append wa_valutab to it_valutab.

"populate fields of struture and append to itab
append wa_valutabl to it_valutabl.

"populate fields of struture and append to itab
append wa_objects to it_objects.

"populate fields of struture and append to itab
append wa_free_selections_desc to it_free_selections_desc.

"populate fields of struture and append to itab
append wa_free_selections_value to it_free_selections_value.

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