2013 Jan 30 11:49 AM
Dear Experts,
In interactive ALV, i have given a certain field as Key field and put it as Hotspot.
When i click on Hotspot (Single click) its navigating to required location.
But my problem is that, when i double click on that then also it is navigating.
How can i restrict it to single click that too when only clicking on Hotspot and Key field (it is custom field which doesn't have parameter id ).
Below is my code.
CASE r_ucomm.
*User clicks a transaction code and that tcode is called from ALV
WHEN '&IC1'.
READ TABLE it_tstc INDEX rs_selfield-tabindex INTO wa_tstc.
IF sy-subrc = 0.
call TRANSACTION wa_tstc-tcode.
ENDIF.
Please let me know.
Thanks and Regards,
Kartheek.
2013 Jan 30 12:09 PM
2013 Jan 30 11:55 AM
Hi,
"&IC1" is the ucomm value for double click. when you make the field hotspot it will allow you for single click. You need to change this case condition '&IC1' to restrict double click.
Regards,
Kiran
2013 Jan 30 12:00 PM
Thanks for the reply kiran.
Can you please let me know how do i do it in the case condition.
Thanks in advance.
Regards,
Harish Kasyap
2013 Jan 30 12:07 PM
Hi,
Use OO ALV and register hotspot_click method for hotspot and on_double_click for double click.
Check this thread for reference: https://scn.sap.com/thread/1817786
Or this wiki: http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=55249&bc=true
http://wiki.sdn.sap.com/wiki/display/Snippets/interactive+alv+report+using+hotspot+event
Hope this helps u.,
Regards,
Kiran
2013 Jan 30 11:57 AM
Hi Kartheek ,
Check for ok_code of the double click and put the condition on that to restrict it for doing nothing.
Your problem will be resolved.
Hope this will help ...
Regards,
AKS
2013 Jan 30 12:02 PM
Thanks AKS,can you please show me in coding.
Regards,
harish Kasyap.
2013 Jan 30 12:12 PM
hi reddy,
verify below coding .....its work for only single click.....
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_PROGRAM
IS_LAYOUT = WA_LAYOUT
I_GRID_TITLE = 'Interest Blocked Documents List'
i_callback_user_command = 'USER_COMMAND'
IT_FIELDCAT = fieldtab[]
TABLES
T_OUTTAB = GT_BSEG
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM
SELFIELD TYPE SLIS_SELFIELD.
CASE UCOMM.
WHEN '&IC1' .
IF SELFIELD-tabname = 'GT_BSEG'.
IF SELFIELD-FIELDNAME = 'BELNR'.
READ TABLE GT_BSEG INTO GW_BSEG INDEX SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
SET PARAMETER ID : 'BLN' FIELD GW_BSEG-BELNR,
'BUK' FIELD GW_BSEG-BUKRS,
'GJR' FIELD GW_BSEG-GJAHR,
'BUZ' FIELD GW_BSEG-buzei.
CALL TRANSACTION 'FB09' AND SKIP first SCREEN .
ENDIF.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM.
2013 Jan 30 12:09 PM
2013 Jan 30 12:21 PM
Hi,
Yes it's better to use OO ALV For these type of requirements.
Or else Try like this
WHEN '&IC1'.
CASE i_selfield-sel_tab_field.
WHEN 'Your hotspot field name'.
READ TABLE it_tstc INDEX rs_selfield-tabindex INTO wa_tstc.
IF sy-subrc = 0.
call TRANSACTION wa_tstc-tcode.
ENDIF.
ENDCASE.
ENDCASE.
Thanks
Mani