ABAP 740的新語法 - 使用BO association的方式進行內表連線操作
ABAP Mesh is also a new feature in 740. Let’s use an example to demonstrate how it works: I have defined two types for developers and managers. developer type has a field manager which points to his manager, while manager type does not have any reference to his managing employee.
types: begin of t_manager,
name type char10,
salary type int4,
end of t_manager,
tt_manager type sorted table of t_manager with unique key name.types: begin of t_developer,
name type char10,
salary type int4,
manager TYPE char10,
end of t_developer,
tt_developer type sorted table of t_developer with unique key name.
I also use the new grammar – inline data declaration to fill developer and manager table. So far nothing special.
DATA: lt_developer TYPE tt_developer,
lt_manager TYPE tt_manager.
DATA(Jerry) = VALUE t_developer( name = 'Jerry' salary = 1000 manager = 'Jason' ).
DATA(Tom) = VALUE t_developer( name = 'Tom' salary = 2000 manager = 'Jason' ).
DATA(Bob) = VALUE t_developer( name = 'Bob' salary = 2100 manager = 'Jason' ).
DATA(Jack) = VALUE t_developer( name = 'Jack' salary = 1000 manager = 'Thomas' ).
DATA(David) = VALUE t_developer( name = 'David' salary = 2000 manager = 'Thomas' ).
DATA(John) = VALUE t_developer( name = 'John' salary = 2100 manager = 'Thomas' ).
DATA(Jason) = VALUE t_manager( name = 'Jason' salary = 3000 ).
DATA(Thomas) = VALUE t_manager( name = 'Thomas' salary = 3200 ).
INSERT Jerry INTO TABLE lt_developer.
INSERT Tom INTO TABLE lt_developer.
INSERT Bob INTO TABLE lt_developer.
INSERT Jack INTO TABLE lt_developer.
INSERT David INTO TABLE lt_developer.
INSERT John INTO TABLE lt_developer.
INSERT Jason INTO TABLE lt_manager.
INSERT Thomas INTO TABLE lt_manager.
Now I define one ABAP mesh t_team with two component managers and developers. With association ‘my_employee’, I connect the internal table managers to developers, so that I could easily find all developers of a given manager. The association ‘my_manager’ just enables the connection in opposite direction: find out the manager of a given developer.
You can compare how I find Jerry’s manager and find all developers whose manager are Thomas using new ABAP mesh and the traditional way.
The result are exactly the same.
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2712211/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ABAP 740裡的新語法 - LET表示式
- ABAP 740新的OPEN SQL增強特性SQL
- ABAP READ內表新老語法對比
- MYSQL語法:左連線、右連線、內連線、全外連線MySql
- SAP ABAP CDS view Association 引入的緣由View
- power 740 p740 連線遠端管理模組
- java操作Oracle 方式一 ( 連線-》操作-》斷開連線 )JavaOracle
- FTP,FTP連線的辦法,配置方式FTP
- SAP ABAP資料表的操作
- 行連線的處理方式指引
- Python 連線mysql資料庫進行操作PythonMySql資料庫
- 一些 Next Generation ABAP Platform 的新語法用例Platform
- 如何用ABAP讀取CDS view association的資料View
- 利用ABAP 740的新關鍵字REDUCE完成一個實際工作任務
- pgsql 連表更新語法SQL
- SAP ABAP CDS view 裡 INNER JOIN 和 Association 的區別View
- SAP SEGW 事物碼裡的 Association 建模方式
- 如何對 ABAP 資料庫表透過 ABAP 程式碼進行更新和刪除操作試讀版資料庫
- 介紹一個使用 cl_abap_corresponding 進行兩個內表不同名稱欄位賦值的快捷方法賦值
- 使用ABAP操作Excel的幾種方法Excel
- ABAP動態內表
- [Rpackage]R語言plyr包使用方法——可進行類似資料透視表的操作PackageR語言
- 如何用ABAP程式碼讀取CDS view association的資料View
- powerbuildr中如何使用dblink連線的表UI
- 如何透過連線資料庫的方式對線下應用進行線上擴充套件資料庫套件
- 表的連線是指在一個SQL語句中通過表與表之間的關連SQL
- 使用ETL進行資料接入的方式
- ABAP Development Tools的語法高亮實現原理dev
- 線性表中的單向連結串列的簡單操作
- 使用Java 14的新記錄型別連線資料庫表 - MinborgJava型別資料庫
- Sqlserver執行計劃中表的四種連線方式SQLServer
- 內網遠端桌面工具,內網遠端桌面連線方式,連線工具有什麼好的推薦內網
- MySQL內連線查詢語句MySql
- Android Socket連線,使用Socket進行通訊(Android)Android
- Java使用代理進行網路連線方法示例Java
- ABAP Netweaver體內的那些寄生式程式語言
- 線性表的基本操作
- 如何手動透過增強的方式,給 SAP ABAP 資料庫表增添新的欄位資料庫