zoukankan      html  css  js  c++  java
  • ABAP CDS

    Syntax

    ... ( name1, name2, ... ) ...

    Effect

    Defines the element names of a CDS view in ABAP CDS in a name list. The specified names name1, name2, ... are assigned to the elements defined explicitly in the SELECT list of the SELECT statement in the order given. The names function like the alternative names defined in the SELECT list using AS and overwrite these names. If a name list is specified, it must contain a name for each element of the view.

    The view field is created under the element name in the CDS database view. Accordingly, an element name must comply with the rules for names of view fields of database views, as well as the general naming rules for names:

    which means that it must also meet the

    • cannot be a reserved component name. The reserved names that cannot be used are in the database table TRESE.

    A name list can be specified only if the elements in the SELECT list are specified explicitly. No name lists can be used if the SELECT list is specified as * or if the element list contains the entry $EXTENSION.*.

    Notes

    • An explicit name list can be used, for example, to define the element names of a CDS view that defines a union set of multiple SELECT statements using UNION.
    • A CDS view with an explicit name list cannot be expanded using EXTEND VIEW.

    Example

    Defines the names of the four elements of the CDS view business_partner as id, role, company_name, and phone_number.

    @AbapCatalog.sqlViewName: 'BPA_VW'
    define view business_partner
      (id, role, company_name, phone_number) as
      select from snwd_bpa
             { key snwd_bpa.bp_id,
                   snwd_bpa.bp_role,
                   snwd_bpa.company_name,
                   snwd_bpa.phone_number }

    Example

    Defines the names of the three elements of the CDS view employee_sales_figures as financial_year, employee_id, and gross_amount.

    @AbapCatalog.sqlViewName: 'SALES_FIG_VW'
    view employee_sales_figures
      (financial_year, employee_id, gross_amount) as
       select from sales_2011_tab
              { key '2011' as year,
                key id,
                amount }
       union
         select from sales_2012_tab
                { '2012' as year,
                  employee_number,
                  gross_amount }
  • 相关阅读:
    酱茄WordPress社区论坛圈子小程序为解决用户活跃变现而生
    太顶了!爆肝3.5W字长文Java 集合!(建议收藏)
    美团二面:内存耗尽后Redis会发生什么?
    UE4_C++自定义log
    python3进制转换
    UE4蓝图Blueprint->组件->TreeView/ListView
    C++,win编程
    2020-11-11
    b站视频详情数据抓取,自动打包并发送到指定邮箱(单个或者群发)
    BiLiBiLi爬虫
  • 原文地址:https://www.cnblogs.com/JackeyLove/p/13496802.html
Copyright © 2011-2022 走看看