操作后刷新表控件
我有一个带有 表格控件的屏幕 其中(使用 Screen Painter 生成)显示数据库表中的记录。屏幕还有一个按钮,单击时会显示一个弹出窗口。弹出窗口有一个表单可以将记录添加到数据库表中。
提交表单时,记录将添加到数据库中,但是当弹出窗口关闭时,显示数据库记录的屏幕不会刷新,即不会显示新记录。仅仅再次调用屏幕似乎不起作用。
如何刷新表控件以显示新记录?
I have a screen with a table control in it (generated with the Screen Painter) that shows records from a database table. The screen also has a button, which shows a popup when it's clicked. The popup has a form to add a record to the database table.
When the form is submitted the record is added to the database, but when the popup is closed, the screen that shows the database records isn't refreshed i.e. the new record isn't shown. Simply calling the screen again doesn't seem to work.
How to refresh the table control to show the new record?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
仅仅因为您的表引用数据库字段并不意味着它将自动更新/填充以反映数据库的状态。
您需要在显示屏幕之前发生的 PBO(输出前处理)事件期间以编程方式填充该表。
要了解其工作原理,您可能需要花一些时间了解 ABAP dynpros(屏幕)中的表控件。这是一个很好的起点:
http://help。 sap.com/saphelp_nw04/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/frameset.htm
Just because your table refers to database fields does not mean it will be updated/populated automatically to reflect the state of the database.
You need to programmatically populate the table during the PBO (Process Before Output) event that occurs before the screen is displayed.
To gain an understanding of how this works, you may need to spend some time understanding table controls in ABAP dynpros (screens). Here is a good place to get started:
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/frameset.htm
您必须确保要显示的数据实际上位于屏幕显示的内部表中。
如果内表具有所有数据,但仍然没有显示在表控件中,请确保更新表控件中包含行数的字段以反映额外的行。
You have to make sure that the data that you want to display is actually in the internal table that is displayed by the screen.
If the internal table has all the data, but it still does not display in the table control, make sure that the field in the table control that has the number of lines is updated to reflect the extra line.
添加新行后,请务必更新表格视图的lines 变量。
Be sure to update the lines variable of your tableview after adding the new line.