我想从表zbookings
中选择一行包含所有列的行。 zbookings
表的结构基于zbooking
数据结构-请参见下表。
我的BOOKINGSET_GET_ENTITY
方法:
method BOOKINGSET_GET_ENTITY.
DATA: ls_keytab TYPE LINE OF /IWBEP/T_MGW_NAME_VALUE_PAIR,
i_carrid TYPE string,
i_connid TYPE string,
i_fldate TYPE string,
i_bookid TYPE string.
LOOP AT it_key_tab INTO ls_keytab.
CASE ls_keytab-name.
WHEN 'Carrid'.
i_carrid = ls_keytab-value.
WHEN 'Connid'.
i_connid = ls_keytab-value.
WHEN 'Fldate'.
i_fldate = ls_keytab-value.
WHEN 'Bookid'.
i_bookid = ls_keytab-value.
ENDCASE.
ENDLOOP.
SELECT SINGLE *
INTO CORRESPONDING FIELDS OF er_entity
FROM ybookings AS a
WHERE
a~carrid = i_carrid AND
a~connid = i_connid AND
a~fldate = i_fldate AND
a~bookid = i_bookid.
endmethod.
我通过SAP Gateway Client测试了它。当我从luggweight
语句中删除列SELECT SINGLE *
时,就可以了。但是,当我通过SELECT SINGLE *
选择所有列时,它将输出错误
运行时错误:“ SAPSQL_PARSER_TODO_WARNING”`
<?xml version="1.0" encoding="UTF-8"?>
<error>
<code>SAPSQL_PARSER_TODO_WARNING</code>
<message>Runtime Error: 'SAPSQL_PARSER_TODO_WARNING'.
The OData request processing has been abnormal terminated. If "Runtime Error"
is not initial, launch transaction ST22 for details and analysis. Otherwise,
launch transaction SM21 for system log analysis.</message>
<timestamp>20190905144432</timestamp>
</error>
您可以看到问题出在luggweight
类型的quantity
字段中,其键入方法是Type ref to
。当我通过ctr + F2检查我的BOOKINGSET_GET_ENTITY
方法时,它会输出警告:
聚集函数LUGGWEIGHT的数据库字段或结果类型与“ ER_ENTITY”的组件“ LUGGWEIGHT”不兼容。
如何修改我的SELECT
查询/ BOOKINGSET_GET_ENTITY
方法以使其起作用?
答案 0 :(得分:0)
Luggweight
数据结构时, Types
字段的键入方法应设置为Type ref to
(而不是zbooking
)。