SAP CDS view自学教程之十:SAP CDS view扩展性(Extensibility)实现原理
目录
- Part1 – how to test odata service generated by CDS view
- Part2 – what objects are automatically generate after you activate one CDS view
- Part3 – how is view source in Eclipse converted to ABAP view in the backend
- Part4 – how does annotation @OData.publish work
- Part5 – how to create CDS view which supports navigation in OData service
- Part6 – consume table function in CDS view
- Part7 – unveil the secret of @ObjectModel.readOnly
- Part8 – my summary of different approaches for annotation declaration and generation
- Part9 – cube view and query view
- Part10 – this blog
- Part11 – CDS view test double framework
- Part12 – CDS view source code count tool
- Part13 – CDS view authorization
There is a good blog regarding key user extensibility tool in S4 written by Thomas Schneider.
One of supported feature is customer can easily add new fields to extensible CDS view without knowing technical detail.
For example, if a given CDS view is marked as “UI Reports” extensible in extensibility registration tcode SCFD_REGISTRY,
it means this CDS view would be visible in key user extensibility tool in S4, in tab “UIs and Reports”, so that end user can simply click “Enable Usage” button to add extension field to the view. In the screenshot below, it shows my Extension field “JDK Minimum version” has already been extended to view I_PRODUCTWD.
Now, just use the single line below, and you can read all fields of this view, standard fields and extension fields:
SELECT SINGLE * INTO @DATA(ls_data) FROM i_productwd WHERE
product = 'JAVA'.
So this CDS view extensibility is really easy to use for application developer.
However, how all these whole scenario work under the hood?
When trying to search the source code of extended CDS view by fragment of extension field name JDK, nothing found. This makes sense since none of SAP extensibility tool will directly MODIFY standard object.
Hover the mouse to this small icon in CDS view and you can see lots of extension view, which holds extension fields created by key user tool.
However how could I quickly locate which extension view holds my extension field “JDK Minimum Version”?
Open the SQL view of CDS view I_PRODUCTWD, it is IPRODUCTWD in SE11. Search by keyword JDK and I find the extension field is added to this SQL view via append ZZ1_2CC44DDD3F1C.
Double click this append, then you can find the name of CDS extension view which holds this extension field: ZZ1_PRE47GXHDI6P2ZLO3ADGY4HHFE
Now go back to ABAP studio, locate CDS extension view ZZ1_PRE47GXHDI6P2ZLO3ADGY4HHFE and open it:
Here you can see that in this automatically generated CDS extension view, my extension field are there.
The standard view I_PRODUCTWD is extended by extension view ZZ1_PRE47GXHDI6P2ZLO3ADGY4HHFE via key word “extend view”, as a result the extension field ZZ1_JDKMinimumversion_PRD in ZZ1_PRE47GXHDI6P2ZLO3ADGY4HHFE will also be visible in view ZZ1_PRE47GXHDI6P2ZLO3ADGY4HHFE.
Last question, how and when the extension view ZZ1_PRE47GXHDI6P2ZLO3ADGY4HHFE is generated? We can simply do testing by disable the usage of my extension field on view I_PRODUCTWD by click button “Disable Usage”.
Once done, the extension field disappears from view I_PRODUCTWD,
This observation proves that the extension view will only be generated after we click “Enable Usage” and publish the change. When we click publish button, there are totally 10 enhancements to be generated for my extension field:
The first three rows are CDS extension view to be generated. Double click each and write down detail:
And extension view ZZ1_PRE47GXHDI6P2ZLO3ADGY4HHFE will be generated to extend I_PRODUCTWD:
The left code is responsible to generate extension view which I am not intrested in. What I am curious about is how the internal table mt_enhancements of CL_CFD_ENHANCEMENT_ITERATOR is filled. It is filled in method determine_generation_scope:
In this method, the task to generate CDS extension view for view I_PRODUCTWD is added to enhancement scope, which will be executed later.
All these ten instances will be generated, to make the whole CDS view extensibility work.
- Shiro入门这篇就够了【Shiro的基础知识、回顾URL拦截】
- OFTest(一):如何忽略一些字段在端口poll报文
- Shiro第二篇【授权、整合Spirng、过滤器】
- Ajax数据的爬取(淘女郎为例)
- 在IDEA中编写Spark的WordCount程序
- Shiro第三篇【授权过滤器、与ehcache整合、验证码、记住我】
- Spark核心RDD、什么是RDD、RDD的属性、创建RDD、RDD的依赖以及缓存、
- Caused by: java.net.ConnectException: Connection refused: master/192.168.3.129:7077
- java.util.zip.ZipException: invalid LOC header (bad signature)
- 递归就这么简单
- Activiti就是这么简单
- WebService就是这么简单
- eclipse中hadoop2.3.0环境部署及在eclipse中直接提交mapreduce任务
- spark on yarn提交任务时一直显示ACCEPTED
- JavaScript 教程
- JavaScript 编辑工具
- JavaScript 与HTML
- JavaScript 与Java
- JavaScript 数据结构
- JavaScript 基本数据类型
- JavaScript 特殊数据类型
- JavaScript 运算符
- JavaScript typeof 运算符
- JavaScript 表达式
- JavaScript 类型转换
- JavaScript 基本语法
- JavaScript 注释
- Javascript 基本处理流程
- Javascript 选择结构
- Javascript if 语句
- Javascript if 语句的嵌套
- Javascript switch 语句
- Javascript 循环结构
- Javascript 循环结构实例
- Javascript 跳转语句
- Javascript 控制语句总结
- Javascript 函数介绍
- Javascript 函数的定义
- Javascript 函数调用
- Javascript 几种特殊的函数
- JavaScript 内置函数简介
- Javascript eval() 函数
- Javascript isFinite() 函数
- Javascript isNaN() 函数
- parseInt() 与 parseFloat()
- escape() 与 unescape()
- Javascript 字符串介绍
- Javascript length属性
- javascript 字符串函数
- Javascript 日期对象简介
- Javascript 日期对象用途
- Date 对象属性和方法
- Javascript 数组是什么
- Javascript 创建数组
- Javascript 数组赋值与取值
- Javascript 数组属性和方法
- 详解 Linux 常用目录的作用
- CentOS6环境下搭建路由器的方法
- centos7下NFS使用与配置的步骤
- 基于DOM4J的XML文件解析类
- Win7安装和配置Apache2.4服务器的详细方法
- shiro会话管理示例代码
- Windows Apache2.4 VC9(ApacheHaus)详细安装配置教程
- 在centos 7中安装配置k8s集群的步骤详解
- Centos7.2 编译安装方式搭建 phpMyAdmin
- CentOS 6.5 web服务器apache的安装与基本设置
- Linux本机与服务器文件互传及Linux服务器文件上传下载命令写法
- linux利用read命令获取变量中的值
- 解决Centos7 安装腾达U12无线网卡驱动问题
- CentOS 6.5上编译安装Apache服务器的方法(最小化安装)
- 固定QPS压测模式探索