How to trigger the ALV DATA_CHANGE event manually?

vlad-ardelean picture vlad-ardelean · Jun 18, 2013 · Viewed 17.2k times · Source

I have an instance of CL_GUI_ALV_GRID referenced by variable mo_alv_grid.

I have a button column in this grid, which after some logic, updates the table mt_alv_grid (backing mo_alv_grid).

I need to be able to trigger the event DATA_CHANGED at this point.

I have tried many methods of CL_GUI_ALV_GRID, like CHECK_DATA_CHANGED and REFRESH_TABLE_DISPLAY and even CL_GUI_CFW=>FLUSH and CL_GUI_CFW=>SET_NEW_OK_CODE( 'ENTER' ). but none of this has worked.

Is there a way to trigger the DATA_CHANGED event, or should I be doing things completely differently ?

Answer

Eduardo Copat picture Eduardo Copat · Oct 22, 2014

I don't know if this solves your problem, but in order to update the ALV internal table in the PAI, you could use the following method:

DATA lv_entries_are_consisted TYPE abap_bool.
mo_grid->check_changed_data(
  IMPORTING
    e_valid = lv_entries_are_consisted
).