‎2006 Sep 20 5:27 PM
Can any one tell me how to set a variant as default on the selection screen.
I created a variant and on the parameter for the selection screen i wrote:
PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT default '/DEFAULT'.
but this is not working.
I want default variant to turn on the selection screen.
Please help.
Thanks,
Amit
‎2006 Sep 20 5:30 PM
Did you pass the parameter value to the ALV? ie something like..
data rec_variant type disvariant.
rec_variant-report = sy-repid.
rec_variant-variant = p_vari.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
is_variant = rec_variant
-----
---~Suresh
‎2006 Sep 20 5:33 PM
I have problem with the selection screen initialization. The default parameter value is not appearing on the screen.
‎2006 Sep 20 5:36 PM
Hi
- Try to pass it in INITIALIZATION event by MOVE statament:
MOVE '/DEFAULT' TO P_VARI.
or try this code:
INITIALIZATION.
GX_VARIANT-REPORT = SY-REPID.
GX_VARIANT-USERNAME = SY-UNAME.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
I_SAVE = 'A'
CHANGING
CS_VARIANT = GX_VARIANT
EXCEPTIONS
WRONG_INPUT = 1
NOT_FOUND = 2
PROGRAM_ERROR = 3
OTHERS = 4.
IF SY-SUBRC = 0.
P_VARI = GX_VARIANT-VARIANT.
ELSE.
CLEAR GX_VARIANT.
ENDIF.
‎2006 Sep 20 5:34 PM
Hi,
I tried the same code..This is working fine for me..
PARAMETERS: P_VARI LIKE DISVARIANT-VARIANT default '/DEFAULT'.
Do you have any initialization event that clears the parameter P_VARI..Check..
Thanks,
Naren
‎2006 Sep 20 5:37 PM
‎2006 Sep 20 5:45 PM
Amit,
Try the below logic:
REPORT ysadn.
PARAMETERS: p_anlage TYPE anlage.
INITIALIZATION.
DATA: i_valutab TYPE rsparams OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'RS_VARIANT_CONTENTS'
EXPORTING
report = sy-repid
variant = 'SAMPLE'
TABLES
valutab = i_valutab
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.
READ TABLE i_valutab WITH KEY selname = 'P_ANLAGE'.
IF sy-subrc = 0.
p_anlage = i_valutab-low.
ENDIF.
Regards,
Prakash.
‎2006 Sep 20 7:01 PM
Hi
First save the layout once you execute the program and name it as '/DEFAULT'. When you save the layout it will ask you layout name and click the check box default setting.
Next time when you execute the program the default layout varaint will display on the selection screen.
Nataraju
‎2006 Sep 20 7:14 PM
At the INITIALIZATION event, execuyte FM RS_SUPPORT_SELECTIONS.
Rob
‎2006 Sep 24 6:20 AM
Hi,
try at at selection-screen output event.
write the move statement in the at selection-screen output event
i hope it will work.
All The Best
Priyanka
Do reward Points