02-14-2006 3:17 PM
Hello,
I have created a variant for a report and I want to set it as default. So that it is "loaded" together with the report. Anyone knows how to do this.
/Best Regards
Claes
02-14-2006 3:32 PM
CLaes - you can use FM RS_SUPPORT_SELECTIONS using the report name and variant name at the INITIALIZATION event. The report will start with the variant loaded. You can also use some logic and load with different variants if needed.
Rob
02-14-2006 3:20 PM
Hi
You should create a Z-transaction to run that report using default variant.
Max
02-14-2006 3:27 PM
Hi,
Create the transaction code for the report using SE93.
Choose the radio button 2 , i.e it is selection screen and report.
and then while filling data
Transaction text
Report
Program
Selection screen 1000
<b>Start with variant</b>
Authorization object
specify the variant, then it will start with that variant.
regards
vijay
02-14-2006 3:32 PM
CLaes - you can use FM RS_SUPPORT_SELECTIONS using the report name and variant name at the INITIALIZATION event. The report will start with the variant loaded. You can also use some logic and load with different variants if needed.
Rob
02-14-2006 3:41 PM
In practice, if all users were supposed to have their own variant set up for the program with the name of their USERID, you would:
INITIALIZATION.
DATA: h_repid LIKE rsvar-report,
h_variant LIKE rsvar-variant.
h_repid = sy-repid.
h_variant = sy-uname.
CALL FUNCTION 'RS_SUPPORT_SELECTIONS'
EXPORTING
report = h_repid
variant = h_variant
EXCEPTIONS
variant_not_existent = 01
variant_obsolete = 02.
IF sy-subrc NE 0.
CALL FUNCTION 'RS_SUPPORT_SELECTIONS'
EXPORTING
report = h_repid
variant = 'DEFAULT'
EXCEPTIONS
variant_not_existent = 01
variant_obsolete = 02.
ENDIF.
You would also set up the DEFAULT variant for users without their own one.
Rob
02-14-2006 3:48 PM
Here is a simular solution.
report zrich_0003 .
parameters: p_check type c.
initialization.
data: begin of l_rkey,
report like rsvar-report,
variant like rsvar-variant.
data: end of l_rkey.
data:
l_report like rsvar-report,
l_variant like rsvar-variant,
l_mandt type sy-mandt,
imp_subrc type sy-subrc.
l_mandt = sy-mandt.
l_report = sy-repid.
l_variant = 'TEST'. " Name of the variant goes here
l_rkey-report = l_report.
l_rkey-variant = l_variant.
perform %_import_vari_clnt in program (l_report)
using l_rkey imp_subrc l_mandt
changing imp_subrc
if found.
Regards,
Rich Heilman
10-15-2015 3:47 PM