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: 

How to invoke delete rows event in ALV_GRID

Former Member
0 Kudos
105

I have two screens.

The first screen 100 have several splitter control ALV grids that display data.

The second screen 200 is the maintenance of screen on 100 that have two grids side by side need to update simultanously.

When I update or insert data on the second screen, I refresh data on screen 100 so that when user navigate to screen 100 they can see the updated data.

For insert rows or modified rows, it works as expected.

However when I delete rows on screen 200 and click go back to 100, screen 100 still shows the rows that I deleted in screen 200. I think that I missed something.

I debug in even data_changed in cl_gui_alv_grid when I deleted, it did not go through this logic therefore I cannot refresh the other grids on screen 100.

Here are the events that I defined and registered in the PBO of screen 200.

class lcl_event_handler definition.

class-methods:

on_data_changed FOR EVENT data_changed

OF cl_gui_alv_grid IMPORTING er_data_changed e_ucomm,

on_user_command for event user_command of cl_gui_alv_grid importing e_ucomm.

endclass.

set handler:

lcl_event_handler=>on_data_changed for go_grid,

lcl_event_handler=>on_user_command for go_grid.

What did I do wrong?

Thanks,

4 REPLIES 4

Former Member
0 Kudos
70

Hi Akinosora,

>

> When I update or insert data on the second screen, I refresh data on screen 100 so that when user navigate to screen 100 they can see the updated data.

>

> For insert rows or modified rows, it works as expected.

>

> However when I delete rows on screen 200 and click go back to 100, screen 100 still shows the rows that I deleted in screen 200. I think that I missed something.

Don't you need to do a refresh of the data for a delete action as well?

Kind regards,

Robert

0 Kudos
70

Yes, on the grid in screen 200, the data is refreshed when I insert, update or deleted.

But when I navigate back to the other screen, the ALV does not get refresh although I used exact table to load to both grid.

When from screen 100 I go back to screen 200, the udpated data still there.

0 Kudos
70

So do you refresh the ALV display on screen 100 at all?

Using the REFRESH_TABLE_DISPLAY method?

Kind regards,

Robert

Edited by: RJ. Schamhart on Feb 16, 2011 3:05 PM

0 Kudos
70

Hi Robert,

I solved the problem.

I put the 'BACK' button in the menu bar and it did not work. Since on second screen, I have two grids on split containers, I have to add my own button in the tool bar of each grid and when I click go back, if there is some changes in the ALV grid, I refresh the table first and navigate to the next screen. I don't know if this is the correct approach but it works.

Interestingly that if on screen 200 I have only one grid, I do not have to do this.

Thanks for your suggestions.

Regards,