10-14-2010 11:57 AM
hello all,i am facing a problem now:i develop an ABAP report program,with 3 radio buttons on selection screen,output 3 lists correspondingly,they get different fields,now if i config a userlayout for one output list,and set it as default layout for all users,this layout will apply to another two lists,how can i make it as list -specific for all users?i tried to create 3 GUIs,but it failed,any suggestion will be appreciate.
10-14-2010 12:08 PM
Add a "handle" in your variant (structure DISVARIANT, field handle) use a different handle value for each list, so you can have 3 different default layouts, and layouts are related to one list.
ls_variant-report = sy-repid.
IF radio1 EQ c_x.
ls_variant-handle = '0001'.
ELSEIF radio2 EQ c_x.
ls_variant-handle = '0002'.
ELSEIF radio3 EQ c_x.
ls_variant-handle = '0003'.
ENDIF.
Regards,
Raymond
10-14-2010 12:08 PM
Add a "handle" in your variant (structure DISVARIANT, field handle) use a different handle value for each list, so you can have 3 different default layouts, and layouts are related to one list.
ls_variant-report = sy-repid.
IF radio1 EQ c_x.
ls_variant-handle = '0001'.
ELSEIF radio2 EQ c_x.
ls_variant-handle = '0002'.
ELSEIF radio3 EQ c_x.
ls_variant-handle = '0003'.
ENDIF.
Regards,
Raymond
10-14-2010 12:35 PM
Raymond ,thank you very much.I am new about SAP,can you explain more detail ?i am confused that how can i use handle to connect to specific layout?
10-14-2010 12:55 PM
I supposed you use ALV (OO, LVC or REUSE FM) all those objects have parameters to manage display variants : look for IS_VARIANT and I_SAVE, the code above was intended to be used to fill IS_VARIANT parameter :
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
(...)
i_save = lv_save
is_variant = ls_variant
(...)
or
CALL METHOD alv->set_table_for_first_display
EXPORTING
(...)
is_variant = ls_variant
i_save = lv_save
(...)
The use of handle allow management of many different ALV layouts in a single program.
Regards,
Raymond