将 SELECT 结果分配给字段符号 GETWA_NOT_ASSIGNED
我很困惑为什么注释掉的查询不起作用。
REPORT z_hello_world_local.
TYPES: BEGIN OF bkpf_type,
xblnr TYPE bkpf-xblnr,
END OF bkpf_type.
DATA: t_bkpf TYPE TABLE OF bkpf_type.
FIELD-SYMBOLS: <bkpf> TYPE bkpf_type.
*This query does not work?
*SELECT xblnr
* INTO CORRESPONDING FIELDS OF <bkpf> UP TO 1 ROWS
* FROM bkpf
* WHERE belnr = '1800001017'.
* ENDSELECT.
*
DATA: t_xblnr TYPE bkpf-xblnr.
*This query works and in my head it is roughly the same thing.
SELECT SINGLE xblnr
INTO t_xblnr
FROM bkpf
WHERE belnr = '1800001017'.
write 'Done'.
如果我运行注释掉的查询,我会收到错误:
运行时错误 GETWA_NOT_ASSIGNED 日期和时间
2009年8月26日19:54:19短文本 尚未分配字段符号。
为什么我会收到此运行时错误?
I am confused as to why the commented out query doesn't work.
REPORT z_hello_world_local.
TYPES: BEGIN OF bkpf_type,
xblnr TYPE bkpf-xblnr,
END OF bkpf_type.
DATA: t_bkpf TYPE TABLE OF bkpf_type.
FIELD-SYMBOLS: <bkpf> TYPE bkpf_type.
*This query does not work?
*SELECT xblnr
* INTO CORRESPONDING FIELDS OF <bkpf> UP TO 1 ROWS
* FROM bkpf
* WHERE belnr = '1800001017'.
* ENDSELECT.
*
DATA: t_xblnr TYPE bkpf-xblnr.
*This query works and in my head it is roughly the same thing.
SELECT SINGLE xblnr
INTO t_xblnr
FROM bkpf
WHERE belnr = '1800001017'.
write 'Done'.
If I run the commented out query I get the error:
Runtime Errors GETWA_NOT_ASSIGNED Date and Time
08/26/2009 19:54:19Short text
Field symbol has not yet been assigned.
Why do I get this runtime error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设(基于错误和我实际上看不到的代码片段)您正在尝试将数据直接选择到字段符号中。你不能那样做。字段符号不是内存区域,它(基本上)是指针。
您可以执行以下操作之一:
或者
在这种情况下,您将字段符号指向已添加到内部表中的新行。
或者
在这种情况下,您将检索所有匹配的文档并将它们直接放入您的内部表中。
I assume (based on the error and the pieces of code that I can't actually see) that you're trying to select data directly into a field symbol. You can't do that. A field symbol is not a memory area, it is (basically) a pointer.
You could do one of the following:
or
In this case, you are pointing the field symbol to a new line that you've added to the internal table.
or
In this case, you will retrieve all documents that match and place them directly into your internal table.