当前位置:网站首页>ABAP CDs view with association example
ABAP CDs view with association example
2022-04-23 09:31:00 【rogerix4】
1. ASSOCIATION Application scenarios of
- ASSOCIATION It's a kind of passing Join A join condition that gets data from multiple tables , But these are “ Connect on demand ”, in other words , They will only be triggered when the user accesses the required data that needs to be associated with the table
- because ASSOCIATION Is triggered on demand , When Join When there are more actual accesses, users only access a single or a few Join when , Compared with tradition, it can complete SQL
- ASSOCIATION Association cardinality of
- [ 0 … 1 ] = At most one (at most one)
- [ 1 … 1 ] = Only one-to-one correspondence is allowed (exactly one)
- [ 0 … n ] = Associate any number (any number)
- [ 1 … n ] = Associate at least one (at least one)
- [ 1 … 1 ] [ 1 … n ] It ensures that the associated main table always has at least one record
2. Realization CDS VIEW WITH ASSOCIATION
-
Create a CDS VIEW WITH ASSOCIATION
-
Realization CDS VIEW WITH ASSOCIATION Code
@AbapCatalog.sqlViewName: 'ZCDS_ASSO_01' @AbapCatalog.compiler.compareFilter: true @AbapCatalog.preserveKey: true @AccessControl.authorizationCheck: #CHECK @EndUserText.label: 'cds view with association' define view ZCDS_ASSOCIATIONS as select from spfli as t1 association [1] to sflight as _sflight on $projection.carrid = _sflight.carrid { key t1.carrid, t1.connid, t1.countryfr, t1.cityfrom, t1.airpfrom, t1.countryto, t1.cityto, t1.airpto, t1.fltime, t1.deptime, t1.arrtime, t1.distance, t1.distid, _sflight }
3. Data preview
-
Right click anywhere , Click on Follow Association You can see ASSOCIATION
-
double-click Associations see , This shows that the default Association The way is **[ 0 … 1 ]**
-
Association _sflight
4. stay ABAP Call in
- frequently-used Select * Unable to get Association _sflight Data content in , This is the beginning of the story (Association It will only be triggered when the user accesses the required data of the associated table )
- Correct reading method
- Activate error report :The association “_SFLIGHT” could not be resolved. correct
- Use incorrect call View Name An error will be reported during activation
- resolvent : Use View Name that will do
- Use incorrect call View Name An error will be reported during activation
版权声明
本文为[rogerix4]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230623504064.html
边栏推荐
- ASUS laptop can't read USB and surf the Internet after reinstalling the system
- Trc20 fund collection solution based on thinkphp5 version
- SQL used query statements
- 数据清洗 ETL 工具Kettle的安装
- 小女孩行走
- JS DOM event
- Summary of wrong questions 1
- Base de la technologie électronique numérique 3.1 aperçu du circuit de porte, 3.2 circuit de porte à diode semi - conductrice
- How to protect open source projects from supply chain attacks - Security Design (1)
- Leetcode0587. 安装栅栏(difficult)
猜你喜欢
SAP 101K 411K 库存变化
Vivo, hardware safe love and thunder
Amazon cloud technology entry Resource Center, easy access to the cloud from 0 to 1
DVWA range practice record
三、6【Verilog HDL】基础知识之门级建模
Summary of wrong questions 1
[in-depth good article] detailed explanation of Flink SQL streaming batch integration technology (I)
Three challenges that a successful Devops leader should be aware of
Installation of data cleaning ETL tool kettle
Kettle experiment (III)
随机推荐
Buuctf [actf2020 freshman competition] include1
MySQL of database -- Fundamentals
[in-depth good article] detailed explanation of Flink SQL streaming batch integration technology (I)
高薪程序员&面试题精讲系列91之Limit 20000加载很慢怎么解决?如何定位慢SQL?
[SQL Server fast track] view and cursor of database
Installation of data cleaning ETL tool kettle
Node installation
Using sqlmap injection to obtain the account and password of the website administrator
Leetcode0587. Install fence
Codeforces Round #784 (Div. 4)
MySQL - Chapter 1 (data types in MySQL)
SAP 101K 411k inventory change
DVWA range practice record
[geek challenge 2019] havefun1
《数字电子技术基础》3.1 门电路概述、3.2 半导体二极管门电路
【读书笔记】《Verilog数字系统设计教程》 第5章 条件语句、循环语句和块语句(附思考题答案)
501. 二叉搜索树中的众数
Applet error: cannot read property'currenttarget'of undefined
MySQL - Chapter 1 (data type 2)
GoLand debug go use - white record