05-20-2011 8:45 AM
Hi,
I would like to create a standard variant for running ABAP report so that users don't have to select the variant each time.
I know we can specify the variant name as a standard variant on changing query by SQ01 but is there any way to give the function in ABAP report?
Does anybody know how to code or set up to do that?
Thank you very much in advance.
Best regards,
Miki
Edited by: Miki Komatsu on May 20, 2011 9:46 AM
05-20-2011 8:59 AM
When yo create a transaction for a report you can set a default variant.
05-20-2011 8:59 AM
When yo create a transaction for a report you can set a default variant.
05-20-2011 9:03 AM
Hi j.ortiz
That means I can't set default variant if we run a report by SE38, right?
Thanks,
Best regards,
Miki
05-20-2011 9:40 AM
Hi,
Check this:
[http://aq33.com/development-programming/Articles000146.html]
Rgs,
Lokesh.
05-20-2011 9:40 AM
Hi,
Try defaulting the values for each selection screen fields (parameter/select option) in the ABAP program itself at the declaration part by using "DEFAULT".
Regards,
Harish
05-20-2011 11:06 AM
Use the RS_VARIANT_CONTENTS FM
CALL FUNCTION 'RS_VARIANT_CONTENTS'
EXPORTING
report = sy-repid
variant = 'PRUEBA' "Your Variant
* MOVE_OR_WRITE = 'W'
* NO_IMPORT = ' '
EXECUTE_DIRECT = 'X'
* IMPORTING
* SP =
tables
* L_PARAMS =
* L_PARAMS_NONV =
* L_SELOP =
* L_SELOP_NONV =
valutab = VALUE_TAB
* OBJECTS =
* FREE_SELECTIONS_DESC =
* FREE_SELECTIONS_VALUE =
EXCEPTIONS
VARIANT_NON_EXISTENT = 1
VARIANT_OBSOLETE = 2
OTHERS = 3 .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
The variant Reports are in VARI Table
05-20-2011 2:34 PM
See FM RS_SUPPORT_SELECTIONS
This will allow you to use a default variant or use different ones based on userid. See the documentation.
Rob
05-26-2011 8:48 AM
Thank you very much, everybody.
All answers helped me a lot!.
Best regards,
Miki