2008 Mar 06 7:45 AM
Hi,
I have an editable alv with a delete button in the editable alv .
When I click on the delete button , I want to give a pop up which says whether you want to delete the data or not .
If yes , I will allow the system to delete the data .
If no, it should not delete the data .
There is a method called handle_data_changed in the alv , but data is getting deleted from the alv even before going to this method .I checked it in the debugger .
Please could someone help me out with how I can perform this task?
Regards,
Sushanth H.S.
2008 Mar 06 9:24 AM
Hi Chitra,
I have already done this .
I put a break-point in the event handle_data_changed and found that the data is getting deleted from the alv-grid even before coming to this event .
Regards,
Sushanth H.S.
Hi,
I have an editable alv with a delete button in the editable alv .
When I click on the delete button , I want to give a pop up which says whether you want to delete the data or not .
If yes , I will allow the system to delete the data .
If no, it should not delete the data .
There is a method called handle_data_changed in the alv , but data is getting deleted from the alv even before going to this method .I checked it in the debugger .
Please could someone help me out with how I can perform this task?
Regards,
Sushanth H.S.
2008 Mar 06 8:42 AM
Hi Sushanth,
As per my understanding, You will have a check box to select the data that is to be deleted.
So when you select , the Final table that is used to display the ALV gets automatically changed.
In that event , ( dont forget to register tat event )
get the selected rows
raise a pop up for confirmation
Delete the records.
Regards,
Chitra
2008 Mar 06 8:53 AM
Hi Chitra,
I want to know which is the event that has to be registered?
Regards,
Sushanth H.S.
2008 Mar 06 9:18 AM
Hi Sushanth,
do this.
Add this to your code.
**- Register events
CALL METHOD o_alvgrid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CALL METHOD o_alvgrid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
**- Event Receiver
CREATE OBJECT o_event_receiver.
SET HANDLER o_event_receiver->handle_data_changed FOR o_alvgrid.
Regards,
Chitra
2008 Mar 06 9:24 AM
Hi Chitra,
I have already done this .
I put a break-point in the event handle_data_changed and found that the data is getting deleted from the alv-grid even before coming to this event .
Regards,
Sushanth H.S.
2008 Mar 06 10:55 AM
Hi Sushanth,
Try this.
Type /h which starts t debugging mode when in the ALV GRID.
You select the row that is to be deleted in the ALV grid and click on the grid.
this is because the Event Handle_data_changed will initiate only after a operation after selecting the data.
This will lead to the code part where you hav written the Method.
Revert if any issues.
Regards,
Chitra
2008 Mar 06 1:48 PM
try calling the before_user_command event... and in that check whether the delete button has been pressed. if yes, show the popup... if the user selects "No" then change the e_ucomm to space so that nothing happens after this event.
Hope this helps.
Thanks,
Balaji
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |