Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Internal Table Types (Standard, Sorted, Hashed)

Former Member
0 Likes
1,137

Hi all,

I wonder about using internal table types. I always work with standard table type. I don't know when i have to use the standard, sorted or hashed itab type. Is there limits for line counts of types, like over 200.000 lines use hashed table type etc. ? I need performance improvements for itabs.

Thx,

10 REPLIES 10
Read only

Former Member
0 Likes
1,083

This message was moderated.

Read only

Former Member
0 Likes
1,083

This message was moderated.

Read only

Former Member
0 Likes
1,083

This message was moderated.

Read only

Former Member
0 Likes
1,083

Hi,

Adding to Adrain

If you are wondering what Binary Scan or Hashing is, I would recommend you to google RDBMS techniques 'Hashing' and Binary Search Algorithm.

This might give you an insight on how exactly these work.

Read only

Former Member
0 Likes
1,083

over 50 lines you should not use standard tables !!!

Read only

Former Member
0 Likes
1,083

Thanks Siegfried Boes and Nitwick

@ Siegfried Boes

Really i should not use standard tables over 50 lines ? I never heard this before.

And about internal tables when i define an internal table with the type of a database table ( e.g. MARA ), am i need to define keys to itab or it has already keys same with database table ( e.g. MARA ) ?

Read only

Former Member
0 Likes
1,083

> Really i should not use standard tables over 50 lines ? I never heard this before.

I don't wonder, but my statement is still correct.

The special tables are tables with primary keys, which speed up you search. You need it when you access

the table several times and not only with LOOPs.

The table definition is completely independent of the database table.

Try to use sorted tables always. You rarely need hashed tables and avoid standard tables (even if you think they

will remain small).

Siegfried

Read only

Former Member
0 Likes
1,083

Hallo,

We do use the internal table type standard for records more than lacks ....but you have too much of data and would like to improve the performance for the internal table. Please use the sorted internal table type or the indexed internal table type.

this would help you to improve the internal table performance.

BR,

Rajesh Gupta.

Read only

matt
Active Contributor
0 Likes
1,083

>

> . Please use the sorted internal table type or the indexed internal table type.

Your terminology is confusing. A standard table is an indexed internal table. Sorted is the other kind of indexed table. Indexed in this context means you can read from the table directly by row (index) number. READ my_itab INDEX 1.... for example.

Read only

Former Member
0 Likes
1,083

the terminology of internal tables is unfortunately quite confusing:

internal tables use 'index' for the row number of the line in the table, if you know then you can access it directly. It is actually the sy-tabix variable which you have to know.

Things which are called index on the database are called keys, i.e. the sorted primary key of a SORTED table or the hashed primary key of a HASHED table (the technical realization is actually called index).

With the newest basis release (7.02 or 7.20) there are also secondary keys possible on internal tables, for all 3 types.

Siegfried