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

Delete Selected rows in ALV display

Former Member
0 Likes
7,080

Hi everyone,

I have a requirement where in my output display, I will have 3 buttons, like Select all, Deselect all and Delete selected.

For Select all and Deselect all I am able to write code and they are working fine. But for Delete selected I am not getting

its actual functionality in the output.

Please help me in this and provide some part of code which can fulfill this.

Regards.

Moderator Message: FAQ. Explore the already given answers and search the forum and the web for more.

Edited by: kishan P on Sep 15, 2010 12:45 PM

Hi everyone,

I have a requirement where in my output display, I will have 3 buttons, like Select all, Deselect all and Delete selected.

For Select all and Deselect all I am able to write code and they are working fine. But for Delete selected I am not getting

its actual functionality in the output.

Please help me in this and provide some part of code which can fulfill this.

Regards.

Moderator Message: FAQ. Explore the already given answers and search the forum and the web for more.

Edited by: kishan P on Sep 15, 2010 12:45 PM

8 REPLIES 8
Read only

Former Member
0 Likes
3,006

Hi,

have a look into Report: BCALV_EDIT_04.

Regards, Dieter

Read only

deepak_dhamat
Active Contributor
0 Likes
3,006

hi ,

after selecting row to delete you want ot delete record from internal table or from database table .

if you want to delete from internal table then on button delete .

use case sy-ucomm ='DELETE' .

DELETE ITAB WHERE BISMT = FIELDSNAME-VALUE .

AND THEN REFRESH ALV DISPLAY .

AGAIN CALL ALV GRID DISPLAY AFTER DELETING RECORD .

Regards

Deepak.

Read only

Former Member
0 Likes
3,006

I have gone through BCALV_EDIT_04, but i the actual part which I need is commented in the program as it is not the right code.

Any more help on this.Please!

Read only

0 Likes
3,006

Hi Latha,

r u using the function module method or the OOps method...?

Read only

0 Likes
3,006

Hi,

why isn't it the right report? There is a button which deletes the selected rows.

Set a breakpoint an look what happens if delete-button will be pressed.

Regards, Dieter

Read only

0 Likes
3,006

Hi Dieter,

I think the problem is smwhr else...Delete is a stanard functionality in the ALV Grid and would not fire your own code...

@Latha: I guess the row is getting deleted but your functionality is not working..If that is right then follow this approach:

When u delete a row it doesnot call your event handler and hence your code is not executed...You have to implement the toolbar event for this...In the toolbar event put a breakpoint and see the sy-ucomm for delete...you will then have to manually change this standard delete sy-ucomm to your custom sy-ucomm...

The code in the handle_toolbar method would be somthing like this

loop at mt-toolbar.

if sy-ucomm = standarad delete code

replace with your own custom code for exapmle 'DELETE'.

endif.

endloop.

Once you have done this then the Delete row would fire your own code for delete event...

Hope this helps...

Regards,

Sitakant

Read only

Former Member
0 Likes
3,006

Hi,

For DELETE operation.

At-User-Command.
case sy-ucomm.
when 'DELETE'.
Delete itab where <condition>.
call grid_alv_display.
endcase.

<< Point begging removed >>

Regards,

Vanitha P

Edited by: Rob Burbank on Sep 15, 2010 10:09 AM

Read only

Former Member
0 Likes
3,006

erm, may it be that your deletion works but you just forgot to refresh the ALV?