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: 

Deleteing a row from ALV with delete button ( condition check )

Former Member
0 Kudos

Hello ,

I have a problem with ALV screen , Deleteing a row from ALV .

here there is a option with the button ( Delete row ) . when we click on the button it is deleting a row with some condition check this ok ( checking the condition and deleting ) .

But when we selecting a row and using the delete button from the key board , it is deleteing the row with out condition check this is wrong.

how to restrict delete from key board delete button ?

Please help me.

Thanks in advance .

3 REPLIES 3

Former Member
0 Kudos

Hello,

In the debugging check the Sy-ucomm value of the keyboard and make u r modifications required under the sy-ucomm.

Former Member
0 Kudos

hi,

one can create own PF status and activate only the buttons which u want in the application bar...this way u can delete the DELETE button for the apllication bar...

do the following in ur code:

SET PF-STATUS 'ABC'.

got to SE41 and create status ABC under ur program name..

now in the code:

under the REUSE_ALV_GRID_DISPLAY function module mention the above PF STATUS in pf_status.

this will work..

naimesh_patel
Active Contributor
0 Kudos

To capture the delete event generated by the delete key on the keyboard, you have to Register the event EDIT event of type MC_EVT_MODIFIED. Than you have to handle the events DATA_CHANGED and DATA_CHANGED_FINISHED.

This example shows how to disable the key on the Keyboard.

[ALV Grid: Disable DELETE key on Keyboard in ALV|http://help-abap.blogspot.com/2008/10/oo-alv-disable-delete-key-on-keyboard.html]

For your purpose, you can check the deleted lines in the handler class of DATA_CHANGED event.

Regards,

Naimesh Patel