‎2009 Nov 19 10:34 AM
Hi @ all,
I developed an editable ALV and I automatically got the Buttons for DELETE/ INSERT/ COPY of lines. My problem is that I don´t want to have these functions. The User is only supposed to enter values and not to modify anything else.
It seems to me that I always get these Buttons when I have editable fields in my GRID. (Maybe I´m wrong) So my first approach was to exclude them from the toolbar. Now the buttons are gone, but I can still delete lines with the 'DEL'-Button on the keyboard.
Here is my question:
How can I have editable cells without getting automatically those buttons/functions ?
OR IF THIS IS NOT POSSIBLE
How can I completely remove those Functions ? Please regard that it does not work via exclude table of function codes! Keyboard buttons are still working.
Thanks in advance
‎2009 Nov 19 10:46 AM
Hi
In the Method set_table_for_first_display we have an exporting parameter IT_TOOLBAR_EXCLUDING
cl_gui_alv_grid has mc_fc_loc_copy_row mc_fc_loc_delete_row mc_fc_loc_append_row as Static Attribute
Just go through for all other Static Attributes in the Above class append to an ITAB and pass to the Method mentioned above
Cheerz
Ram
‎2009 Nov 26 12:29 PM
not solved yet.
The keyboard buttons f.i. "DELETE" are still working!
Edited by: Sebastian Becker on Nov 26, 2009 1:29 PM
‎2009 Nov 26 1:05 PM
Hi Sebastian,
below are the 2 methods using for disable/enable the cells in an ALV grid o/p.
cl_gui_alv_grid=>mc_style_disabled.
Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell to status "editable".
Use attribute CL_GUI_ALV_GRID=>MC_STYLE_DISABLED to set a cell to status "non-editable".
as per my knowledge, you want to edit cells with out any buttons. anythingelse youwant to done in this program.
christy
‎2009 Nov 26 3:33 PM
you can create your own PF status and set it with method.
Copy PF status from any standard program , delete unwanted functionality.
now set this in you report.Hope you get it.
‎2009 Nov 26 9:50 PM
Halo Sebastien,
If you want to remove the toolbar buttons , you can do that in the event handler method of event toolbar
of cl_gui_alv_grid. But as you say this will not prevent the user from deleting using keyboard
You can do one more thing
In the data changed event handler you have er_data_changed->mt_deleted_rows .
If er_data_changed->mt_deleted_rows is not initial.
you add a error message entry thru add_protocol method of er_data_changed
endif.