SAP NetWeaver ABAP 服务器的数据库表database table暴露为CDS View
去参考:SAP Tutorial Create a Simple CDS View in ADT
有了数据库表,现在琢磨下,把table暴露为CDS View(将来 暴露为OData)
自动生成的代码:
@AbapCatalog.sqlViewName: ''
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'abap-dev-adt-create-cds-view.html'
define view Z_ACCOUNT_ITEMS_001 as select from data_source_name {
}
修改后的代码
@AbapCatalog.sqlViewName: 'Z_ACC_ITEMS_001'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'abap-dev-adt-create-cds-view.html'
define view Z_ACCOUNT_ITEMS_001 as select from zaccounts_001 {
zaccounts_001.account_name,
zaccounts_001.account_number,
zaccounts_001.city
}
where city = 'new york'
看看原始数据库表里面有几条数据?3条
看看CDS View里面有几条数据?