‎2008 Nov 25 6:38 AM
Hi ABAP experts ,
I have an ALV list output.
Now if I double click on any of the record I need to capture the entire record.
I used "get cursor field" ,it captures the value where i have double clicked.
Is it possible to capture the entire row where I have double clicked.
The issue is I have vendor field in my output, if the user clicks vendor thats fine and i can navigate to vendor account balance transaction.
But if the user clicks any other value apart from vendor I need to capture the vendor (corresponding to the value selected) and navigate to FBL1n.
Please revert in this regard.
Thanks in advance.
BR,
Jay.
‎2008 Nov 25 7:02 AM
Hi,
In the i_callback_user_command form you should check the r_ucomm value. When double clicked r_ucomm equals to '&IC1'. Then you can get the double clicked row from rs_selfield-tabindex. rs_selfield-fieldname holds the value of double clicked field name.
Example code:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' " ALV display function
EXPORTING
i_callback_program = gv_repid
i_callback_user_command = 'USER_COMMAND' "user_command form to be called
it_fieldcat = gt_fieldcat[]
it_events = gt_events
i_callback_pf_status_set = 'SET_STATUS_ALV'
IMPORTING
e_exit_caused_by_caller = g_exit_caused_by_caller
es_exit_caused_by_user = gs_exit_caused_by_user
TABLES
t_outtab = gt_itab
EXCEPTIONS
program_error = 1
OTHERS = 2.FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'. "doubleclick
READ TABLE gt_itab INDEX rs_selfield-tabindex INTO ls_itab .
ENDCASE .
ENDFORM.
‎2008 Nov 25 7:02 AM
Hi,
In the i_callback_user_command form you should check the r_ucomm value. When double clicked r_ucomm equals to '&IC1'. Then you can get the double clicked row from rs_selfield-tabindex. rs_selfield-fieldname holds the value of double clicked field name.
Example code:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' " ALV display function
EXPORTING
i_callback_program = gv_repid
i_callback_user_command = 'USER_COMMAND' "user_command form to be called
it_fieldcat = gt_fieldcat[]
it_events = gt_events
i_callback_pf_status_set = 'SET_STATUS_ALV'
IMPORTING
e_exit_caused_by_caller = g_exit_caused_by_caller
es_exit_caused_by_user = gs_exit_caused_by_user
TABLES
t_outtab = gt_itab
EXCEPTIONS
program_error = 1
OTHERS = 2.FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'. "doubleclick
READ TABLE gt_itab INDEX rs_selfield-tabindex INTO ls_itab .
ENDCASE .
ENDFORM.
‎2008 Nov 25 7:04 AM
Hello Jagdish,
To get the entire record on which you double click inALV, you can use the System variable
SY-LISEL. In this variable the complete line is fetched from the ALV.
As the column positions are fixed for each field, you can get the required data (Vendor No.) by reading the exact column (char) nos.
Hope this helps you.
Edited by: Sachinkumar Mehta on Nov 25, 2008 8:09 AM