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 double click call transaction

dunky
Active Participant

Hi,

I've implemented the double click method, when i double click at the field row of the ALV the program doesn't trigger the event.

*----------------------------------------------------------------------*
*       CLASS lcl_receptor_eventos DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_receptor_eventos DEFINITION.

   PUBLIC SECTION.
     METHODS:
       metodo_doble_click
  FOR EVENT double_click OF cl_gui_alv_grid
  IMPORTING e_row e_column es_row_no.

ENDCLASS


*----------------------------------------------------------------------*
*       CLASS lcl_receptor_eventos IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_receptor_eventos IMPLEMENTATION.
   METHOD metodo_doble_click.
     PERFORM handle_double_click USING e_row e_column es_row_no .
   ENDMETHOD.                    "metodo_doble_click


ENDCLASS.                    "lcl_receptor_eventos IMPLEMENTATION


*&---------------------------------------------------------------------*
*&      Form  HANDLE_DOUBLE_CLICK
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_E_ROW  text
*      -->P_E_COLUMN  text
*      -->P_ES_ROW_NO  text
*----------------------------------------------------------------------*
FORM handle_double_click  USING i_row TYPE lvc_s_row
                                 i_column TYPE lvc_s_col
                                 is_row_no TYPE lvc_s_roid.

   READ TABLE itab001 INTO wa_itab001  INDEX is_row_no-row_id .
   IF sy-subrc = 0 AND i_column-fieldname = 'AUFNR'.
     SET PARAMETER ID 'MAT' FIELD wa_itab001-aufnr.
     CALL TRANSACTION 'CO02' AND SKIP FIRST SCREEN.
   ENDIF .

ENDFORM.                    " HANDLE_DOUBLE_CLICK



I don't know if the problem is that when I double click the 'Orden' field (AUFNR) the system detects all the row instead of the AUFNR one.

I mean, when I double click at the Orden field, despite I've put the /h for debugging, all the row is highlighted but nothing occurs.

Thanks a lot.

Regards.

1 ACCEPTED SOLUTION

ArcherZhang
Advisor
Advisor

Hi Ocr,

Do you 'SET HANDLER' for your gird control?

Please go through a example report 'BCALV_GRID_03'.

regards,

Archer

3 REPLIES 3

ArcherZhang
Advisor
Advisor

Hi Ocr,

Do you 'SET HANDLER' for your gird control?

Please go through a example report 'BCALV_GRID_03'.

regards,

Archer

thanga_prakash
Active Contributor
0 Kudos

Hello,

You are using the wrong Parameter ID, it should be 'ANR'.

ANR is the parameter ID for Order number field in CO02.

Regards,

Thanga

former_member184158
Active Contributor

Hi,,

you have to set the handler and set the correct parameter for oder number which is ANR

set handler event_receiver->handle_double_click for ALV_GRID.



      SET PARAMETER ID 'ANR' FIELD wa_itab001-aufnr.

      CALL TRANSACTION 'CO02' AND SKIP FIRST SCREEN.



Regards

Ibrahim