2009 Feb 05 12:55 PM
Hi,
I have created alv list using contanier, which displays sales order no & its details.
so after clicking on order no. its calls VA02 transaction.
How to get this?
Thanks in advance
2009 Feb 05 1:12 PM
hi,
Hope it helps.....
w_alv_event_rec TYPE REF TO lcl_eventhandler,
class lcl_eventhandler definition.
PUBLIC SECTION.
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING
e_row
e_column
es_row_no.
endclass.
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_double_click.
CALL TRANSACTION VA02.
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
CREATE OBJECT w_alv_event_rec.
SET HANDLER w_alv_event_rec->handle_double_click FOR w_grid_find. ---->THIS IS THE INSTANCE OF THE CLASS CL_GUI_ALV_GRID.This part of the code should be written before you display the values on the grid.
CREATE OBJECT w_alv_event_rec.
SET HANDLER w_alv_event_rec->handle_double_click FOR w_grid_find. -
>THIS IS THE INSTANCE OF THE CLASS CL_GUI_ALV_GRID.
Thanks,
Ibrahim
Hi,
I have created alv list using contanier, which displays sales order no & its details.
so after clicking on order no. its calls VA02 transaction.
How to get this?
Thanks in advance
2009 Feb 05 1:12 PM
hi,
Hope it helps.....
w_alv_event_rec TYPE REF TO lcl_eventhandler,
class lcl_eventhandler definition.
PUBLIC SECTION.
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING
e_row
e_column
es_row_no.
endclass.
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_double_click.
CALL TRANSACTION VA02.
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
CREATE OBJECT w_alv_event_rec.
SET HANDLER w_alv_event_rec->handle_double_click FOR w_grid_find. ---->THIS IS THE INSTANCE OF THE CLASS CL_GUI_ALV_GRID.This part of the code should be written before you display the values on the grid.
CREATE OBJECT w_alv_event_rec.
SET HANDLER w_alv_event_rec->handle_double_click FOR w_grid_find. -
>THIS IS THE INSTANCE OF THE CLASS CL_GUI_ALV_GRID.
Thanks,
Ibrahim
2009 Feb 05 1:14 PM
Hi,
Add the below snippet in your program
"Declare a callback subroutine variable
DATA: : wa_callback_subroutine TYPE slis_formname,
"intialise the subroutine variable to the routine name handling the user command double click
wa_callback_subroutine = 'USER_COMMAND'.
"simpy Add sunbroutine varibale declared above in the ALV display routine in callback_user_command import parameter
i_callback_user_command = wa_callback_subroutine
"Define the user_command subroutine as below
FORM user_command USING okcode LIKE sy-ucomm
lselfield TYPE slis_selfield.
CASE okcode.
WHEN '&IC1'. " SAP standard code for double-clicking
CASE lselfield-sel_tab_field."check if double click is only on
WHEN '<internaltablename-fieldname>'."aufnr not on any other field
SET PARAMETER ID 'ANR' FIELD lselfield-value.
CALL TRANSACTION '<tcode>' AND SKIP FIRST SCREEN.
ENDCASE.
ENDCASE.
"OR add the code as required by you but sy-ucomm is &IC1 a
ENDFORM. "user_commandhope this will solve your problem.
Pooja
2009 Feb 05 1:24 PM
CASE sy-ucomm.
*when user clicks a order num
WHEN '&IC1'.
READ TABLE itab INDEX slis_selfield-tabindex INTO wa_itab.
IF sy-subrc = 0.
CALL TRANSACTION wa_itab-tcode.
ENDIF.
2009 Feb 05 5:15 PM
METHOD handle_double_click.
CALL METHOD gcl_alv_grid->get_current_cell
IMPORTING
e_row = lv_row
e_value = lv_value
es_col_id = ls_col_info.
If the user double clicked on the order number, lv_value will have the order number. If not, then lv_row should correspond to the row of data in the it_outtab used to display the ALV grid using call method gcl_alv_grid->set_table_for_first_display
read table it_outtab index lv_row.
Then set your parameter ID's with order # and Call Transaction.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |