10-14-2008 9:53 AM
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 .
10-14-2008 10:00 AM
Hello,
In the debugging check the Sy-ucomm value of the keyboard and make u r modifications required under the sy-ucomm.
10-14-2008 10:12 AM
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..
10-17-2008 4:32 AM
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