Application Development and Automation 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: 
Read only

double click on OOPS grid

Former Member
0 Likes
812

Hi,

I have 3 grids , like the following code.

SET HANDLER gr_event_handler->handle_double_click FOR o_grid. "GT_SUM_COPA.

SET HANDLER gr_event_handler->handle_double_click FOR o_grid2.

SET HANDLER gr_event_handler->handle_double_click FOR o_grid_final.

This is the implementation

CLASS lcl_event_handler IMPLEMENTATION .

*Handle Double Click

METHOD handle_double_click .

PERFORM handle_double_click USING e_row

e_column

es_row_no

sender.

ENDMETHOD.

ENDCLASS.

but how i can use the double click event using sender?

right now it is like the following.

FORM handle_double_click USING

i_row TYPE lvc_s_row

i_column TYPE lvc_s_col

is_row_no TYPE lvc_s_roid

sender TYPE lvc_s_sender.

READ TABLE GT_sum_COPA INDEX I_ROW-INDEX.

IF sy-subrc = 0.

CALL SCREEN 9100 .

ENDIF .

READ TABLE GT_FI INDEX I_ROW-INDEX.

IF sy-subrc = 0.

CALL SCREEN 9100 .

ENDIF .

READ TABLE GT_FINAL_COPA INDEX I_ROW-INDEX.

IF sy-subrc = 0.

CALL TRANSACTION 'KE24'.

ENDIF .

ENDFORM .

please suggest.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
610

Sender is a "formal parameter" an OBJECT reference like the object you used to create your Grid in CREATE OBJECT (TYPE REF TO class). It is the object which triggers the event - it is automatically defined as soon as it is defined as parameter. Look at [IMPORTING p1 p2 ... sender|http://help.sap.com/abapdocu_70/en/ABAPMETHODS_EVENT_HANDLER.htm#!ABAP_ADDITION_1@1@] in [METHODS - FOR EVENT |http://help.sap.com/abapdocu_70/en/ABAPMETHODS_EVENT_HANDLER.htm]

Your code should look like

FORM handle_double_click USING
  i_row TYPE lvc_s_row
  i_column TYPE lvc_s_col
  is_row_no TYPE lvc_s_roid
  sender.
  CASE sender.
    WHEN o_grid.
      READ TABLE gt_sum_copa INDEX i_row-index.
      IF sy-subrc = 0.
        CALL SCREEN 9100 .
      ENDIF .
    WHEN o_grid2.
      READ TABLE gt_fi INDEX i_row-index.
      IF sy-subrc = 0.
        CALL SCREEN 9100 .
      ENDIF .
    WHEN o_grid_final.
      READ TABLE gt_final_copa INDEX i_row-index.
      IF sy-subrc = 0.
        CALL TRANSACTION 'KE24'.
      ENDIF .
  ENDCASE.
ENDFORM.

Regards,

Raymond

PS: Please, close the thread

Sender is a "formal parameter" an OBJECT reference like the object you used to create your Grid in CREATE OBJECT (TYPE REF TO class). It is the object which triggers the event - it is automatically defined as soon as it is defined as parameter. Look at [IMPORTING p1 p2 ... sender|http://help.sap.com/abapdocu_70/en/ABAPMETHODS_EVENT_HANDLER.htm#!ABAP_ADDITION_1@1@] in [METHODS - FOR EVENT |http://help.sap.com/abapdocu_70/en/ABAPMETHODS_EVENT_HANDLER.htm]

Your code should look like

FORM handle_double_click USING
  i_row TYPE lvc_s_row
  i_column TYPE lvc_s_col
  is_row_no TYPE lvc_s_roid
  sender.
  CASE sender.
    WHEN o_grid.
      READ TABLE gt_sum_copa INDEX i_row-index.
      IF sy-subrc = 0.
        CALL SCREEN 9100 .
      ENDIF .
    WHEN o_grid2.
      READ TABLE gt_fi INDEX i_row-index.
      IF sy-subrc = 0.
        CALL SCREEN 9100 .
      ENDIF .
    WHEN o_grid_final.
      READ TABLE gt_final_copa INDEX i_row-index.
      IF sy-subrc = 0.
        CALL TRANSACTION 'KE24'.
      ENDIF .
  ENDCASE.
ENDFORM.

Regards,

Raymond

PS: Please, close the thread

3 REPLIES 3
Read only

MarcinPciak
Active Contributor
0 Likes
610

but how i can use the double click event using sender?

What do you mean by this? SENDER is a reference to your ALV instance which triggers that double click event. So this is just for distinguishing which ALV your are working on.

If you provide more information maybe we can help you better.

Regards

Marcin

Read only

RaymondGiuseppi
Active Contributor
0 Likes
611

Sender is a "formal parameter" an OBJECT reference like the object you used to create your Grid in CREATE OBJECT (TYPE REF TO class). It is the object which triggers the event - it is automatically defined as soon as it is defined as parameter. Look at [IMPORTING p1 p2 ... sender|http://help.sap.com/abapdocu_70/en/ABAPMETHODS_EVENT_HANDLER.htm#!ABAP_ADDITION_1@1@] in [METHODS - FOR EVENT |http://help.sap.com/abapdocu_70/en/ABAPMETHODS_EVENT_HANDLER.htm]

Your code should look like

FORM handle_double_click USING
  i_row TYPE lvc_s_row
  i_column TYPE lvc_s_col
  is_row_no TYPE lvc_s_roid
  sender.
  CASE sender.
    WHEN o_grid.
      READ TABLE gt_sum_copa INDEX i_row-index.
      IF sy-subrc = 0.
        CALL SCREEN 9100 .
      ENDIF .
    WHEN o_grid2.
      READ TABLE gt_fi INDEX i_row-index.
      IF sy-subrc = 0.
        CALL SCREEN 9100 .
      ENDIF .
    WHEN o_grid_final.
      READ TABLE gt_final_copa INDEX i_row-index.
      IF sy-subrc = 0.
        CALL TRANSACTION 'KE24'.
      ENDIF .
  ENDCASE.
ENDFORM.

Regards,

Raymond

PS: Please, close the thread

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
610

Hi,

Refer the below wiki code by me:-

https://wiki.sdn.sap.com/wiki/display/Snippets/UsingbasiceventsinOOPs+ALV

This explains how to use the double click event in OO ALV.

Hope this heslp you.

Regards,

Tarun