2008 Jan 15 3:41 PM
HI, i need to add a variant to selection screen in order to modify the layout of my alv.does anyone know how to do this .thx?
2008 Jan 15 3:43 PM
as far as I remember sy-variant is a system variable which you can use.
as far as I remember sy-variant is a system variable which you can use.
2008 Jan 15 3:43 PM
as far as I remember sy-variant is a system variable which you can use.
2008 Jan 15 3:47 PM
2008 Jan 15 3:48 PM
Hi,
I wish that this code will help you :
data : w_gx_variant like disvariant.
selection-screen begin of block b5 with frame title text-t01.
*- Display variant
parameters: p_vari like disvariant-variant. "obligatory.
selection-screen comment 47(40) varname for field p_vari.
selection-screen end of block b5.
form pai_of_selection_screen.
if not p_vari is initial.
Vérification de l'existence de la variante saisie
clear w_gx_variant.
clear w_gx_variant-variant.
move w_g_variant to w_gx_variant.
move p_vari to w_gx_variant-variant.
call function 'REUSE_ALV_VARIANT_EXISTENCE'
exporting
i_save = w_g_save
changing
cs_variant = w_gx_variant.
w_g_variant = w_gx_variant.
varname = w_g_variant-text.
else.
varname = ''.
endif.
endform. " pai_of_selection_screen
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = w_g_repid
is_layout = t_layout
it_fieldcat = t_fieldcat
i_default = 'X'
i_save = w_g_save
*/////////////////////////////////////////////////
is_variant = w_g_variant
*/////////////////////////////////////////////////
it_events = t_events
importing
es_exit_caused_by_user = t_exit
tables
t_outtab = t_edition
exceptions
program_error = 1
others = 2.
Reward if it helpful.
Mustapha
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |