从 ABAP 表单中删除默认值
我有一个用于在表中创建新记录的屏幕,它包含一个包含所有数据库列的表单。问题是,一旦调用屏幕,它就会包含最后的数据库记录。因此,要添加新记录,您必须先清空当前值。
知道如何摆脱这个吗?
I have a screen for creating new records in a table, it contains a form with all the database columns. Problem is, once the screen is called, it has the last database record in it. So to add a new record, you have to empty the current values first.
Any idea how to get rid of this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
发生这种情况的唯一方法是您首先在字段中选择值。假设您已在程序中声明了与表相同类型的结构(可能使用 TABLES 语句),并在屏幕上对字段进行了相同的命名,并且您正在将值选择到结构中。
如果是这种情况,您只需发出 CLEAR 即可,它将清除结构中的所有字段。 (您可以在上次更新后直接执行此操作)。
然而,如果没有程序和屏幕代码的示例,就很难判断。
The only way that this could happen is if you are selecting values into the fields in the first place. Presumably you have declared the a structure of the same type as the table (possibly with a TABLES statement) in your program and have named the fields the same on the screen, and you are selecting values into the structure.
If this is the case, you can simply issue CLEAR and it will clear all the fields in the structure. (You could do this directly after the last update).
It is difficult to tell, however, without a sample of your program and screen code.
我非常同意 mydoghasworms 的回答。
注释一,当你找到表格时,一定要清除 itab[],当表格带有标题时。
我昨天遇到了同样的问题,当我清除屏幕上的表格时它就起作用了。
I can't agree more with mydoghasworms's answer.
One comment, when you find the table, make sure to CLEAR itab[], when the table with header.
I encountered the same issue yesterday, and it works when I cleared the table on the screen.