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: 

user command event is not working ........

Former Member
0 Kudos

Hi ,

class event_class definition.

public section.

methods:

handle_user_command

for event after_user_command of cl_gui_alv_grid

importing e_ucomm.

methods:handle_hotspot

for event hotspot_click of cl_gui_alv_grid

importing e_row_id.

endclass. "event_class DEFINITION

******selection screen**************************

call screen 100.

----


  • CLASS event_class IMPLEMENTATION

----


*

----


********class implimentations********************

class event_class implementation.

method handle_user_command.

case e_ucomm.

when 'SAVE'.

wa_default-checkbox = 'X'.

ENDCASE.

endmethod. "handle_user_command

method handle_hotspot.

wa_default-checkbox = 'X'.

lv_layout-zebra = 'X'.

lv_hotspot = lv_hotspot + 1.

modify lit_default

index e_row_id

from wa_default

transporting checkbox.

lv_id = e_row_id.

*************refreshing tables************

call method wa_alv->refresh_table_display

  • EXPORTING

  • is_stable =

  • i_soft_refresh =

  • EXCEPTIONS

  • finished = 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.

endmethod.

"handle_user_command

method user_command.

*****some code i will write with help of e_ucomm**********( control not comming here)

endmethod.

endclass.

Hi,Here i have one alv grid display if i click on grid checkbox method (hotspot) will triggers properly,,,,but if i select any button like save ,modify i have created on screen method user_command is not triggering ,control is going to pai of that screen.my question is it shold trigger usr_command right??????

any help appriciated.

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi, Lingaraj.

Check your events handlers is registered

SET HANDLER go_event_receiver->handle_double_click FOR go_grid.
SET HANDLER go_event_receiver->handle_toolbar      FOR go_grid.
SET HANDLER go_event_receiver->handle_user_command FOR go_grid.
SET HANDLER go_event_receiver->handle_menu_button  FOR go_grid.
SET HANDLER go_event_receiver->handle_context_menu FOR go_grid.
SET HANDLER go_event_receiver->on_f4               FOR go_grid.
SET HANDLER go_event_receiver->handle_data_changed FOR go_grid.

before calling an ALV:

go_grid->set_table_for_first_display(
     EXPORTING  is_layout        = ls_layout
                is_variant       = ls_variant
                i_save           = 'A'
      CHANGING  it_outtab        = gt_outtab
                it_fieldcatalog  = lt_fieldcat

Hope it will be helpful for you.

Best regards,

George Shlyahov.

2 REPLIES 2

Former Member
0 Kudos

Hi, Lingaraj.

Check your events handlers is registered

SET HANDLER go_event_receiver->handle_double_click FOR go_grid.
SET HANDLER go_event_receiver->handle_toolbar      FOR go_grid.
SET HANDLER go_event_receiver->handle_user_command FOR go_grid.
SET HANDLER go_event_receiver->handle_menu_button  FOR go_grid.
SET HANDLER go_event_receiver->handle_context_menu FOR go_grid.
SET HANDLER go_event_receiver->on_f4               FOR go_grid.
SET HANDLER go_event_receiver->handle_data_changed FOR go_grid.

before calling an ALV:

go_grid->set_table_for_first_display(
     EXPORTING  is_layout        = ls_layout
                is_variant       = ls_variant
                i_save           = 'A'
      CHANGING  it_outtab        = gt_outtab
                it_fieldcatalog  = lt_fieldcat

Hope it will be helpful for you.

Best regards,

George Shlyahov.

Former Member
0 Kudos

thanks