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. Java学习day29

    线程礼让(yield):礼让线程,让当前正在执行的线程暂停,但是不阻塞:让线程从运行状态转为就绪状态:让CPU重新调度,礼让不一定成功 合并线程(join):待此线程执行完毕后,再执行其他线程,其他线 ...

  2. Linux(ubuntu)二进制安装mysql8.0

    mysql官方网站下载地址:https://dev.mysql.com/downloads/mysql/ 1.创建mysql运行用户和组 groupadd -g 1001 mysql useradd ...

  3. 登录口爆破之ldap的md5加密、验证码认证

    ldap的md5加密配合autoDecoder插件.captcha-killer-modified插件 autoDecoder例 需要传入的数据包为: {"username":&q ...

  4. [AcWing 36] 合并两个排序的链表

    点击查看代码 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * L ...

  5. 『现学现忘』Git基础 — 18、Git对象的总结

    目录 1.Git操作最基本的流程 2.工作目录中文件的状态 3.Git效率说明 提示:前面三篇文章已经分别的对blob对象.tree对象.commit对象进行了详细的说明,这篇文章我们总结一下,Git ...

  6. java基础4.19

    1.JAVA 的反射机制的原理. JAVA反射机制是在运行状态中,对于任意一个类,都能够知道这个类的所有属性和方法:对于任意一个对象,都能够调用它的任意一个方法:这种动态获取的信息以及动态调用对象的方 ...

  7. 243张图片为你解析轻量级自动运维化工具Ansible

    Ansible 是什么 ? ansible架构图 ansible特性  模块化:调用特定的模块,完成特定的任务: 基于Python语言研发,由Paramiko, PyYAML和Jinja2三个核心库实 ...

  8. 渗透:dSploit

    dSploit--开源的专业的Android平台安全管理工具包 只能在横屏模式下工作,即使你旋转你的设备也将继续保持横屏,如果你有一个应用程序,如旋转控制器,迫使每一个应用程序旋转,将导致dSploi ...

  9. 706. Design HashMap - LeetCode

    Question 706. Design HashMap Solution 题目大意:构造一个hashmap 思路:讨个巧,只要求key是int,哈希函数选择f(x)=x,规定key最大为100000 ...

  10. Java线程同步操作

    synchronized 作用于对象实例:对给定对象加锁,进入同步代码前要获得给定对象的锁. 作用于实例方法:相当于对当前实例加锁,进入同步代码前要获得当前实例的锁. 作用于静态方法:相当于对当前类加 ...