10-10-2007 11:40 AM
Hi I am using object oriented ALV Grid in my program.
In the standard tool bar I want save layout option. i think this is the default button in ALV grid toolbar but it is not displayed in my ALV grid.
Can anyone tell me about possible reasons for the same.
10-10-2007 11:50 AM
u might have excluded it with ur coding example like below:
IS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_EXCL_ALL.
APPEND IS_EXCLUDE TO IT_EXCLUDE.
there will be two toolbars, one with the grid and one above the grid.
with the grid, if u use coding like above, u will not get.
and for the above,
try writing in ur code
<b>set pf-status standard.</b>
10-10-2007 11:50 AM
u might have excluded it with ur coding example like below:
IS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_EXCL_ALL.
APPEND IS_EXCLUDE TO IT_EXCLUDE.
there will be two toolbars, one with the grid and one above the grid.
with the grid, if u use coding like above, u will not get.
and for the above,
try writing in ur code
<b>set pf-status standard.</b>
10-10-2007 2:38 PM
Thanks a lot everyone..
Actually this save layout button is part of stanard toolbar.
I tried all the options provided by you ppl to get the button on ALV grid tool bar but it was not working.
In class cl_gui_alv_grid (ALV object class) a small code is there which exclude this save layout button if the exclude button parameter is not emply
that is if we do something like
IS_EXCLUDE = CL_GUI_ALV_GRID=>MC_FC_EXCL_ALL.
APPEND IS_EXCLUDE TO IT_EXCLUDE.
and pass on IT_EXCLUDE through set_table_for_first_display method
then automatically save variant option will get deleted.
and if IT_EXCLUDE[] is cleared then this button is displayed as expected.
I dont know why this type of fucntionality is included in class but i hope SAP might have some answer to this
Message was edited by:
Sandeep Mourya
10-10-2007 11:55 AM
Hi
for saving layout in alv list or grid
just give
i_save = 'A'.
it will give you option to save the layout.
try like this.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZALV_DS'
is_layout = st_layout
i_save = 'A'
it_fieldcat = t_fcat
it_events = t_eve
TABLES
t_outtab = itab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
<b>reward fi usefull</b>
10-10-2007 12:12 PM
Hi Sandeep,
in OO-Grid do this:
Grid aufrufen
CALL METHOD GR_ALVGRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
IT_TOOLBAR_EXCLUDING = GT_EXCLUDE
IS_LAYOUT = GS_LAYOUT
IS_VARIANT = GS_VARIANT
<b> I_SAVE = 'X'</b>
CHANGING
IT_FIELDCATALOG = GT_FIELDCAT
IT_SORT = GT_SORT
IT_OUTTAB = ITAB.
*
Hope it helps.
Regards, Dieter