一步步创建ABAP CDS view
- Add AG3 or ER9 in your local SAPGUI.
- Open your ABAP Studio:
Select the system where you will work:
Click next:
Once done, you can find your new project:
- Create your own package in SAPGUI:
And add it to favourite:
- right click $ZCDS, create new DDL Source via context menu:
Paste the following source code:
@AbapCatalog.sqlViewName: 'zjerrySQLView'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'this is description'
define view Zjerrytest20160309(
id,
carrier,
flight,
departure,
destination
)
as select from spfli
join scarr on scarr.carrid = spfli.carrid
{
key spfli.carrid,
key scarr.carrname,
key spfli.connid,
spfli.cityfrom,
spfli.cityto
}
Activate your CDS view:
Test
or
Difference between lt_wrong and lt_right is that the former also contains a column with client field, which is not needed in application handling. Always use the approach indicated by lt_right.
Guideline
In the above example, the CDS database view zjerrysqlview serves mainly the internal technical purpose to realize the view in the dictionary. You can, but you should not use it in ABAP programs. Instead, you work with the CDS entity, whose name is defined behind DEFINE VIEW. In the example it is zjerrytest20160309. Only the entity carries the full capabilities of the CDS view, like semantical information, client handling, connection to authority checks (planned), and so on. You can use the CDS entity behind TYPE for declaring work areas and in Open SQL in ABAP programs.
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关文章
- 在openstack云平台中,使用命令行创建云主机操作步骤
- 如何给表维护视图创建选择画面[VIEW_RANGETAB_TO_SELLIST]详解编程语言
- 如何从维护视图(Maintenace view)中取数据-[VIEW_GET_DATA]详解编程语言
- Eclipse创建Servlet项目
- 在 Linux 中创建静态库并进行链接(linux静态库链接)
- Linux创建备份:简单步骤轻松实现(linux创建备份文件)
- MySQL驱动类——创建数据库连接的稳健方式(mysql驱动类)
- 深入浅出Linux的View命令(linux之view命令)
- 使用Redis实现数据库的创建与管理(redis如何创建数据库)
- 如何在 Linux 中创建/配置 LVM(逻辑卷管理)
- Linux KVM开发技术:快速创建虚拟化环境(linux kvm 开发)
- 如何在MySQL中创建参数(mysql中参数如何创建)
- 深入理解MySQL如何创建表的结构(mysql中创建表的结构)
- 使用Vue和Redis创建完美的后台应用(vue redis后台)