当前位置:网站首页>SAP 03-AMDP CDS Table Function using ‘WITH‘ Clause(Join子查询内容)
SAP 03-AMDP CDS Table Function using ‘WITH‘ Clause(Join子查询内容)
2022-04-23 06:25:00 【rogerix4】
1. 代码
-
此例在CDS Table Function基础上,演示使用WITH:SAP 02-AMDP Functions for CDS Table Functions
CLASS zamdp_demo_02 DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. interfaces: IF_AMDP_MARKER_HDB. class-methods: GET_SPFLI_US for table function zamdp_cds_tabfunc_01. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS zamdp_demo_02 IMPLEMENTATION. method GET_SPFLI_US by database function for hdb language sqlscript options read-only using spfli sflight. return with sflight_tmp as ( select distinct carrid,connid from sflight where carrid = 'AA' and connid = '0017' ) select t2.MANDT, t1.CARRID, t1.CONNID, t2.COUNTRYFR, t2.CITYFROM, t2.AIRPFROM, t2.COUNTRYTO, t2.CITYTO, t2.AIRPTO, t2.FLTIME, t2.DEPTIME, t2.ARRTIME, t2.DISTANCE, t2.DISTID, t2.FLTYPE, t2.PERIOD from sflight_tmp as t1 left outer join spfli as t2 On t1.carrid = t2.carrid and t1.connid = t2.connid where t2.mandt = :ip_clnt --Use Table Function Parameter and t2.COUNTRYFR = :ip_COUNTRYFR; endmethod. ENDCLASS.
2. 结果展示
- 原例中,运行后结果
- 本例中,使用WITH 分句(数据使用做了二次筛选,比原例范围更精确)
版权声明
本文为[rogerix4]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_30797051/article/details/123846728
边栏推荐
猜你喜欢
Mysql 索引
redis连接出错 ERR AUTH <password> called without any password configured for the default user.
BTree、B+Tree和HASH索引
Discussion on arrow function of ES6
BTREE, B + tree and hash index
SAP RFC_CVI_EI_INBOUND_MAIN BP主数据创建示例(仅演示客户)
Solutions to common problems in visualization (VII) solutions to drawing scale setting
[Educational Codeforces Round 80] 解题报告
ogldev-读书笔记
ABAP 7.4 SQL Window Expression
随机推荐
配置npm
Failed to install Tui editor, quick solution
莫比乌斯反演
[CodeForces - 208E] Blood Cousins(k代兄弟问题)
The difference and application of VR, AR and MR, as well as some implementation principles of AR technology
SAP RFC_CVI_EI_INBOUND_MAIN BP主数据创建示例(仅演示客户)
数据分析入门 | kaggle泰坦尼克任务(四)—>数据清洗及特征处理
7. sub query
【TED系列】一个习惯是如何改变我的一生
4.多表查询
数论之拓展欧几里得
学习笔记7-深度神经网络优化
11.表和库的管理
Mysql的存储引擎
Applet newline character \ nfailure problem resolution - Daily pit stepping
13.用户和权限管理
(扩展)BSGS与高次同余方程
[Ted series] how to get along with inner critics?
SAP Excel 已完成文件级验证和修复。此工作簿的某些部分可能已被修复或丢弃。
MVCC(多版本并发控制)