Application Development and Automation 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: 
Read only

ALV OO: How to remove all DELETE/ INSERT/ COPY functionality

Former Member
0 Likes
2,166

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

5 REPLIES 5
Read only

Former Member
0 Likes
1,265

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

Read only

Former Member
0 Likes
1,265

not solved yet.

The keyboard buttons f.i. "DELETE" are still working!

Edited by: Sebastian Becker on Nov 26, 2009 1:29 PM

Read only

0 Likes
1,265

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

Read only

Former Member
0 Likes
1,265

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.

Read only

Former Member
0 Likes
1,265

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.