Skip to Content
author's profile photo Former Member
Former Member

ALV Grid->GET_SELECTED_ROWS returns empty table in edit mode

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 08, 2007 at 03:49 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 08, 2007 at 02:25 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 09, 2007 at 07:25 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 01:20 PM

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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.