- store a variant with name U_<userid> or U_<systemid>.
- Call this function during initialization
=> the values of the variant are sent to your selection-screen automatically.
This function works up to release 4.6C.
function /ctac/variant_start.
*"----------------------------------------------------------------------
*"*"Local interface:
*" IMPORTING
*" REFERENCE(RE_SYST) TYPE SYST
*"----------------------------------------------------------------------
*
* This function checks if there are variants with a specific name and
* propose these values on selection screen
* Use this function in the INITIALIZATION event of your report
data: tp_subrc like sy-subrc.
data: tp_repid like rsvar-report.
data: tp_variant like rsvar-variant.
tp_repid = re_syst-repid.
clear tp_variant.
tp_variant = 'U_'.
write re_syst-uname to tp_variant+2.
call function 'RS_VARIANT_EXISTS'
exporting
report = tp_repid
variant = tp_variant
importing
r_c = tp_subrc
exceptions
others = 9.
if sy-subrc = 0.
if not tp_subrc is initial.
clear tp_variant.
tp_variant = 'U_'.
Requires Free Membership to View
write re_syst-sysid to tp_variant+2.
call function 'RS_VARIANT_EXISTS'
exporting
report = tp_repid
variant = tp_variant
importing
r_c = tp_subrc
exceptions
others = 9.
check sy-subrc = 0.
endif.
if tp_subrc = 0.
call function 'RS_SUPPORT_SELECTIONS'
exporting
report = tp_repid
variant = tp_variant
exceptions
variant_not_existent = 01
variant_obsolete = 02.
endif.
endif.
*
endfunction.
This was first published in October 2003

Join the conversationComment
Share
Comments
Results
Contribute to the conversation