Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Interactive ALV

Former Member
0 Likes
1,251

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.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,120

Had you developped in OO ALV, you would have get 2 distinct events...

In your case, just check the field on which user has clicked or double-clicked, and ignore if rs_selfield-fieldname is not your key field.

Regards,

Raymond

8 REPLIES 8
Read only

Kiran_Valluru
Active Contributor
0 Likes
1,120

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

Read only

0 Likes
1,120

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

Read only

0 Likes
1,120

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

Read only

Former Member
0 Likes
1,120

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

Read only

0 Likes
1,120

Thanks AKS,can you please show me in coding.

Regards,

harish Kasyap.

Read only

0 Likes
1,120

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.

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,121

Had you developped in OO ALV, you would have get 2 distinct events...

In your case, just check the field on which user has clicked or double-clicked, and ignore if rs_selfield-fieldname is not your key field.

Regards,

Raymond

Read only

Former Member
0 Likes
1,120

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