Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Disable DEL-Key on Keyboard in ALV-Grid

Hello,

I have the following problem:

I have an editable ALV with buttons delete row and insert row in the toolbar.

I would like to disable the DEL-Key on the Keyboard.

I tried by doing the following:

data: ls_layout type LVC_S_LAYO.
  ls_layout-NO_ROWINS = 'X'.
  call method g_grid->SET_FRONTEND_LAYOUT
    exporting
      is_layout = ls_layout.

but this drops also the Delete and Insert Buttons in the toolbar.

Another possibility would be to trigger the same actions when pressing the DEL-Key as triggered when clicking on the delete button. For my alv I am using this:

lv_event_id = cl_gui_alv_grid=>mc_evt_modified. "MC_EVT_MODIFIED.

CALL METHOD pcr_alv->register_edit_event

EXPORTING

i_event_id = lv_event_id

EXCEPTIONS

error = 1

OTHERS = 2.

IF sy-subrc <> 0.

ENDIF.

so the handle_data_changed method is triggered when pressing on DEL. But how to check that it has been triggered by DEL? sy-ecom is empty.

Anybody could give me an answer for this questions?

thanks

luchticha

Not what you were looking for? View more on this topic or Ask a question