现在可以将内表指定为查询语句的数据源。如果内表数据需要传递给数据库的话,只能在部分数据库上运行。
例子:
DATA itab TYPE HASHED TABLE OF scarr WITH UNIQUE KEY mandt carrid. IF NOT cl_abap_dbfeatures=>use_features( EXPORTING requested_features = VALUE #( ( cl_abap_dbfeatures=>itabs_in_from_clause ) ) ). cl_demo_output=>display( `System does not support internal tables as data source` ). RETURN. ENDIF. itab = VALUE #( ( carrid = 'LH' carrname = 'L.H.' ) ( carrid = 'UA' carrname = 'U.A.' ) ). SELECT scarr~carrid, scarr~carrname, spfli~connid FROM @itab AS scarr INNER JOIN spfli ON scarr~carrid = spfli~carrid INTO TABLE @DATA(result) ##db_feature_mode[itabs_in_from_clause]. cl_demo_output=>display( result ).