SAP CDS view自学教程之三:ABAP Development Tool里的CDS view源代码如何传递到ABAP后台

简介: SAP CDS view自学教程之三:ABAP Development Tool里的CDS view源代码如何传递到ABAP后台

Let’s review what we have learned so far. Through SQL trace and debugging, we have learned below:


(1) When we click activate button in ABAP development tool ( I call it Eclipse now in this blog ), there are several corresponding ABAP objects generated and table entries inserted. Through debugging we know lots of related logic are implemented in package SDDL.


(2) When we test read & search function against the odata service created on top of the CDS view, the operation is delegated to CL_SQL_STATEMENT~EXECUTE_QUERY.


And now I ask myself, since what we have typed in Eclipse is pure text, how does ABAP backend interpret the text and convert it into ABAP DDIC objects? The only hint we have is the SDDL package. There are more than 10 classes in it. Although an experienced ABAP developer can easily identify which class is responsible for the text->ABAP view conversion just according to the class name and description, whereas ABAP newbies need more time to practice their intuition.


image.png


The tip here is, if you are not sure which class is what you are looking for, then always start with what you have already known. In our case it is CL_SQL_STATEMENT~EXECUTE_QUERY. Set breakpoint on this method and type some more characters in Eclipse, the breakpoint is triggered immediately.


From the callstack, we know that every time after you type something in Eclipse, it will fire Syntax check request to ABAP backend.


image.png


You can observe this via in the bottom part of your Eclipse.


image.png


From the callstack we find a class CL_DD_DDL_HANDLER which implements interface IF_DD_DDL_HANDLER which seems is what we look for. Open this class and there is a method GET_VIEWDEF_FROM_SRC, which indicates the method converts the SouRCe code to ABAP VIEW–DEFinition. Set breakpoint in it and click activate button again in Eclipse.


image.png



This class will parse source code:


image.png



From the code, it is very clear that the parse output, view definition in ABAP format is used to generate ABAP database view.


image.png


There is also another approach which can allow you to get a clearer view:

Open the “ABAP Communication Log” view:


image.png


Switch on Logging:


image.png


Then make some dummy change on your view, then you can observe the following six requests sent to ABAP backend.


The highlighted “abapCheckRun” is just the syntax check we already learned.


image.png


Double click on the request to see request detail. Here the view source code is encoded in Base64 format stored in chkrun:content.


image.png


We can of course see the original text from some decode-encode online conversion website:


image.png


If you could like to debug any request you see in ABAP communication log view, please refer to this document: An example to help you understand how does ADT work.


image.png


When you click activate button in Eclipse, you can know that a syntax check is always performed before the real activation.

image.png


相关文章
|
2月前
|
SQL Android开发
创建 SAP ABAP CDS View 保存失败 - Dependencies DDL source - View Entity not written
创建 SAP ABAP CDS View 保存失败 - Dependencies DDL source - View Entity not written
创建 SAP ABAP CDS View 保存失败 - Dependencies DDL source - View Entity not written
|
2月前
|
Web App开发 开发者 存储
介绍一个 webp 格式转 png 格式的软件:XNConvert
介绍一个 webp 格式转 png 格式的软件:XNConvert
介绍一个 webp 格式转 png 格式的软件:XNConvert
|
2月前
|
JavaScript 前端开发
试读版:如何找出 SAP 标准 Fiori 应用某个按钮点击后执行的 JavaScript 源代码
试读版:如何找出 SAP 标准 Fiori 应用某个按钮点击后执行的 JavaScript 源代码
|
2月前
|
数据处理 自然语言处理 BI
ABAP 源代码如何创建嵌套的内表,即内表列数据结构又是内表
ABAP 源代码如何创建嵌套的内表,即内表列数据结构又是内表
|
2月前
|
Android开发 Windows 缓存
WTS 上打不开 SAP ABAP Development Tool,遇到文件目录 read only 的问题
WTS 上打不开 SAP ABAP Development Tool,遇到文件目录 read only 的问题
WTS 上打不开 SAP ABAP Development Tool,遇到文件目录 read only 的问题
|
2月前
|
数据库 存储 BI
SAP ABAP CDS View 源代码存储的数据库表揭秘和其他相关数据库表介绍试读版
SAP ABAP CDS View 源代码存储的数据库表揭秘和其他相关数据库表介绍试读版
SAP ABAP CDS View 源代码存储的数据库表揭秘和其他相关数据库表介绍试读版
|
2月前
|
数据库
SAP S/4HANA 系统的底层基石 - 通过实际的例子,介绍 CDS View 入门级的概念试读版
SAP S/4HANA 系统的底层基石 - 通过实际的例子,介绍 CDS View 入门级的概念试读版
SAP S/4HANA 系统的底层基石 - 通过实际的例子,介绍 CDS View 入门级的概念试读版
|
2月前
|
数据库
迈入 SAP CDS View 世界的前置知识 - SAP ABAP 数据库视图介绍试读版
迈入 SAP CDS View 世界的前置知识 - SAP ABAP 数据库视图介绍试读版
迈入 SAP CDS View 世界的前置知识 - SAP ABAP 数据库视图介绍试读版
|
2月前
|
数据库 SQL 应用服务中间件
SAP ABAP CDS View 和 HANA CDS View 相同点和不同点辨析
SAP ABAP CDS View 和 HANA CDS View 相同点和不同点辨析
SAP ABAP CDS View 和 HANA CDS View 相同点和不同点辨析
|
2月前
|
BI
如何获取一个 ABAP 类所有方法源代码行数的列表试读版
如何获取一个 ABAP 类所有方法源代码行数的列表试读版