Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Grid probelm

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

hymavathi_oruganti
Active Contributor
0 Kudos

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>

4 REPLIES 4

hymavathi_oruganti
Active Contributor
0 Kudos

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>

0 Kudos

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

Former Member
0 Kudos

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.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a41...

<b>reward fi usefull</b>

Former Member
0 Kudos

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