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

Selecting Row of Data from ALV Grid

When handling a double-click for my alv grid, I have found methods for getting the value of the cell that was clicked. Is there a method for returning the value of the whole row?

Thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Apr 15, 2004 at 06:51 AM

    Try the code bellow.

    You also have to set the fieldcat-hotspot field to 'X' in the fieldcatalog for the column you want to enable clicking.

    There is also a method for double click, as far as I remember it works very similar way...but I always use hotspot_click.

    I've just found it: check demo BCALV_GRID_02

    Incho

    *eject

    ----


    • CLASS cl_event_receiver DEFINITION

    ----


    • class lcl_event_receiver: local class to handle event HOTSPOT_CLICK

    CLASS lcl_event_receiver DEFINITION.

    PUBLIC SECTION.

    METHODS:

    handle_hotspot_click

    FOR EVENT hotspot_click OF cl_gui_alv_grid

    IMPORTING e_row_id e_column_id.

    ENDCLASS. "lcl_event_receiver DEFINITION

    ----


    • CLASS lcl_event_receiver IMPLEMENTATION

    ----


    CLASS lcl_event_receiver IMPLEMENTATION.

    METHOD handle_hotspot_click.

    READ TABLE it_rseg INDEX e_row_id-index INTO wa_rseg.

    CASE e_column_id-fieldname.

    *--> Display Invoice

    WHEN 'BELNR'.

    IF wa_rseg-belnr <> space.

    SET PARAMETER ID 'RBN' FIELD wa_rseg-belnr.

    SET PARAMETER ID 'GJR' FIELD wa_rseg-gjahr.

    CALL TRANSACTION tcode_mir4 AND SKIP FIRST SCREEN.

    ENDIF.

    ENDCASE.

    ENDMETHOD. "handle_double_click

    ENDCLASS. "lcl_event_receiver IMPLEMENTATION

    *=======================================================================

    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.