前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >一步步创建ABAP CDS view

一步步创建ABAP CDS view

作者头像
Jerry Wang
发布2020-01-21 15:19:43
1.1K0
发布2020-01-21 15:19:43
举报
  1. Add AG3 or ER9 in your local SAPGUI.
  1. Open your ABAP Studio:

Select the system where you will work:

Click next:

Once done, you can find your new project:

  1. Create your own package in SAPGUI:

And add it to favourite:

  1. 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的原创文章,请关注公众号"汪子熙":

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-01-01 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Test
  • Guideline
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档