2007 Jan 04 1:58 PM
Hi,
My requirement is as follows....
I have an ALV grid with columns such as PO no., GR no., Invoice no., etc...
When I double click on any of these cells it should take me to the respective Transaction (say ME23n for PO no.) with the cell content as input in the transaction.
Thanks and Regards,
Navaneeth
2007 Jan 04 2:06 PM
1. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = W_REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
2. FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
P_SELFLD TYPE SLIS_SELFIELD.
DATA : L_REP_MODE. "report mode
CASE P_UCOMM.
WHEN '&IC1'. "Double click
READ TABLE ITAB INDEX P_SELFLD-TABINDEX.
set parameter id 'XXX' field ITAB-field.
call transaction 'XXXX'
endcase.
endform.
1. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = W_REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
2. FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
P_SELFLD TYPE SLIS_SELFIELD.
DATA : L_REP_MODE. "report mode
CASE P_UCOMM.
WHEN '&IC1'. "Double click
READ TABLE ITAB INDEX P_SELFLD-TABINDEX.
set parameter id 'XXX' field ITAB-field.
call transaction 'XXXX'
endcase.
endform.
2007 Jan 04 2:06 PM
1. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = W_REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
2. FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
P_SELFLD TYPE SLIS_SELFIELD.
DATA : L_REP_MODE. "report mode
CASE P_UCOMM.
WHEN '&IC1'. "Double click
READ TABLE ITAB INDEX P_SELFLD-TABINDEX.
set parameter id 'XXX' field ITAB-field.
call transaction 'XXXX'
endcase.
endform.
2007 Jan 04 2:13 PM
Hi Chndrasekhar,
Thanks for ur response...
But I need it using Object Oriented Method.
Ive been using the factory method to display my ALV.
Regards,
Navaneeth
2007 Jan 04 2:21 PM
Hi,
then u can write the code in HANDLE_DOUBLE_CLICK method
CLASS LCL_EVENT_RECEIVER DEFINITION.
PUBLIC SECTION.
METHODS:
*method used for double click
HANDLE_DOUBLE_CLICK
FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW E_COLUMN,
*
ENDCLASS. "LCL_EVENT_RECEIVER DEFINITION
CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
*implementation of the method double click
*when document no is double clicked in ALV GRID , its value is sent to
*transaction FPE3 and the corresponding values of the document are
*displayed
METHOD HANDLE_DOUBLE_CLICK.
CLEAR WA_WRT_OFF_FLDS.
IF E_COLUMN = 'OPBEL'.
READ TABLE ITAB INTO WA_IAB INDEX E_ROW-INDEX.
set parameter....
call transaction...
endif.
ENDMETHOD. "handle_double_click
*method to remove unwanted icons from toolbar
endclass.
2007 Jan 04 2:22 PM
Hi Navaneeth ,
You will have to create a class with methods to handle event in the alv and create handlers for them.
Please refer to the program <b>BCALV_GRID_02</b>. In this the class <b>lcl_event_receiver</b> is used to handled event , see the method <b>handle_double_click</b>, it is used to handle double click.
You will have to do some thing similar , but in the method call the transaction , using the command CALL TRANSACTION.
Please do remeber to set handlers , other wise the events will not be triggered. See line no 212 of the program
Regards
Arun
Reward points if reply is helpful
2007 Jan 04 3:03 PM
Hi Navaneeth,
Check this thread with same requirement.
Thanks to Uwe for sample program
Check this link for another simple program with screen shots
http://www.4ap.de/abap/alv_listausgabe_oo.php
<b>Search the forum with HANDLE_HOTSPOT_CLICK</b>
Regards,
Raghav
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |