ALV 刷新

ABAP里ALV有两种方式实现,一种方式是CALL FUNCTION: REUSE_ALV_GRID_DISPLAY, 标准按钮是包含刷新设置的,但是如果自定义功能,也就是需要设置USER_COMMAND CALL BACK程序的时候,需要对参数SELFIELD-REFRESH值设置为’X',这样ALV的数据就会刷新显示。
第二种方式是Call Screen,防止一个custom container,再添加一个CL_GUI_ALV_GRID控件,这种方式实现的ALV刷新需要CALL METHOD Grid 空间的REFRESH_TABLE_DISPLAY方法,需要注意的是,如果Grid Control所在屏幕没有切换就要显示刷新后的数据,需要再调用 CL_GUI_CFW=>FLUSH方法,才能看到刷新后的结果。原因是REFRESH_TABLE_DISPLAY虽然刷新的界面,但是SAP GUI并不是实时更新,而是将更新的结果放在缓存中,手动调用CL_GUI_CFW=>FLUSH才能触发SAP GUI更新界面,看到刷新的结果。
有人说可以先FREE掉控件,再重新创建,这是完全没有必要的。
参考:
SAP Library (关于FLUSH命令)
ITToolBIX (关于FLUSH命令)
What is the function of the "FLUSH" command in ABAP? Is it similar to "REFRESH" or "CLEAR"?
In OO approach, calling a Control-method does not imply that the method is automatically executed at runtime. Initially, the system buffers methods in a queue, referred to as the Automation Queue, when they are called in the ABAP program. The execution sequence of the methods therefore remains unchanged. However, the methods are only executed if they are transferred to the frontend via Remote Function Call (RFC) using method FLUSH. This means that the Automation Queue is used to reduce the number of RFC calls required.
(Due to the buffering of control methods in the Automation Queue, the method calls and the remaining ABAP code are executed at different times. Method FLUSH thus determines a synchronization point).
While communicating between the Automation Controller and the ABAP Objects Control Framework the automation queue uses GUI RFC calls. To minimize the network load between the backend and frontend, calls from the backend to the frontend are buffered and sent to the frontend in a single batch at defined synchronization points. A synchronization point occurs when you use a method call that is not buffered or explicitly call the generic synchronization method ( CALL METHOD cl_gui_cfw=>flush ).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值