Application Development 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: 

Double Click Valid but Single Click Invalid in ALV Grid

Former Member
0 Kudos

In my ALV grid, double click is valid, but single click is invalid. In addition, field "box" in internal table " t_outtab" always stores last value of line-selection checkbox but not current value.

Part of source code:

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

     EXPORTING

       i_callback_program      = l_prog

       it_fieldcat             = t_fieldcat

       is_layout               = s_layout

       is_variant              = variant

       it_sort                 = t_sort

       it_events               = t_events

       i_callback_user_command = 'USER_COMMAND'

       i_save                  = 'A'

     TABLES

       t_outtab                = t_payrq_list.

FORM user_command USING ucomm LIKE sy-ucomm

                         selfield TYPE slis_selfield.


CASE ucomm.

*--  double click

     WHEN '&IC1'.

       READ TABLE t_payrq_list

            INTO ls_payrq_list

            INDEX selfield-tabindex.

       CALL FUNCTION 'COPC_RPR_DISPLAY_REQUEST'

         EXPORTING

           iv_request_number       = ls_payrq_list-keyno

         IMPORTING

           et_message              = lt_messages

                 .

       EXIT.

*--  single click

     WHEN '&ETA'.

       READ TABLE t_payrq_list

            INTO ls_payrq_list

            WITH KEY box = abap_on.

       CALL FUNCTION 'COPC_RPR_DISPLAY_REQUEST'

         EXPORTING

           iv_request_number       = ls_payrq_list-keyno

         IMPORTING

           et_message              = lt_messages

                 .

       EXIT.


ENDCASE.


ENDFORM.



Please help me solve this problem.

4 REPLIES 4

Former Member
0 Kudos

Hi Wayne,

In your fieldcatalog, fill value 'X' in field hotspot.

When you push this column, it trigger ucomm &IC1

Regards,

Andrea

0 Kudos

Thank you, Andrea. I have added statements of setting "hotspot". But single-click function still doesn't work. (Source code is shown as follows.) Could you help me find my bug?

DESCRIBE TABLE p_t_fields LINES sy-tfill.

   IF sy-tfill > 0.

* fields from interface

     LOOP AT l_t_fieldcat.

       IF l_t_fieldcat-fieldname IN p_t_fields OR

          l_t_fieldcat-fieldname EQ 'KEYNO'.

         l_t_fieldcat-no_out = '0'.

       ELSE.

         l_t_fieldcat-no_out = 'X'.

       ENDIF.

       IF l_t_fieldcat-fieldname = 'PAMTF' OR

          l_t_fieldcat-fieldname = 'DMBTR'.

         l_t_fieldcat-do_sum = 'X'.

       ENDIF.

       IF l_t_fieldcat-fieldname = 'ACTION'.

         l_t_fieldcat-tech = 'X'.

       ENDIF.

      l_t_fieldcat-hotspot = 'X'.

       MODIFY l_t_fieldcat.

     ENDLOOP.

   ELSE.

* no fields from interface

     LOOP AT l_t_fieldcat.

       IF l_t_fieldcat-fieldname NE 'KEYNO' AND

          l_t_fieldcat-fieldname NE 'BUKRS' AND

          l_t_fieldcat-fieldname NE 'BELNR' AND

          l_t_fieldcat-fieldname NE 'GJAHR' AND

          l_t_fieldcat-fieldname NE 'PACUR' AND

          l_t_fieldcat-fieldname NE 'PAMTF' AND

          l_t_fieldcat-fieldname NE 'KOART' AND

          l_t_fieldcat-fieldname NE 'PARNO' AND

          l_t_fieldcat-fieldname NE 'PAYEE' AND

          l_t_fieldcat-fieldname NE 'PAYGR' AND

          l_t_fieldcat-fieldname NE 'ORIGN' AND

          l_t_fieldcat-fieldname NE 'FRECO' AND

          l_t_fieldcat-fieldname NE 'TRANS_TYPE' AND

          l_t_fieldcat-fieldname NE 'ORGUNIT_FROM' AND

          l_t_fieldcat-fieldname NE 'ORGUNIT_TO' AND

          l_t_fieldcat-fieldname NE 'AWTYP' AND

          l_t_fieldcat-fieldname NE 'SNDPOR' AND

          l_t_fieldcat-fieldname NE 'SNDPRT' AND

          l_t_fieldcat-fieldname NE 'SNDPRN'.

         l_t_fieldcat-no_out = 'X'.

       ELSE.

         l_t_fieldcat-no_out = '0'.

       ENDIF.

       IF l_t_fieldcat-fieldname = 'PAMTF' OR

          l_t_fieldcat-fieldname = 'DMBTR'.

         l_t_fieldcat-do_sum = 'X'.

       ENDIF.

       IF l_t_fieldcat-fieldname = 'ACTION'.

         l_t_fieldcat-tech = 'X'.

       ENDIF.

       IF l_t_fieldcat-fieldname = 'PURP_CODE'.

         DATA ls_dd04v TYPE dd04v.

         CALL FUNCTION 'DDIF_DTEL_GET'

           EXPORTING

             name     = 'FPM_PURP_CODE'

             langu    = sy-langu

           IMPORTING

             dd04v_wa = ls_dd04v

           EXCEPTIONS

             OTHERS   = 0.

         l_t_fieldcat-seltext_l = ls_dd04v-ddtext.

       ENDIF.

      l_t_fieldcat-hotspot = 'X'.

       MODIFY l_t_fieldcat.

     ENDLOOP.

   ENDIF.

0 Kudos

Hi Andrea,

Maybe my description was not clear. I want to replace standard function of showing details with my own function. I expect that function module "'COPC_RPR_DISPLAY_REQUEST'" will be called when button "Choose Detail" is pressed.

Kind regards,

Wayne

0 Kudos

Hi Wayne,

single click didn't work because in USER_COMMAND form, ucomm to check is '&IC1' instad of '&ETA'.

Anyway, i debugged a similar program. When i push button "Choose Detail", program doesn't go into form user_command for this function.

Maybe this could be solved passing to the function module your own gui status (copied from the standard, redefining ucomm for "Choose Detail" and assigning another ucomm to be managed in form user_command.

Best regards,

Andrea