Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

ALV grid with editable fields + totals

Hi all, I have this problem,

I have an ALV built with the OOP, I have an editable quantity fields, and a totals related to it.

When I modify the quantity the totals doesn't refresh correctly, I have tried to force the refresh of the ALV but I was not able to solve this problem.

Thank you

Former Member
Former Member replied


You must be using the method handle_data_changed to monitor the change data event.

This method populated the changed data in table er_data_changed.

Use this table to capture the modified fields and read the internal table values corresponding to that row, and update your internal table. Then refresh the ALV display.

This way, you are reverting the updated values to your internal table and thus both ER_DATA_CHANGED table and ITAB are in sync.

Please consider sample code below :

*Handler to Check the Data Change

handle_data_changed FOR EVENT data_changed

OF cl_gui_alv_grid

IMPORTING er_data_changed




  • Method Implementation

METHOD handle_data_changed.

PERFORM handle_data_changed USING er_data_changed.



FORM handle_data_changed USING p_data_changed TYPE REF TO


DATA : l_mod_cell TYPE lvc_s_modi,

l_value TYPE lvc_value,

l_field TYPE lvc_fname.

SORT p_data_changed->mt_mod_cells BY row_id.

LOOP AT p_data_changed->mt_mod_cells INTO l_mod_cell where fieldname = 'AUFNR'.

CALL METHOD p_data_changed->get_cell_value

EXPORTING i_row_id = l_mod_cell-row_id

i_fieldname = 'AUFNR'

IMPORTING e_value = l_value .

  • Read ITAB for field

READ TABLE ITAB INDEX l_mod_cell-row_id.

if sy-subrc eq 0.

  • replace value with changed value from ALV Grid

itab-aufnr = l_value.

update itab.


  • Refresh ALV Grid

CALL METHOD gr_alvgrid->refresh_table_display


0 View this answer in context

Helpful Answer

Not what you were looking for? View more on this topic or Ask a question