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: 

Probelm In double_click event (ALV grid control using oop concepts)

Former Member
0 Kudos

Hi,

I am doing ALV grid using OOP concepts.I am handling Double_click event.

When I first double click on any field, its working fine.

But, wen i double click for second time on any field, its going out of the program.(to the initial SAP ACCESS MENU screen).

here I am giving my piece of code.

CLASS lcl_event_handler DEFINITION.

PUBLIC SECTION.

CLASS-METHODS : handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid

IMPORTING e_row_id

e_column_id

es_row_no,

handle_double_click FOR EVENT double_click OF cl_gui_alv_grid

IMPORTING e_row

e_column

es_row_no.

PRIVATE SECTION.

ENDCLASS.

CLASS lcl_event_handler IMPLEMENTATION.

METHOD handle_hotspot_click.

IF e_column_id-fieldname = 'EBELN'.

READ TABLE it_ekko INTO wa_ekko INDEX es_row_no-row_id.

SELECT ebeln ebelp ematn matkl netpr FROM ekpo

INTO CORRESPONDING FIELDS OF TABLE it_ekpo

WHERE ebeln = wa_ekko-ebeln.

*call screen 200 (EKPO data)

CALL SCREEN 200.

ELSE.

MESSAGE e000(z50871msg) WITH 'Please click on Purchase Doc number'.

ENDIF.

ENDMETHOD. "handle_hotspot_click

METHOD handle_double_click.

IF e_column-fieldname = 'EBELN'.

READ TABLE it_ekko INTO wa_ekko INDEX es_row_no-row_id.

SELECT ebeln ebelp ematn matkl netpr FROM ekpo

INTO CORRESPONDING FIELDS OF TABLE it_ekpo

WHERE ebeln = wa_ekko-ebeln.

*call screen 200 (EKPO data)

CALL SCREEN 200.

ELSE.

MESSAGE e000(z50871msg) WITH 'Please click on Purchase Doc number'.

EXIT.

ENDIF.

ENDMETHOD . "handle_hotspot_click

ENDCLASS. "lcl_event_handler IMPLEMENTATION

Is there any thing wrong in handleing the events.

Points will be rewarded.

Regards

Sandeep Reddy

4 REPLIES 4

Former Member
0 Kudos

Please put break point in the PBO and PAI events of the screen 100 and screen 200 and investigate

Former Member
0 Kudos

try debugging for your second double click and see, what is happening. which method it is using etc ?

try clearing e_row and e_column.

when you say' double click for the second time.." do you mean, double clciking on screen 200 ? have you defined, the events for this screen ?

0 Kudos

Hello,

U can try clear workarea command after the end of method.

Also check whether events are registered properly after calling method set_table_for_first_display.

Reward if useful.

uwe_schieferstein
Active Contributor
0 Kudos

Hello Sandeep

You should not call the second screen within your event handler method. Instead, trigger PAI by calling method CL_GUI_CFW=>SET_NEW_OK_CODE and call the second dynpro as usual in the USER_COMMAND module at PAI.

For the sample report ZUS_SDN_ALVGRID_EVENTS_1 have a look at thread

Regards

Uwe