ABAP三种内表的区别

  ABAP中有三类内表,标准表,排序表和哈希表。

三种内表介绍

   标准表的每一行对应一个逻辑索引-SY-TABIX,填充内表的时候,可以将数据附加在现有行

之后,也可以插入到指定的位置,程序对内表行的寻址操作可通过关键字或索引进行。在对表

进行插入删除等操作时,各数据行在内存中的位置不变,系统仅重新排列各数据行的索引值。

   排序表也有逻辑索引,不同的是排序表总是按其表关键字升序排列后再进行存储,也就是在

内存中的位置发生改变。

   哈希表没有索引,只有关键字。

行访问方式

                    标准表                    排序表                 哈希表

索引访问             允许                       允许                 不允许

关键字访问           允许                       允许                  允许

相同值关键字行       可重复                   可重复或不可重复       不可重复 

推荐访问方式       主要通过索引               主要通过关键字        只能通过关键字  

 

具体到使用什么类型的内表     

    对于一个小于100行的内表,且很少使用关键字操作,则使用标准表没有效率问题;数据量

比较巨大,切不存在重复行,只需使用关键字访问的内表应定义为哈希表;排序表适用于运行

期内必须以某种排序形式出现的内表。

 

 

1.Standard Internal Tables: These tables have a linear index
and can be accessed using the index or the key. The response
time is in linear relationship with number of table entries.
These tables are useful when user wants to address
individual table entries using the index.
2.Sorted Internal Tables: These tables also have an index
and the key. But, the response time is in logarithmic
relationship with number of table entries, since it uses
binary search algorithm instead of linear search. These
tables are useful when user wants the table to be sorted
while additional entries have to be added.
3.Hashed Internal Tables: These tables have no index, but
have the key. The response time is constant irrespective of
number of table entries, since it uses a Hash algorithm.
These tables are useful when user wants to access the
entries with key only.

 

 

转自: http://blog.sina.com.cn/s/blog_45afbbe50100ek5h.html

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值