什麼是SAP CDS重定向檢視(Redirect View)?
Scenario
Suppose we have a database table A, and then we create a CDS redirect view B for it, then every time the READ OPEN SQL is done on table A, ABAP kernel will direct this request to view B, and serve the request with content from B.
Prerequisite
In order to make view B qualified as redirect view for table A, both A and B must have the same fields with exactly the same order and tehcnical name.
How to
- In order to demonstrate the logic, I create a Z table in ER9/001 with four fields as below.
Write a simple report to test:
DATA: lt_table TYPE STANDARD TABLE OF zcomm_product. SELECT * INTO TABLE lt_table FROM zcomm_product. WRITE: / sy-dbcnt.
Since this table is just created, so there is no content inside it, 0 is expected for output.
- Create a new CDS view with following source code:
@AbapCatalog.sqlViewName: 'zmara_cds' @AbapCatalog.compiler.compareFilter: true @AccessControl.authorizationCheck: #CHECK @EndUserText.label: 'Redirect ZCOMM_PRODUCT to MARA' define view Zp_Mara_Redirect as select from mara { mara.matnr as PRODUCT_ID, case when (mara.mtart = 'HAWA' or mara.mtart = 'INTR') then '01' when (mara.mtart = 'DIEN' or mara.mtart = 'COUP') then '02' else '' end as product_Type, mara.mtart as object_family }
Note: since this is just a example, the mapping between ZCOMM_PRODUCT.PRODUCT_TYPE to MARA.MTART does not make sense from business point of view, I just use it to illustrate how a field from database table could be mapped to a CDS view ( field name and technical type must be equal ).
Once CDS view is done, activate it and assign the view to database table via menu in SE11:
Once done, execute the report once again. This time, you could see the SELECT OPEN SQL on empty table ZCOMM_PRODUCT is actually redirected to MARA table - lots of entries returned.
Redirect is also automatically done when you browse the content of ZCOMM_PRODUCT from tcode SE16:
How does redirect work under the hood
If you perform a ST05 trace, you can observe the redirect is automatically done by ABAP runtime, no action from application side is needed.
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2668891/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- SAP ABAP CDS view 檢視的 Replacement 技術介紹View
- SAP CDS redirect view支援寫操作嗎,一個實驗來驗證View
- SAP CDS view自學教程之二:當SAP CDS view被啟用時,背後發生了什麼View
- SAP CDS重定向檢視和直接讀這兩者場景的效能比較
- SAP CDS view自學教程之十:SAP CDS view擴充套件性(Extensibility)實現原理View套件
- SAP ABAP CDS view Association 引入的緣由View
- 如何基於 SAP CDS view 生成 object pageViewObject
- SAP CDS view自學教程之一:如何測試基於SAP CDS view自動生成的OData服務View
- 如何使用 SAP CDS view 中的 currency conversion 功能View
- 檢視是什麼玩意
- MySql 什麼是檢視MySql
- 在 Excel 內使用 ODBC 消費 SAP ABAP CDS viewExcelView
- 重定向Redirect 的知識
- 8、flask-Redirect重定向Flask
- SAP ABAP CDS view裡的註解在ABAP後臺是如何被解析的?View
- SAP CDS view單元測試框架Test Double介紹View框架
- 使用CDS view開發SAP Marketing contact的facet追溯工具View
- SAP ABAP CDS view 裡 INNER JOIN 和 Association 的區別View
- 什麼是資料庫檢視?資料庫
- 如何使用SAP HANA Studio的PlanViz分析CDS view效能問題View
- MySQL View 檢視MySqlView
- SAP CDS view自學教程之八:SAP Fiori Elements裡不同型別的annotationView型別
- 開啟SAP CDS view DCL前後的讀取效能對比View
- 使用SAP CDS view快速建立一個Fiori應用,管理Service OrderView
- Python記憶體檢視是什麼Python記憶體
- 什麼是HTTP 307臨時重定向?HTTP
- 如何在 SAP BTP 上通過 CDS view 快速建立 Fiori Elements 應用View
- 如何檢視Linux系統是什麼版本?Linux
- 什麼是 SAP HCEA
- 什麼是 SAP BAPIAPI
- SAP S/4HANA CDS View的訪問控制實現:DCL介紹View
- SAP CDS view如何取得當前系統日期和系統時間戳View時間戳
- 什麼是 ecommerce 的 distributor 概念以及如何實現 website redirectWeb
- Linux中如何檢視系統是什麼版本?Linux
- 一步步學習 SAP CDS view Text Association 在 SAP Fiori Elements 中的應用View
- 在 Excel 裡使用 ODBC 讀取 SAP BTP 平臺上 CDS view 的資料ExcelView
- 什麼是 SAP Commerce yFormsORM
- 什麼是 SAP Business FunctionFunction