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 }

ABAP CDS - DEFINE VIEW, name_list的更多相关文章

  1. ABAP CDS - DEFINE VIEW, view_annot

    Syntax ... @annotation ... Effect Specifies Annotation annotation in the definition of a CDS view of ...

  2. ABAP CDS - Syntax

    The syntax of the DDL and of the DCL of the ABAP CDS comprises elements of the general DDL and DCL o ...

  3. Create Fiori List App Report with ABAP CDS view – PART 1

    From Create Fiori List App Report with ABAP CDS view – PART 1 In this blog, I am going to show How C ...

  4. Create Fiori List App Report with ABAP CDS view – PART 2

    In the Part 1 blog, we have discussed below topics CDS annotations for Fiori List Report. How to cre ...

  5. 教程:基于访问控制的ABAP CDS视图权限

    Hi! 对每一个CDS视图,我们都可以通过DCL(Data Control Language)定义访问控制.在这篇文章中,我会介绍ABAP CDS视图中非常重要的一面:权限管理. 本文的阐述基于我正在 ...

  6. CDS测试框架介绍:如何为ABAP CDS Entities写测试

    动机 现在大家都知道单元测试对我们代码的好处.并且我们都承认它是开发过程中不可或缺的一部分.但是在把代码切换到数据库的模式下的时候,我们被粗暴地打回了软件测试的黑暗年代...我们现在面临着逻辑下推到A ...

  7. 使用PlanViz进行ABAP CDS性能分析

    如管理学学者彼得·德鲁克所说:你无法管理你不能衡量的东西( If you can't measure it, you can't manage it).要对已有程序进行性能优化,首先要对它的运行状况做 ...

  8. 【ABAP CDS系列】ABAP CDS中的系统信息

    公众号:SAP Technical 本文作者:matinal 原文出处:http://www.cnblogs.com/SAPmatinal/ 原文链接:[ABAP CDS系列]ABAP CDS中的系统 ...

  9. ABAP CDS 替换对象(Replacement Objects)引起的数据错误

    最近遇到了一个诡异的问题:从CDS视图中取得的数据,和从透明表中取得的数据,会有不同的值.在这里记录下问题的表现和解决方案,以供参考. 系统版本:S/4HANA OP1610 涉及表:MCHB 本文链 ...

随机推荐

  1. JVM诊断及工具笔记(4) 使用visualvm分析JVM堆内存泄漏

    在这里感谢最近一直阅读我文章的小伙伴,如果觉得文章对你有用,可以帮忙关注转载,需要的时候可以及时找到文章. 背景 今年Q3季度我们在推广业务方使用Iceberg,当时为了让不同业务线的用户可以使用自己 ...

  2. 日志、第三方模块(openpyxl模块)

    目录 1.日志模块 2.第三方模块 内容 日志模块 1.日志模块的主要组成部分 1.logger对象:产生日志 无包装的产品 import logging logger = logging.getLo ...

  3. 解决pycharm的爬虫乱码问题(初步了解各种编码格式)

    Ascii码(American Standard Code for Information Interchange,美国信息互换标准代码):最初计算机只在美国使用时,只用8位的字节来组合出256(2的 ...

  4. 9.Jenkins进阶之流水线pipeline基础使用实践(2)

    目录一览: 0x01 基础实践 0x02 进阶实践 (1) Sonarqube 代码质量检测之 Pipeline Script from SCM (2) Gitlab 自动触发构建之 Pipeline ...

  5. C#/VB.NET 将RTF转为HTML

    RTF文档即富文本格式(Rich Text Format)的文档.我们在处理文件时,遇到需要对文档格式进行转换时,可以将RTF转为其他格式,如转为DOCX/DOC.PDF或者HTML,以满足程序设计需 ...

  6. Jx.Cms开发笔记(四)-改造Card组件

    在Blazor 组件库 BootstrapBlazor 中Card组件介绍中我们说过,如果我们使用了Card组件的IsCollapsible属性设置了可伸缩的话,就只能使用Text属性来设置标题文本, ...

  7. python基础练习题(题目 打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,其各位数字立方和等于该数本身)

    day8 --------------------------------------------------------------- 实例013:所有水仙花数 题目 打印出所有的"水仙花 ...

  8. 撸了一个 Feign 增强包 V2.0 升级版

    前言 大概在两年前我写过一篇 撸了一个 Feign 增强包,当时准备是利用 SpringBoot + K8s 构建应用,这个库可以类似于 SpringCloud 那样结合 SpringBoot 使用声 ...

  9. OpenHarmony 3GPP协议开发深度剖析——一文读懂RIL

    (以下内容来自开发者分享,不代表 OpenHarmony 项目群工作委员会观点)本文转载自:https://harmonyos.51cto.com/posts/10608 夏德旺 软通动力信息技术(集 ...

  10. Python | 内置函数(BIF)

    Python内置函数 | V3.9.1 | 共计155个 还没学完, 还没记录完, 不知道自己能不能坚持记录下去 1.ArithmeticError 2.AssertionError 3.Attrib ...