‎2007 Sep 07 11:49 AM
I ve an option on 1st screen to choose the variant for layout.
my 1st display with any selected layout is executing fine and displaying the list.
from this screen, if i come back and change the variant and execute... then its not displaying accordingly.
i am doing this by OO ABAP.
Any help plz
‎2007 Sep 07 11:59 AM
Hello,
Use the function modules
<b>REUSE_ALV_VARIANT_EXISTENCE' and
REUSE_ALV_VARIANT_F4</b>
Reward if helpful
Regards,
LIJO
‎2007 Sep 13 11:01 AM
i already used. my problem is not with existence.
i ve those variants.
but if i come back n choose a diff variant, my list is not displayed with the new variant..
‎2007 Sep 14 6:32 AM
‎2007 Nov 19 7:01 AM
‎2007 Nov 19 10:46 AM
‎2007 Nov 19 10:51 AM
may be ur just deleting and typing the new variant....after coming back select the variant using f4 help....
‎2007 Nov 19 10:59 AM
‎2007 Nov 19 11:06 AM
‎2007 Nov 19 11:27 AM
check this, i guess this might help u.......
*Variables for variant
data:
wk_variant like disvariant,
wx_variant like disvariant,
wk_variant_save(1) type c,
wk_repid like sy-repid,
wk_exit(1) type c.
selection-screen begin of block b3 with frame title text-027.
parameters:p_vari like disvariant-variant. "Variant
selection-screen end of block b3.
initialization.
perform f_init_variant.
perform f_variant_default using p_vari.
*This event is used for Layout Variant
at selection-screen on value-request for p_vari.
perform f_variant_f4 using p_vari.
form f_init_variant.
clear: wk_variant.
wk_repid = sy-repid.
wk_variant-report = wk_repid.
wk_variant-username = sy-uname.
wk_variant_save = 'A'. "All types
endform. "F_INIT_VARIANT
form f_variant_default using p_variant type disvariant-variant.
wx_variant = wk_variant.
if ( not p_variant is initial ).
wx_variant-variant = p_variant.
endif.
call function 'LVC_VARIANT_DEFAULT_GET'
exporting
i_save = wk_variant_save
changing
cs_variant = wx_variant
exceptions
wrong_input = 1
not_found = 2
program_error = 3
others = 4.
case sy-subrc.
when 0.
p_variant = wx_variant-variant.
when 2.
clear: p_variant.
endcase.
endform. "f_variant_default
form f_variant_f4 using p_variant type disvariant-variant.
call function 'LVC_VARIANT_F4'
exporting
is_variant = wk_variant
i_save = wk_variant_save
importing
e_exit = wk_exit
es_variant = wx_variant
exceptions
not_found = 1
program_error = 2
others = 3.
if sy-subrc <> 0.
message i122(zpp).
endif.
if wk_exit is initial.
wk_variant-variant = wx_variant-variant.
p_variant = wx_variant-variant.
endif.
endform. "F_VARIANT_F4
*************************
pass wk_variant to alv FM
*************************
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
i_background_id = 'ALV_BACKGROUND'
it_fieldcat = fieldcat[]
is_layout = wk_layout
it_events = v_events[]
i_default = 'X'
i_save = 'A'
is_variant = wk_variant
tables
t_outtab = it_final_list.