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: 

ALV Grid->GET_SELECTED_ROWS returns empty table in edit mode

Former Member
0 Kudos

Hi all,

I saw similar threads on this forum, but didn't find the answer. Do you know if that is possible to force grid to return selected rows when is in edit mode? When I switch to display mode everything works just fine.

regards,

Marcin

4 REPLIES 4

Former Member
0 Kudos

I found out that the problem occurs when I try to get selected rows in user_command event (after pressing on grid's toolbar button), then get_selected_rows method returns empty table. When I call this method using e.g. gui status button then it works ok. Strange thing, looks like the grid clears the selection when toolbar button is pressed and grid is in edit mode.

Former Member
0 Kudos

It is necessary to enforce the ALV to transport data from the frontend to the backend. Therefore register the event

  • Register 'Enter' event

CALL METHOD go_alv->register_edit_event

EXPORTING

i_event_id = cl_gui_alv_grid=>mc_evt_enter.

After then clicking 'ENTER', the data should be available in the ABAP program. Without any user interaction it is not possible (as far as I know).

Best regards,

Thomas

Former Member
0 Kudos

Well, yes, I have registered edit event before, but this is not behaviour which I wanted to have. Because normally, if you press the button delete, the you would expect that after that all the changes are triggered to the backend, but it works only after you press enter. I just changed the application a bit, and registered edit event mc_evt_modified. It is still not exactly what I wanted to have, but is better then before.

Marcin

Former Member
0 Kudos

You can try calling method <alv_list>->check_changed before proceeding. This method does a sync between GUI and application server.