- 内表可以作为SQL查询的数据源
select *
from tj02t
into table @data(lt_status).
select single istat
from @lt_status as t
where istat eq 'I0045'
into @data(lv_status_teco).
- 新方法CL_ABAP_ITAB_UTILITIES=>VIRTUAL_SORT ()实现内表排序,返回结果是最终排序的行索引
DATA(v_index) =
cl_abap_itab_utilities=>virtual_sort(
im_virtual_source = VALUE #(
( source = REF #( itab )
components = VALUE #( ( name = 'col1' )
( name = 'col2' ) ) ) ) ).
- SQL函数 BINTOHEX / HEXTOBIN 实现字节(16进制)和字符(二进制)之间的强制转换(无法用CAST做到)
select single id as uuid32, hextobin( id ) as uuid16
from iwreferenc
where tcode = 'SE38'
into @data(wa).
if sy-subrc = 0.
data uuid16 like wa-uuid16.
cl_system_uuid=>convert_uuid_c32_static(
exporting
uuid = wa-uuid32
importing
uuid_x16 = uuid16 ).
assert wa-uuid16 = uuid16.
endif.
cl_demo_output=>display_data( wa ).
结果:可以看到是不同的类型
- 注解WITH PRIVILEGED ACCESS 可以关闭 CDS access control
"将取出所有的记录
SELECT *
FROM demo_cds_auth_literal WITH PRIVILEGED ACCESS
ORDER BY carrid
INTO TABLE @DATA(result).
cl_demo_output=>display( result ).
- 左外连接支持TO ONE 和 TO MANY来定义基数
- 子查询中支持使用ORDER BY and UP TO, OFFSET
- CDS annotations可以用DDLA定义为独立的CDS对象
- 推出对ABAP Daemons的支持