ALV Grid 不刷新 [英] ALV Grid is not refreshed

查看:16
本文介绍了ALV Grid 不刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的模块池程序中有两个屏幕(屏幕 A 和屏幕 B).屏幕A显示ALV网格,工具栏上有1个按钮,屏幕B也显示ALV网格和工具栏上的1个按钮.

I have two screens (screen A and screen B) in my module pool program. Screen A displays ALV grid and has 1 button on the toolbar and Screen B also displays ALV grid and 1 button on the toolbar.

当我按下显示订单"按钮时在屏幕 A 上,我被定向到屏幕 B.然后我在屏幕 B 上进行一些编辑操作,单击工具栏上的保存"按钮,然后单击返回"按钮.

When I press the button "Show orders" on screen A, I am directed to the screen B. Then I do some edit operations on screen B, click 'Save' button on the toolbar and then 'Back' button.

当我按下显示订单"按钮时在不同行的屏幕 A 上,我再次被定向到屏幕 B,但 ALV 网格仍然显示来自第一个材料的数据,即它不显示新数据,而是显示旧数据.

When I press the button "Show orders" on screen A for a different row, I am directed to the screen B again, but ALV grid still shows data from the first material, i.e. it doesn't display new data, but displays old data.

它是否与 cl_gui_cfw=>flush 方法有关?如果是,那么我应该在代码中的哪个位置调用它以显示正确的数据?

Does it have to do with cl_gui_cfw=>flush method somehow? If yes, then where exactly in the code should I call it in order to display correct data?

屏幕 B 的 PBO 模块.

PBO module of Screen B.

CREATE OBJECT zclmz_pp_md_create=>go_container_charg
  EXPORTING
    parent    = cl_gui_container=>screen0
    side      = cl_gui_docking_container=>dock_at_top
    extension = 800.

CREATE OBJECT zclmz_pp_md_create=>go_alv_charg
  EXPORTING
    i_parent = zclmz_pp_md_create=>go_container_charg.

zclmz_pp_md_create=>go_alv_charg->set_table_for_first_display( EXPORTING 
is_layout  = ls_layout CHANGING  it_outtab  =  zclmz_pp_md_create=>gs_plz- 
charg  it_fieldcatalog  = lt_fieldcat ).

屏幕 B 的 PAI 模块.

PAI module of Screen B.

zclmz_pp_md_create=>go_alv_charg->refresh_table_display( EXPORTING is_stable = ls_stable ).

CALL METHOD cl_gui_cfw=>flush.

推荐答案

refresh_table_display 方法应该在屏幕 B 的 PBO 中调用,而不是在 PAI 中.

Method refresh_table_display should be called in the PBO of screen B, not in the PAI.

IF zclmz_pp_md_create=>go_alv_charg is NOT BOUND.
    CREATE OBJECT zclmz_pp_md_create=>go_container_charg
    EXPORTING
        parent    = cl_gui_container=>screen0
        side      = cl_gui_docking_container=>dock_at_top
        extension = 800.

    CREATE OBJECT zclmz_pp_md_create=>go_alv_charg
    EXPORTING
        i_parent = zclmz_pp_md_create=>go_container_charg.

    zclmz_pp_md_create=>go_alv_charg->set_table_for_first_display( EXPORTING 
    is_layout  = ls_layout CHANGING  it_outtab  =  zclmz_pp_md_create=>gs_plz- 
    charg  it_fieldcatalog  = lt_fieldcat ).
ELSE.
 zclmz_pp_md_create=>go_alv_charg->refresh_table_display( ).
ENDIF.

这篇关于ALV Grid 不刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆