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

Double click in alv grid not refreshing until I click elsewhere

Hello,

I'm very new to abap and just managed to partly implement double click in an alv grid.

I also created a button that calls the exact same function as double click (selects the row and fills in the data areas on the page). When I use the button, everything works fine, but when I double click, nothing changes until I click on a tab or other form of input button on the page.

I have followed the process in debugging and can't find the fault anywhere.

My double click is implemented by:

           create object lcl_event_receiver.
           set handler lcl_event_receiver->double_click
                for search_alv_grid.
          endif. 

CLASS lcl_event_handler DEFINITION.
    public section.
    methods:
    double_click         for event double_click
                         of cl_gui_alv_grid.
ENDCLASS.               "lcl_event_handler

 CLASS lcl_event_handler IMPLEMENTATION.
*---------------------------------------------------------------------*
*       METHOD double_click                                           *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
  method double_click.

  perform select_search_result.

  endmethod.                    "double_click
ENDCLASS.  

Any help would be much appreciated

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 08:33 PM

    Did you call the method REFRESH_TABLE_DISPLAY of CL_GUI_ALV_GRID in your method DOUBLE_CLICK?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 22, 2008 at 08:23 PM

    Hello,

    Try using the template code given below. Let me know if you have any questions.

    data : GT_EVENTS TYPE SLIS_T_EVENT.

    • get event

    PERFORM BUILD_EVENT_TOPOFPAGE USING GT_EVENTS[].

    • display alv data

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    I_CALLBACK_PROGRAM = W_xxxxx

    IT_FIELDCAT = GT_xxxx

    IT_EVENTS = GT_EVENTS[]

    TABLES

    T_OUTTAB = T_xxxx

    EXCEPTIONS

    PROGRAM_ERROR = 1

    OTHERS = 2.

    • get event perform

    FORM BUILD_EVENT_TOPOFPAGE USING LT_EVENTS TYPE SLIS_T_EVENT.

    DATA: LS_EVENT TYPE SLIS_ALV_EVENT.

    *

    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

    EXPORTING

    I_LIST_TYPE = 0

    IMPORTING

    ET_EVENTS = LT_EVENTS.

    • Read double click event using the below statement

    READ TABLE LT_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND

    INTO LS_EVENT.

    IF SY-SUBRC = 0.

    ENDIF.

    ENDFORM. " BUILD_EVENT_TOPOFPAGE

    FORM USER_COMMAND USING L_UCOMM LIKE SY-UCOMM

    LS_SELFIELD TYPE SLIS_SELFIELD.

    CASE L_UCOMM.

    WHEN <double click>

    Perform do_something.

    ENDCASE.

    ENDFORM. " USER_COMMAND

    Best Regards,

    Krishna

    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.