Types of Internal Tables:
1. Indexed internal tables.
2.Hashed internal tables.
INDEXED INTERNAL TABLES :
>> Indexed internal tables are two types 1. STANDARD Internal tables 2.SORTED Internal tables.
STANDARD INTERNAL TABLES:
>> It accepts duplicate records ,because here ,all fields are non-unique.
>> Pushing data from workspace to internal table is always through APPEND keyword.
>>Searching of a record is Linear Search(line by line).
SYNTAX:
Data <internal table> like standard table of <workarea>.
note:
If you do not specify standard table in above syntax,
then by default it is standard table ,in real time senario we use standard internal table.
SORTED INTERNAL TABLES:
>> It may or may not accept the duplicates records.
>> in sorted table we must specify atleast one field as unique/ non-unique.
>> Pushing data from workrea to internal table is always through INSERT keyword.
>> Searching of a record is done by BINARY SEARCH.
SYNTAX:
Data <internal table> like sorted table of <work area>
with unique / non-unique key <field name>.
eg:
data it like sorted table of wa with unique key eid.
HASHED INTERNAL TABLES:
>> This table will not accepts duplicate records.
>> here ,we must specify at least one field ,as unique.
>> Pushing data from workarea to internal table is always through COLLECT keyword.
>> Searching of a record is by using HASHED algorithm
SYNTAX:
Data <internal table > like hashed table of <work area>
with unique key <field>.
we can specify more than one unique key by providing space between the fields.
note:
In the real time we always use standard internal tables, because we are working with the data of database table. IN the database there is no duplicate.
sometimes we use ashed internal tables.
message:
i will discuss in detail in further post.
Comments
Post a Comment