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: 

Delete button in editable alv : not triggering before_user_command event

Former Member
0 Kudos

Hi,

    CREATE OBJECT event_receiver.
    SET HANDLER 
event_receiver->handle_before_user_command FOR grid1.

    CALL METHOD grid1->set_table_for_first_display
      EXPORTING
        i_structure_name = 'SFLIGHT'
        is_print         = gs_print
        is_layout        = gs_layout
      CHANGING
        it_outtab        = gt_sflight.

    CALL METHOD grid1->set_ready_for_input
      EXPORTING
        i_ready_for_input = 1.

Above code is not triggering the

before_user_command

event on pressing the following buttons:

Append Row

Insert Row

Delete Row

But when i am pressing Sort Up/Down the event is triggering.

6 REPLIES 6

former_member181962
Active Contributor
0 Kudos

Hi Flora,

If I understand your question correctly, There is nothing wrong with this behavior.

The event before_user_command will trigger before a user command but not after it. What are you trying to do exactly here?

Regards,

Ravi

0 Kudos

I want to do some coding on "Delete row" button press

0 Kudos

Did you try using the USER_COMMAND or AFTER_USER_COMMAND events?

Regards,

Ravi

0 Kudos

I have tried USER_COMMAND and AFTER_USER_COMMAND events,

but in vein. It seems "Delete Row" works on the front end, as even with debugging switch on it is not triggering any code at all.

0 Kudos

Hi,

it will not .Those Buttons will not respond to before user command, this is what i observed.

copy row, delete row, append row, insert row,move row,

copy, cut,paste,paste new row, undo Buttons....

if you want to check the program BCALV_TEST_GRID_EVENTS all buttons will respond to before usercommand, and the rest of the buttons which i mentioned won't respond , thats the reason they excluded also if we want them to make respond exclude them from alv tool bar and then add via toolbar event and trigger via user_command event handler.

Regards

vijay

Former Member
0 Kudos

should have called the method “register_edit_event” by which you also select the way ALV Grid perceives changes

CALL METHOD G_GRID->REGISTER_EDIT_EVENT

EXPORTING

I_EVENT_ID = cl_gui_alv_grid=>mc_evt_modified.

CALL METHOD G_GRID->REGISTER_EDIT_EVENT

EXPORTING

I_EVENT_ID = cl_gui_alv_grid=>mc_evt_enter.