简体   繁体   English

删除一行后刷新ALV网格

[英]Refresh ALV grid after deleting a row

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( ).我用过alv->refresh( ). but this does not work for me.但这对我不起作用。 Is there a way to refresh the screen properly?有没有办法正确刷新屏幕?

the refresh method has to have an importing parameter called is_stable. refresh 方法必须有一个名为 is_stable 的导入参数。 This structure has two fields (rwo and col) set both to 'X':此结构有两个字段(rwo 和 col)都设置为“X”:

alv->refresh( is_stable = 'XX' ).

If the answer above doesn't work, you can use this method, it gets current ALV from global memory.如果上面的答案不起作用,您可以使用此方法,它从全局内存中获取当前的 ALV。

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.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM