06-16-2008 4:25 PM
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
06-16-2008 4:40 PM
Please put break point in the PBO and PAI events of the screen 100 and screen 200 and investigate
06-16-2008 4:42 PM
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 ?
06-17-2008 5:59 AM
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.
06-17-2008 6:10 AM
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