简体   繁体   English

SELECT FROM @itab 导致语法错误。 为什么?

[英]SELECT FROM @itab causes syntax error. Why?

I try to use SELECT FROM @itab like explained here in SAP docs .我尝试使用SELECT FROM @itab就像在 SAP 文档中解释的那样。

I have never used this feature, but think this is great.我从未使用过此功能,但认为这很棒。 You can query a internal data structure which just exists in the RAM of the interpreter like it would be a real table in the database.您可以查询仅存在于解释器 RAM 中的内部数据结构,就像它是数据库中的真实表一样。 I am impressed.我很佩服。

Here is the ABAP code:这是ABAP代码:

data: lt_get_auth_values TYPE STANDARD TABLE OF US335.

CALL FUNCTION 'GET_AUTH_VALUES'
     EXPORTING
            OBJECT1 = 'Z:FOO'
            USER    = sy-uname
     TABLES
            VALUES  = lt_get_auth_values.

SELECT highval from @lt_get_auth_values as mytab WHERE field = 'WERKS' 
        INTO TABLE @DATA(static_perm_filter_fields).

I can't active the function because "from @lt_get_auth_values" is a syntax error according to my system.我无法激活该功能,因为根据我的系统,“来自@lt_get_auth_values”是语法错误。

What's wrong with this line?这条线有什么问题?

SAP Version: 740 (sorry, it first I thought it was 752) SAP 版本:740(抱歉,我一开始以为是 752)

SELECT ... FROM @itab appeared in 7.52 so it should work. SELECT ... FROM @itab出现在7.52 中,所以它应该可以工作。

On my 7.52 system it works but you must indicate a table alias .在我的 7.52 系统上它可以工作,但您必须指明表别名 There's an example in the ABAP documentation (cf first link above). ABAP 文档中有一个示例(参见上面的第一个链接)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM