zoukankan      html  css  js  c++  java
  • SAP CDS view自学教程之二:当SAP CDS view被激活时,背后发生了什么

    You paste the following source code for a simple CDS view into ABAP development studio and activate it:

    @AbapCatalog.sqlViewName: 'zjerrySQL0208'
    @AbapCatalog.compiler.compareFilter: true
    @AccessControl.authorizationCheck: #CHECK
    @EndUserText.label: 'test 233'
    @ObjectModel: {
       createEnabled,
       deleteEnabled,
       updateEnabled
    }
    define view Zjerrytest20160208
    as select from spfli association [0..1] to scarr as _scarr
    on _scarr.carrid = spfli.carrid {
           key spfli.carrid,
           key _scarr.carrname,
           key spfli.connid,
           spfli.cityfrom,
           spfli.cityto
    }
    

    And you would like to know what objects are automatically generated during CDS view activation.

    Automatically generated ABAP objects during CDS view activation
    You could query table TADIR with following parameters:

    And get answer:
    DDLS: Data Definition Language SourceSTOB: Structured Object

    The relationship among these objects is listed below:

    And if you use the same approach described in tutorial part1, you can realize that lots of database tables “DD*” are involved during CDS view activation, for exampleDDLDEPENDENCY. A small tip here is, if you click “Display Object List” button, you will navigate to the package where other related ABAP artifacts within the same package are displayed as well.


    Now we can go through each database table one by one.

    Automatically inserted table entries during CDS view activation

    Several table entries are inserted to the database tables in package SDDL during view activation.

    DDDDLSRC

    Query this table by specifying DDLNAME as CDS view name we specified in ABAP development studio, the name after keyword “define view” : Zjerrytest20160208, and we can find view source code stored in field SOURCE.

    DDDDLSRC02BT
    Text table which stores the view description specified via annotation@EndUserText.label.

    DDHEADANNO

    It stores all header annotation specified in CDS view source code with corresponding value.

    DDLDEPENDENCY

    It maintains relationship between the CDS core entity and automatically generated database view.

    要获取更多Jerry的原创文章,请关注公众号"汪子熙":

  • 相关阅读:
    JSON 字符串 与 java 对象的转换
    DNS解析过程详解
    全面了解移动端DNS域名劫持等杂症:原理、根源、HttpDNS解决方案等
    TCP Send函数的阻塞和非阻塞,以及TCP发送数据的异常情况
    基于TCP协议的应用层的ACK机制
    Golang的反射reflect深入理解和示例
    C/C++中struct中内存对齐规则
    Go 包依赖管理工具 —— govendor
    什么是幂等?什么情况下需要考虑幂等?怎么解决幂等的问题?
    Golang 中间件简介 MiddleWare
  • 原文地址:https://www.cnblogs.com/sap-jerry/p/13639055.html
Copyright © 2011-2022 走看看