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

ALV FCODE in Method HANDLE_ITEM_CHANGED

Former Member
0 Likes
557

I'm calling the following method from my ALV grid to handle editable fields

HANDLE_ITEM_CHANGED

FOR EVENT DATA_CHANGED_FINISHED

OF CL_GUI_ALV_GRID

IMPORTING E_MODIFIED

ET_GOOD_CELLS,

I only want to check these changes when a new SAVE button is pushed on the tool bar. How do I check the FCODE for when this button is pressed so the method is only invoked at this button push?

Thanks Mart

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
509

Halo Mart,

Please set a flag when the user presses SAVE Button .

Inside the event handler method of data change u add one more method like perform_checks passing e_data_changed to it.

if my_save_flag eq abap_true .

perform_checks( er_data_changed ).

endif.

Inside this perform_checks method you can do all the validations.

One more idea is you can check for sy-ucomm eq 'SAVE'.

Regards

Arshad

2 REPLIES 2
Read only

Former Member
0 Likes
510

Halo Mart,

Please set a flag when the user presses SAVE Button .

Inside the event handler method of data change u add one more method like perform_checks passing e_data_changed to it.

if my_save_flag eq abap_true .

perform_checks( er_data_changed ).

endif.

Inside this perform_checks method you can do all the validations.

One more idea is you can check for sy-ucomm eq 'SAVE'.

Regards

Arshad

Read only

Former Member
0 Likes
509

Hi Mart,

On the push of save button call the following method of the class cl_gui_alv_grid.

CALL METHOD g_grid->check_changed_data

IMPORTING

e_valid = w_valid

  • CHANGING

  • c_refresh = c_x

.

Other than that you can suppress the log message from coming by calling following method inside the handler of event DATA_CHANGED.

CALL METHOD us_data_changed->refresh_protocol .

I have tried this and this had worked for me.

Regards

Avinash