In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
SAP CDS redirect view is what, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.
Script
Suppose we have a database table a, and then we create a CDS redirect view B for it, then each time we perform a read open SQL on table a, the ABAP kernel directs the request to view B and services the request with the content from B.
precondition
In order for view B to be limited to the redirected view of Table A, An and B must have the same fields in exactly the same order and name.
To demonstrate the logic, I created a Z table in ER9/001 with four fields, as shown below.
Write a simple test report:
Data: standard table of lt_ table type for zcomm_ products. Select * from the zcomm_ product to enter the form lt_ form. Write: / sy dbcnt.
Because this table has just been created, there is no content in it, so the output should be 0.
Create a new CD view using the 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 an example, the mapping between ZCOMM_ products. The product type is MARA. From a business perspective, MTART doesn't make sense, I just use it to show how to map fields in database tables to CDS views (field names and technology types must be equal).
When the CDS view is complete, activate it and assign the view to the database table through the 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.
Redirects are also automatically performed when you browse the content of a ZCOMM_ product from tcode SE16:
How redirection works under the hood
If you perform a ST05 trace, you can observe that the redirection is done automatically by the ABAP runtime and does not require any action on the application side.
After reading the above, have you mastered the method of SAP CDS redirecting view? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.