Intersection of internal tables
来源:互联网 发布:广东网络作协 编辑:程序博客网 时间:2024/06/05 08:16
Using a sorted table temporarily
Runtime: 101 microseconds
* Entries: 200 (ITAB1), 100 (ITAB2)
* Intersection: 50 (ITAB3)
* Line width: 100, Key width: 20
STAB1 = ITAB1.
REFRESH ITAB3.
LOOP AT ITAB2 ASSIGNING <WA>.
READ TABLE STAB1 FROM <WA>
TRANSPORTING NO FIELDS.
IF SY-SUBRC = 0.
APPEND <WA> TO ITAB3.
ENDIF.
ENDLOOP.
FREE STAB1.
Using a hashed table temporarily
Runtime: 92 microseconds
* Entries: 200 (ITAB1), 100 (ITAB2)
* Intersection: 50 (ITAB3)
* Line width: 100, Key width: 20
HTAB1 = ITAB1.
REFRESH ITAB3.
LOOP AT ITAB2 ASSIGNING <WA>.
READ TABLE HTAB1 FROM <WA>
TRANSPORTING NO FIELDS.
IF SY-SUBRC = 0.
APPEND <WA> TO ITAB3.
ENDIF.
ENDLOOP.
FREE HTAB1.
Documentation
The source tables ITAB1 and ITAB2 are standard tables. It is assumed
that ITAB1 takes more entries than ITAB2. Otherwise, the table with
more entries must be computed with "DESCRIBE TABLE ... LINES ...".
Since both tables shall represent sets, it is assumed that their
entries are unique with respect to component K.
The algorithm works with a temporary table with unique key K. The
table is a copy of ITAB1 and is used to locate the entries beeing
also contained in ITAB2. The matching entries are copied to ITAB3.
The left-hand and right-hand side differ only by the kind of the
temporary table being used. For a hashed table, the READ statement
in the LOOP is faster than for the sorted table.
- Intersection of internal tables
- What Are Different Types Of Internal Tables and Their Usage
- Xen Internal - grant tables
- Joining internal tables.
- Filling nested internal tables
- Compare two internal tables
- Point of Intersection
- zoj1199-Point of Intersection
- toj3843 Intersection of sets
- lightoj1211 Intersection of Cubes
- Intersection of Two Arrays
- Intersection of Two Arrays
- Intersection of Two Arrays
- Intersection of Two Arrays
- Intersection of Two Arrays
- Intersection of Two Arrays
- Intersection of Two Arrays
- Intersection of Two Arrays
- IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml];
- 可惜不是你-娜写年华
- 如何自动的用图片代替字符?
- Android学习笔记4——Activity的生命周期
- csnd博客被封处理方法 呵呵
- Intersection of internal tables
- 如何加快熟悉通信协议
- Nested loops
- Flex导出Excel
- 位运算在排序与搜索中的应用(转)
- Joining internal tables.
- ExtJS中的get函数:get,getCmp,getDom,getBody,getDoc
- oracle 表空间的创建
- Building unique sorted hashed tables.