0

So after I deleted a specific row in a database Table, it isn't removed on my screen. I have to end the programm and start it again to see the changes. I've used alv->refresh( ). but this does not work for me. Is there a way to refresh the screen properly?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Kevin Mueller
  • 628
  • 3
  • 10
  • 23
  • 1
    Possible duplicate of [ABAP - ALV delete selected row](https://stackoverflow.com/questions/48667607/abap-alv-delete-selected-row) – vwegert Feb 11 '18 at 15:27
  • Please refrain from asking serial questions without posting answers to the ones you already solved and without making the connections clear. – vwegert Feb 11 '18 at 15:28

2 Answers2

1

the refresh method has to have an importing parameter called is_stable. This structure has two fields (rwo and col) set both to 'X':

alv->refresh( is_stable = 'XX' ).
József Szikszai
  • 4,791
  • 3
  • 14
  • 24
  • Stable is only to be used for keeping the position of the ALV (positions of scrollbars unchanged) and recalculating totals and so on. REFRESH is sufficient to flush the values of the ALV table (rows, columns, cells) to the screen. – Sandra Rossi Feb 08 '18 at 21:05
0

If the answer above doesn't work, you can use this method, it gets current ALV from global memory.

METHOD refresh_alv.
  DATA: ref_grid TYPE REF TO cl_gui_alv_grid, valid TYPE c.
  IF ref_grid IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
      IMPORTING
        e_grid = ref_grid.
  ENDIF.

  IF NOT ref_grid IS INITIAL.
    ref_grid->check_changed_data(
       IMPORTING
         e_valid = valid ).
  ENDIF.

  IF valid IS NOT INITIAL.
    ref_grid->refresh_table_display( ) .
  ENDIF.
ENDMETHOD.