<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: what is internal table? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-internal-table/m-p/2952064#M696151</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the Following documents :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapmaterial.com/internal_tables_all.html" target="test_blank"&gt;http://www.sapmaterial.com/internal_tables_all.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal table in ABAP &lt;/P&gt;&lt;P&gt;*An internal table is a run time instance. It get created when program starts execution. &lt;/P&gt;&lt;P&gt;*It get destroyed when program terminates. it has two different parts. HeaderLine(optional) &amp;amp; Body(Compulsory). &lt;/P&gt;&lt;P&gt;*Any value that comes to or goes from interanal table , that travels through headerline.\ &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*A related program is . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*declaration. &lt;/P&gt;&lt;P&gt;data: begin of internaltable occurs 0, &lt;/P&gt;&lt;P&gt;x type c, &lt;/P&gt;&lt;P&gt;y type i, &lt;/P&gt;&lt;P&gt;end of itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*initializing headerline &lt;/P&gt;&lt;P&gt;internaltable-x = 'd'. &lt;/P&gt;&lt;P&gt;internaltable-y = 34. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*storing value into internal table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;appened internaltable . &lt;/P&gt;&lt;P&gt;appened internaltable . &lt;/P&gt;&lt;P&gt;appened internaltable . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*reading internal table &lt;/P&gt;&lt;P&gt;loop at itab . &lt;/P&gt;&lt;P&gt;write: / internaltable-x, internaltable-y. "writes to output list &lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;follow this link: &lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Reward If Helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 12 Oct 2007 05:41:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-12T05:41:06Z</dc:date>
    <item>
      <title>what is internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-internal-table/m-p/2952061#M696148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi i am new to abap. Please explain  me the concept of internal table in general terms?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 05:36:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-internal-table/m-p/2952061#M696148</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T05:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: what is internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-internal-table/m-p/2952062#M696149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Internal tables are a means of storing data with a fixed structure within the memory of an ABAP program. The data is stored in rows inmemory, where each row has the same structure. The individualcomponents of a row are called the columns of the internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables can exist in ABAP as both data types and data objects. A data type contains the abstract descriptionof an internal table, and is used to create a concrete data object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Types &lt;/P&gt;&lt;P&gt;Internal tables are one of the structured data types in ABAP (structures are the other - see ABAP type concept). The data type ofan internal table is fully specified by its: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line type &lt;/P&gt;&lt;P&gt;The line type of an internal table can by any ABAP data type(including another internal table). &lt;/P&gt;&lt;P&gt;Key &lt;/P&gt;&lt;P&gt;The key is used to identify lines in the table. There are two possiblekeys for an internal table - the defaultkey and a user-defined key. You can specify that the key shouldby UNIQUE or NON-UNIQUE. If the key is unique, theinternal table may not contain duplicate entries. The uniqueness of thekey depends partly on the table type (see below). &lt;/P&gt;&lt;P&gt;The default key consists of all non-numeric components of thecorresponding line type that are not, and do not contain, internaltables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user-defined key can consist of any components that are not,and do not contain, internal tables (that is, do not have adeep-structured type). Internal tables with a user-defined key areknown as key tables. When you define the key, remember that thesequence of the key fields is important for operations such as sorting. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table Type &lt;/P&gt;&lt;P&gt;The table type defines how ABAP accesses individual table entries.There are three kinds of internal table types: &lt;/P&gt;&lt;P&gt;Standard table. A standard table has an internal logical index.You can access it either using the index or using its key. If you usekey access, the response time is in linear relation to the number oftable entries. The key of a standard table is always non-unique. Youcannot use the UNIQUE KEY addition in the definition of a standardtable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted table. A sorted table is always stored correctly sortedby its key. Like standard tables, they also have a linear index, andyou can access them using either the index or their key. If you use keyaccess, the response time is in logarithmic relation to the number oftable entries, since the system uses a binary search. The key of asorted table may be either unique or non-unique, and you must use oneof the additions UNIQUE or NON-UNIQUE when you specifythe key. &lt;/P&gt;&lt;P&gt;Standard tables and sorted tables are generically known as indextables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed tables. Hashed tables do not have a logical index. Youcan only access a hashed table using its key. The response time istherefore independent of the number of table entries, since the systemuses a hash algorithm to access the entries. The key of a hashed tablemust be unique, so you must always use the UNIQUE addition whencreating the table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unlike other user-defined ABAP data types, the data type of aninternal table does not have to be fully specified. Instead, you canconstruct a generic type by, for example, specifying only the key orthe line type and the key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Objects &lt;/P&gt;&lt;P&gt;Data objects that you create using the datatype of an internal table or directly as an internal table, are alwaysfully typed with line type, key and table type. The number of linesdoes not matter, since internal tables are dynamic data objectsthat can have any number of lines of a particular type. The number oflines in an internal table is only restricted by the concrete capacitylimits of the system installation. The line type of an internal tablecan be any data type, that is an elementary type, structuredtype, or even an internal table. the individual lines of an internaltable are referred to as table rows or table entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using Internal Tables &lt;/P&gt;&lt;P&gt;In ABAP, internal tables provide the functions of dynamic arrays,while saving the programmer the task of program-controlled dynamicmemory management. You should use internal tables whenever you want toprocess a set of data with a particular structure within your program.One particularly important use is to store and format the contents ofdatabase tables within a program. They are also the best way toimplement very complex data structures in an ABAP program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data Exchange with Internal Tables &lt;/P&gt;&lt;P&gt;There are two ways of working with an internal table. You can eitheraddress the entire data object (called the table body) orindividual table entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you access the entire table body, you can use the tablename in the relevant ABAP statements (such as MOVE) as thoughit were an elementary field, and the operation will then apply to thewhole data object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you access individual table entries, you do not workdirectly with the data in the table. Instead, you must use a separatedata object as a work area. The work area serves as an interfacebetween your program and the entries in the internal table. It must beconvertible into the line type of the internal table. As a rule, youuse a data object with the same data type as the lines of your internaltable. When you read from the internal table, the contents of the lineyou are reading overwrite the current contents of the work area. Youcan then use the contents of the work area in your program. When youwrite data to a table entry, you must first place the data in the workarea, and the system transfers it from there to the corresponding lineof the internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also create internal tables with a header line. Theheader line is a structured data object with the same data type as thelines of the internal table, which you can use as a work area. Thetable work area and the internal table itself both have the same name.ABAP statements that you can use to access table entries can use tthe header line implicitly as a work area. When you use ABAPstatements that do not implicitly access the entire table body, youmust specify the name of the internal table followed by brackets (forexample, itab[]), otherwise, the system interprets the name asthe name of the work area and not of the internal table. Todifferentiate the internal table and the work area, you shouldtherefore avoid using internal tables with header lines. Above all, donot use internal tables with header lines if you are going to nestinternal tables, since ambiguous constructions may result. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal Table Operations &lt;/P&gt;&lt;P&gt;The following are typical operations for individiual lines of internaltables: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Filling internal tables: &lt;/P&gt;&lt;P&gt;INSERT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COLLECT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reading internal tables: &lt;/P&gt;&lt;P&gt;READ &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modifying internal tables: &lt;/P&gt;&lt;P&gt;MODIFY &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Deleting internal tables: &lt;/P&gt;&lt;P&gt;DELETE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The way in which you use the various ABAP statements depends on thetable type of the internal table. For example, you would use the APPEND statement to fill a standardtable, but the INSERT statement to fill a hashed table. There is also aset of generic operations that you can apply to any table. These are: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT ... INTO TABLE ... &lt;/P&gt;&lt;P&gt;MODIFY TABLE ... &lt;/P&gt;&lt;P&gt;READ   TABLE ... [FROM...|WITH TABLE KEY ...] &lt;/P&gt;&lt;P&gt;DELETE TABLE ... [FROM...|WITH TABLE KEY ...] &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These statements are valid for all table types, and the system executesthem appropriately to the table with which they are used. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Choosing a Table Type &lt;/P&gt;&lt;P&gt;The table type that you use in a particular situation will depend onwhich of the typical internal table operations listed above will beused with the table, and how often. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard Tables: &lt;/P&gt;&lt;P&gt;This table type is most appropriate when you intend to address thetable entries using the index. This is the quickest way toaccess entries in a standard table. You should fill standard tablesusing the APPEND statement, and read, modify, and delete entriesusing the index (INDEX addition to the corresponding ABAPstatement). If you use the key to access a standard table, the accesstime increases in linear relation to the number of entries. If you needto use key entries, standard tables are suitable if you can separatefilling the table from the remaining table processing. For example, youcan fill a standard table by appending entries, and then sort it. Ifyou then use key access with the BINARY SEARCH option, theresponse time is only in logarithmic relation to the number of tableentries. &lt;/P&gt;&lt;P&gt;Sorted Tables &lt;/P&gt;&lt;P&gt;This table type is suitable for tables that must be correctly sortedeven while you are filing them. You fill a sorted table using the INSERT ... INTO TABLE statement, observing the sort sequence defined in the key. Whenyou access the table using its key, the response time is in logarithmicrelation to the number of table entries, since the system automaticallyuses a binary search. Sorted tables are particularly useful for partialsequential processing in a LOOPif you can specify a portion of the table key starting from the left inthe WHERE condition. &lt;/P&gt;&lt;P&gt;Hashed Tables &lt;/P&gt;&lt;P&gt;Hashed tables are useful if the main operation on the table is going tobe key access. You cannot access a hashed table usingindex access. However, the response time for key access is constant,regardless of the number of table entries. Like database tables, hashedtables always have a unique key. Hashed tables are therefore useful forconstructing and processing internal tables that resemble databasetables. &lt;/P&gt;&lt;P&gt;Declaring Internal Tables &lt;/P&gt;&lt;P&gt;Like other ABAP data objects, you can declare internal tables as adata type (using the TYPES statement) and then use the type to declare a data object. You canalso declare them directly as a fully-typed data object (using the DATA statement). When you create aninternal table as a data object, remember that only an administrativeunit is declared for managing the table. The actual memory required isnot set when you declare it (unlike all other ABAP data objects). Thesystem automatically creates new table lines when you insert lines, anddeletes them when you delete data from the internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you declare an internal table, you can use the OCCURS orINITIAL SIZE additions to specify the initial amount ofmemory that should be assigned to the table. This may affect theresponse time when you fill the internal table (seePerformance Notes for Internal Tables). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal Tables as Routine Parameters &lt;/P&gt;&lt;P&gt;Like other parameters, you can pass internal tables either by value or by reference to subroutines and function modules. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to pass an internal table to a subroutine along with itsheader line, you must pass it by reference using the additionTABLES. Only STANDARDtables are allowed as TABLES parameters. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you pass a STANDARD table without header line as an actualparaemter to a formal parameter with header line (TABLES), thesystem automatically creates a corresponding header line in theroutine. Conversely, if you want to pass the body of an internal tablewith header line as an actual parameter to a formal parameter without aheader line, you must specify the name of the table followed by a pairof brackets (itab[]).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 05:40:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-internal-table/m-p/2952062#M696149</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T05:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: what is internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-internal-table/m-p/2952063#M696150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like all elements in the ABAP type concept, internal tables can exist both as data types and as data objects A data type is the abstract description of an internal table, either in a program or centrally in the ABAP Dictionary, that you use to create a concrete data object. The data type is also an attribute of an existing data object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal Tables as Data Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables and structures are the two structured data types in ABAP. The data type of an internal table is fully specified by its line type, key, and table type. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness depends on the table access method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a table has a structured line type, its default key consists of all of its non-numerical columns that are not references or themselves internal tables. If a table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user-defined key can contain any columns of the internal table that are not references or themselves internal tables. Internal tables with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember this, for example, if you intend to sort the table according to the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be unique or not. Standard tables and sorted tables are known generically as index tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed tables have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generic Internal Tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unlike other local data types in programs, you do not have to specify the data type of an internal table fully. Instead, you can specify a generic construction, that is, the key or key and line type of an internal table data type may remain unspecified. You can use generic internal tables to specify the types of field symbols and the interface parameters of procedures . You cannot use them to declare data objects. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal Tables as Dynamic Data Objects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data objects that are defined either with the data type of an internal table, or directly as an internal table, are always fully defined in respect of their line type, key and access method. However, the number of lines is not fixed. Thus internal tables are dynamic data objects, since they can contain any number of lines of a particular type. The only restriction on the number of lines an internal table may contain are the limits of your system installation. The maximum memory that can be occupied by an internal table (including its internal administration) is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more than 2 million entries. The line types of internal tables can be any ABAP data types - elementary, structured, or internal tables. The individual lines of an internal table are called table lines or table entries. Each component of a structured line is called a column in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Choosing a Table Type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table type (and particularly the access method) that you will use depends on how the typical internal table operations will be most frequently executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option with key access, the response time is logarithmically proportional to the number of table entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHERE condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This section describes how to define internal tables locally in a program. You can also define internal tables globally as data types in the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like all local data types in programs , you define internal tables using the TYPES statement. If you do not refer to an existing table type using the TYPE or LIKE addition, you can use the TYPES statement to construct a new local internal table in your program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES &amp;lt;t&amp;gt; TYPE|LIKE &amp;lt;tabkind&amp;gt; OF &amp;lt;linetype&amp;gt; [WITH &amp;lt;key&amp;gt;]&lt;/P&gt;&lt;P&gt;          [INITIAL SIZE &amp;lt;n&amp;gt;].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After TYPE or LIKE, there is no reference to an existing data type. Instead, the type constructor occurs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;tabkind&amp;gt; OF &amp;lt;linetype&amp;gt; [WITH &amp;lt;key&amp;gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The type constructor defines the table type &amp;lt;tabkind&amp;gt;, the line type &amp;lt;linetype&amp;gt;, and the key &amp;lt;key&amp;gt; of the internal table &amp;lt;t&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can, if you wish, allocate an initial amount of memory to the internal table using the INITIAL SIZE addition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can specify the table type &amp;lt;tabkind&amp;gt; as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generic table types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INDEX TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating a generic table type with index access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ANY TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating a fully-generic table type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data types defined using generic types can currently only be used for field symbols and for interface parameters in procedures . The generic type INDEX TABLE includes standard tables and sorted tables. These are the two table types for which index access is allowed. You cannot pass hashed tables to field symbols or interface parameters defined in this way. The generic type ANY TABLE can represent any table. You can pass tables of all three types to field symbols and interface parameters defined in this way. However, these field symbols and parameters will then only allow operations that are possible for all tables, that is, index operations are not allowed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fully-Specified Table Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STANDARD TABLE or TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating standard tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORTED TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating sorted tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HASHED TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating hashed tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fully-specified table types determine how the system will access the entries in the table in key operations. It uses a linear search for standard tables, a binary search for sorted tables, and a search using a hash algorithm for hashed tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the line type &amp;lt;linetype&amp;gt;, you can specify:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any data type if you are using the TYPE addition. This can be a predefined ABAP type, a local type in the program, or a data type from the ABAP Dictionary. If you specify any of the generic elementary types C, N, P, or X, any attributes that you fail to specify (field length, number of decimal places) are automatically filled with the default values. You cannot specify any other generic types. &lt;/P&gt;&lt;P&gt;Any data object recognized within the program at that point if you are using the LIKE addition. The line type adopts the fully-specified data type of the data object to which you refer. Except for within classes, you can still use the LIKE addition to refer to database tables and structures in the ABAP Dictionary (for compatibility reasons). &lt;/P&gt;&lt;P&gt;All of the lines in the internal table have the fully-specified technical attributes of the specified data type. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can specify the key &amp;lt;key&amp;gt; of an internal table as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[UNIQUE|NON-UNIQUE] KEY &amp;lt;col1&amp;gt; ... &amp;lt;col n&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In tables with a structured line type, all of the components &amp;lt;coli&amp;gt; belong to the key as long as they are not internal tables or references, and do not contain internal tables or references. Key fields can be nested structures. The substructures are expanded component by component when you access the table using the key. The system follows the sequence of the key fields. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[UNIQUE|NON-UNIQUE] KEY TABLE LINE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a table has an elementary line type (C, D, F, I, N, P, T, X), you can define the entire line as the key. If you try this for a table whose line type is itself a table, a syntax error occurs. If a table has a structured line type, it is possible to specify the entire line as the key. However, you should remember that this is often not suitable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[UNIQUE|NON-UNIQUE] DEFAULT KEY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This declares the fields of the default key as the key fields. If the table has a structured line type, the default key contains all non-numeric columns of the internal table that are not and do not contain references or internal tables. If the table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifying a key is optional. If you do not specify a key, the system defines a table type with an arbitrary key. You can only use this to define the types of field symbols and the interface parameters of procedures . For exceptions, refer to Special Features of Standard Tables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The optional additions UNIQUE or NON-UNIQUE determine whether the key is to be unique or non-unique, that is, whether the table can accept duplicate entries. If you do not specify UNIQUE or NON-UNIQUE for the key, the table type is generic in this respect. As such, it can only be used for specifying types. When you specify the table type simultaneously, you must note the following restrictions: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot use the UNIQUE addition for standard tables. The system always generates the NON-UNIQUE addition automatically. &lt;/P&gt;&lt;P&gt;You must always specify the UNIQUE option when you create a hashed table. &lt;/P&gt;&lt;P&gt;Initial Memory Requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can specify the initial amount of main memory assigned to an internal table object when you define the data type using the following addition: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIAL SIZE &amp;lt;n&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This size does not belong to the data type of the internal table, and does not affect the type check. You can use the above addition to reserve memory space for &amp;lt;n&amp;gt; table lines when you declare the table object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When this initial area is full, the system makes twice as much extra space available up to a limit of 8KB. Further memory areas of 12KB each are then allocated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can usually leave it to the system to work out the initial memory requirement. The first time you fill the table, little memory is used. The space occupied, depending on the line width, is 16 &amp;lt;= &amp;lt;n&amp;gt; &amp;lt;= 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It only makes sense to specify a concrete value of &amp;lt;n&amp;gt; if you can specify a precise number of table entries when you create the table and need to allocate exactly that amount of memory (exception: Appending table lines to ranked lists). This can be particularly important for deep-structured internal tables where the inner table only has a few entries (less than 5, for example). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To avoid excessive requests for memory, large values of &amp;lt;n&amp;gt; are treated as follows: The largest possible value of &amp;lt;n&amp;gt; is 8KB divided by the length of the line. If you specify a larger value of &amp;lt;n&amp;gt;, the system calculates a new value so that n times the line width is around 12KB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF LINE,&lt;/P&gt;&lt;P&gt;COLUMN1 TYPE I,&lt;/P&gt;&lt;P&gt;COLUMN2 TYPE I,&lt;/P&gt;&lt;P&gt;COLUMN3 TYPE I,&lt;/P&gt;&lt;P&gt;END OF LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES ITAB TYPE SORTED TABLE OF LINE WITH UNIQUE KEY COLUMN1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program defines a table type ITAB. It is a sorted table, with line type of the structure LINE and a unique key of the component COLUMN1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES VECTOR TYPE HASHED TABLE OF I WITH UNIQUE KEY TABLE LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF LINE,&lt;/P&gt;&lt;P&gt;COLUMN1 TYPE I,&lt;/P&gt;&lt;P&gt;COLUMN2 TYPE I,&lt;/P&gt;&lt;P&gt;COLUMN3 TYPE I,&lt;/P&gt;&lt;P&gt;END OF LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES ITAB TYPE SORTED TABLE OF LINE WITH UNIQUE KEY COLUMN1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF DEEPLINE,&lt;/P&gt;&lt;P&gt;FIELD TYPE C,&lt;/P&gt;&lt;P&gt;TABLE1 TYPE VECTOR,&lt;/P&gt;&lt;P&gt;TABLE2 TYPE ITAB,&lt;/P&gt;&lt;P&gt;END OF DEEPLINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES DEEPTABLE TYPE STANDARD TABLE OF DEEPLINE &lt;/P&gt;&lt;P&gt;WITH DEFAULT KEY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program defines a table type VECTOR with type hashed table, the elementary line type I and a unique key of the entire table line. The second table type is the same as in the previous example. The structure DEEPLINE contains the internal table as a component. The table type DEEPTABLE has the line type DEEPLINE. Therefore, the elements of this internal table are themselves internal tables. The key is the default key - in this case the column FIELD. The key is non-unique, since the table is a standard table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 05:40:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-internal-table/m-p/2952063#M696150</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T05:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: what is internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-internal-table/m-p/2952064#M696151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the Following documents :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapmaterial.com/internal_tables_all.html" target="test_blank"&gt;http://www.sapmaterial.com/internal_tables_all.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal table in ABAP &lt;/P&gt;&lt;P&gt;*An internal table is a run time instance. It get created when program starts execution. &lt;/P&gt;&lt;P&gt;*It get destroyed when program terminates. it has two different parts. HeaderLine(optional) &amp;amp; Body(Compulsory). &lt;/P&gt;&lt;P&gt;*Any value that comes to or goes from interanal table , that travels through headerline.\ &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*A related program is . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*declaration. &lt;/P&gt;&lt;P&gt;data: begin of internaltable occurs 0, &lt;/P&gt;&lt;P&gt;x type c, &lt;/P&gt;&lt;P&gt;y type i, &lt;/P&gt;&lt;P&gt;end of itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*initializing headerline &lt;/P&gt;&lt;P&gt;internaltable-x = 'd'. &lt;/P&gt;&lt;P&gt;internaltable-y = 34. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*storing value into internal table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;appened internaltable . &lt;/P&gt;&lt;P&gt;appened internaltable . &lt;/P&gt;&lt;P&gt;appened internaltable . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*reading internal table &lt;/P&gt;&lt;P&gt;loop at itab . &lt;/P&gt;&lt;P&gt;write: / internaltable-x, internaltable-y. "writes to output list &lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;follow this link: &lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Reward If Helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 05:41:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-internal-table/m-p/2952064#M696151</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T05:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: what is internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-internal-table/m-p/2952065#M696152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hI &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables are the core of ABAP. They are like soul of a body. For any program we use &lt;/P&gt;&lt;P&gt;internal tables extensively.  We can use Internal tables like normal data base tables only, but the &lt;/P&gt;&lt;P&gt;basic difference is the memory allocated for internal tables is temporary. Once the program is &lt;/P&gt;&lt;P&gt;closed the memory allocated for internal tables will also be out of memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But while using the internal tables, there are many performance issues to be considered. i.e which &lt;/P&gt;&lt;P&gt;type of internal table to be used for the program..like standard internal table, hashed internal &lt;/P&gt;&lt;P&gt;table or sorted internal table etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Internal tables&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by &lt;/P&gt;&lt;P&gt;line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data &lt;/P&gt;&lt;P&gt;objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables &lt;/P&gt;&lt;P&gt;whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for &lt;/P&gt;&lt;P&gt;storing and formatting data from a database table within a program. They are also a good way of including very complicated data &lt;/P&gt;&lt;P&gt;structures in an ABAP program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like all elements in the ABAP type concept, internal tables can exist both as data types and as data objects A data type is the abstract &lt;/P&gt;&lt;P&gt;description of an internal table, either in a program or centrally in the ABAP Dictionary, that you use to create a concrete data object. The &lt;/P&gt;&lt;P&gt;data type is also an attribute of an existing data object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Internal Tables as Data Types&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables and structures are the two structured data types in ABAP. The data type of an internal table is fully specified by its line type, &lt;/P&gt;&lt;P&gt;key, and table type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Line type&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the &lt;/P&gt;&lt;P&gt;structure is a column in the internal table. However, the line type may also be elementary or another internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Key&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify &lt;/P&gt;&lt;P&gt;whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness &lt;/P&gt;&lt;P&gt;depends on the table access method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a table has a structured line type, its default key consists of all of its non-numerical columns that are not references or themselves &lt;/P&gt;&lt;P&gt;internal tables. If a table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type &lt;/P&gt;&lt;P&gt;is an internal table, the default key is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user-defined key can contain any columns of the internal table that are not references or themselves internal tables. Internal tables &lt;/P&gt;&lt;P&gt;with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember &lt;/P&gt;&lt;P&gt;this, for example, if you intend to sort the table according to the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Table type&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In &lt;/P&gt;&lt;P&gt;this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access &lt;/P&gt;&lt;P&gt;records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. &lt;/P&gt;&lt;P&gt;The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled &lt;/P&gt;&lt;P&gt;very quickly, since the system does not have to check whether there are already existing entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the &lt;/P&gt;&lt;P&gt;table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system &lt;/P&gt;&lt;P&gt;uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether &lt;/P&gt;&lt;P&gt;the key is to be unique or not. Standard tables and sorted tables are known generically as index tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed tables have no linear index. You can only access a hashed table using its key. The response time is independent of the number of &lt;/P&gt;&lt;P&gt;table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. &lt;/P&gt;&lt;P&gt;When you define the table, you must specify the key as UNIQUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Generic Internal Tables&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unlike other local data types in programs, you do not have to specify the data type of an internal table fully. Instead, you can specify a &lt;/P&gt;&lt;P&gt;generic construction, that is, the key or key and line type of an internal table data type may remain unspecified. You can use generic &lt;/P&gt;&lt;P&gt;internal tables to specify the types of field symbols and the interface parameters of procedures . You cannot use them to declare data &lt;/P&gt;&lt;P&gt;objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Internal Tables as Dynamic Data Objects&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data objects that are defined either with the data type of an internal table, or directly as an internal table, are always fully defined in &lt;/P&gt;&lt;P&gt;respect of their line type, key and access method. However, the number of lines is not fixed. Thus internal tables are dynamic data objects, &lt;/P&gt;&lt;P&gt;since they can contain any number of lines of a particular type. The only restriction on the number of lines an internal table may contain are &lt;/P&gt;&lt;P&gt;the limits of your system installation. The maximum memory that can be occupied by an internal table (including its internal administration) &lt;/P&gt;&lt;P&gt;is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more &lt;/P&gt;&lt;P&gt;than 2 million entries. The line types of internal tables can be any ABAP data types - elementary, structured, or internal tables. The &lt;/P&gt;&lt;P&gt;individual lines of an internal table are called table lines or table entries. Each component of a structured line is called a column in the &lt;/P&gt;&lt;P&gt;internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Choosing a Table Type&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table type (and particularly the access method) that you will use depends on how the typical internal table operations will be most &lt;/P&gt;&lt;P&gt;frequently executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Standard tables&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest &lt;/P&gt;&lt;P&gt;possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by &lt;/P&gt;&lt;P&gt;specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship &lt;/P&gt;&lt;P&gt;with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in &lt;/P&gt;&lt;P&gt;separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option with key &lt;/P&gt;&lt;P&gt;access, the response time is logarithmically proportional to the number of table entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Sorted tables&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries &lt;/P&gt;&lt;P&gt;are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add &lt;/P&gt;&lt;P&gt;them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always &lt;/P&gt;&lt;P&gt;uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the &lt;/P&gt;&lt;P&gt;table key in the WHERE condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Hashed tables&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. &lt;/P&gt;&lt;P&gt;The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always &lt;/P&gt;&lt;P&gt;have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for &lt;/P&gt;&lt;P&gt;processing large amounts of data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Creating Internal Tables&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like other elements in the ABAP type concept, you can declare internal tables as abstract data &lt;/P&gt;&lt;P&gt;types in programs or in the ABAP Dictionary, and then use them to define data objects. &lt;/P&gt;&lt;P&gt;Alternatively, you can define them directly as data objects. When you create an internal table as a &lt;/P&gt;&lt;P&gt;data object, you should ensure that only the administration entry which belongs to an internal &lt;/P&gt;&lt;P&gt;table is declared statically. The minimum size of an internal table is 256 bytes. This is important if an &lt;/P&gt;&lt;P&gt;internal table occurs as a component of an aggregated data object, since even empty internal &lt;/P&gt;&lt;P&gt;tables within tables can lead to high memory usage. (In the next functional release, the size of the &lt;/P&gt;&lt;P&gt;table header for an initial table will be reduced to 8 bytes). Unlike all other ABAP data objects, you &lt;/P&gt;&lt;P&gt;do not have to specify the memory required for an internal table. Table rows are added to and &lt;/P&gt;&lt;P&gt;deleted from the table dynamically at runtime by the various statements for adding and deleting &lt;/P&gt;&lt;P&gt;records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can create internal tables in different types.&lt;/P&gt;&lt;P&gt;You can create standard internal table and then make it sort in side the program.&lt;/P&gt;&lt;P&gt;The same way you can change to hashed internal tables also.&lt;/P&gt;&lt;P&gt;There will be some performance issues with regard to standard internal tables/ hashed internal &lt;/P&gt;&lt;P&gt;tables/ sorted internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Internal table types&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This section describes how to define internal tables locally in a program. You can also define internal tables globally as data types in the &lt;/P&gt;&lt;P&gt;ABAP Dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like all local data types in programs , you define internal tables using the TYPES statement. If you do not refer to an existing table type &lt;/P&gt;&lt;P&gt;using the TYPE or LIKE addition, you can use the TYPES statement to construct a new local internal table in your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES &amp;lt;t&amp;gt; TYPE|LIKE &amp;lt;tabkind&amp;gt; OF &amp;lt;linetype&amp;gt; [WITH &amp;lt;key&amp;gt;]&lt;/P&gt;&lt;P&gt;     [INITIAL SIZE &amp;lt;n&amp;gt;].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After TYPE or LIKE, there is no reference to an existing data type. Instead, the type constructor occurs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;tabkind&amp;gt; OF &amp;lt;linetype&amp;gt; [WITH &amp;lt;key&amp;gt;]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The type constructor defines the table type &amp;lt;tabkind&amp;gt;, the line type &amp;lt;linetype&amp;gt;, and the key &amp;lt;key&amp;gt; of the internal table &amp;lt;t&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can, if you wish, allocate an initial amount of memory to the internal table using the INITIAL SIZE addition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can specify the table type &amp;lt;tabkind&amp;gt; as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generic table types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INDEX TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating a generic table type with index access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ANY TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating a fully-generic table type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data types defined using generic types can currently only be used for field symbols and for interface parameters in procedures . The generic &lt;/P&gt;&lt;P&gt;type INDEX TABLE includes standard tables and sorted tables. These are the two table types for which index access is allowed. You cannot &lt;/P&gt;&lt;P&gt;pass hashed tables to field symbols or interface parameters defined in this way. The generic type ANY TABLE can represent any table. You &lt;/P&gt;&lt;P&gt;can pass tables of all three types to field symbols and interface parameters defined in this way. However, these field symbols and &lt;/P&gt;&lt;P&gt;parameters will then only allow operations that are possible for all tables, that is, index operations are not allowed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fully-Specified Table Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STANDARD TABLE or TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating standard tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORTED TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating sorted tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HASHED TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating hashed tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fully-specified table types determine how the system will access the entries in the table in key operations. It uses a linear search for &lt;/P&gt;&lt;P&gt;standard tables, a binary search for sorted tables, and a search using a hash algorithm for hashed tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the line type &amp;lt;linetype&amp;gt;, you can specify:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any data type if you are using the TYPE addition. This can be a predefined ABAP type, a local type in the program, or a data type from the &lt;/P&gt;&lt;P&gt;ABAP Dictionary. If you specify any of the generic elementary types C, N, P, or X, any attributes that you fail to specify (field length, number &lt;/P&gt;&lt;P&gt;of decimal places) are automatically filled with the default values. You cannot specify any other generic types.&lt;/P&gt;&lt;P&gt;Any data object recognized within the program at that point if you are using the LIKE addition. The line type adopts the fully-specified data &lt;/P&gt;&lt;P&gt;type of the data object to which you refer. Except for within classes, you can still use the LIKE addition to refer to database tables and &lt;/P&gt;&lt;P&gt;structures in the ABAP Dictionary (for compatibility reasons).&lt;/P&gt;&lt;P&gt;All of the lines in the internal table have the fully-specified technical attributes of the specified data type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can specify the key &amp;lt;key&amp;gt; of an internal table as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[UNIQUE|NON-UNIQUE] KEY &amp;lt;col1&amp;gt; ... &amp;lt;col n&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In tables with a structured line type, all of the components &amp;lt;coli&amp;gt; belong to the key as long as they are not internal tables or references, &lt;/P&gt;&lt;P&gt;and do not contain internal tables or references. Key fields can be nested structures. The substructures are expanded component by &lt;/P&gt;&lt;P&gt;component when you access the table using the key. The system follows the sequence of the key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[UNIQUE|NON-UNIQUE] KEY TABLE LINE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a table has an elementary line type (C, D, F, I, N, P, T, X), you can define the entire line as the key. If you try this for a table whose line &lt;/P&gt;&lt;P&gt;type is itself a table, a syntax error occurs. If a table has a structured line type, it is possible to specify the entire line as the key. However, &lt;/P&gt;&lt;P&gt;you should remember that this is often not suitable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[UNIQUE|NON-UNIQUE] DEFAULT KEY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This declares the fields of the default key as the key fields. If the table has a structured line type, the default key contains all non-numeric &lt;/P&gt;&lt;P&gt;columns of the internal table that are not and do not contain references or internal tables. If the table has an elementary line type, the &lt;/P&gt;&lt;P&gt;default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifying a key is optional. If you do not specify a key, the system defines a table type with an arbitrary key. You can only use this to &lt;/P&gt;&lt;P&gt;define the types of field symbols and the interface parameters of procedures . For exceptions, refer to Special Features of Standard Tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The optional additions UNIQUE or NON-UNIQUE determine whether the key is to be unique or non-unique, that is, whether the table can &lt;/P&gt;&lt;P&gt;accept duplicate entries. If you do not specify UNIQUE or NON-UNIQUE for the key, the table type is generic in this respect. As such, it can &lt;/P&gt;&lt;P&gt;only be used for specifying types. When you specify the table type simultaneously, you must note the following restrictions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot use the UNIQUE addition for standard tables. The system always generates the NON-UNIQUE addition automatically.&lt;/P&gt;&lt;P&gt;You must always specify the UNIQUE option when you create a hashed table.&lt;/P&gt;&lt;P&gt;Initial Memory Requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can specify the initial amount of main memory assigned to an internal table object when you define the data type using the following &lt;/P&gt;&lt;P&gt;addition:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIAL SIZE &amp;lt;n&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This size does not belong to the data type of the internal table, and does not affect the type check. You can use the above addition to &lt;/P&gt;&lt;P&gt;reserve memory space for &amp;lt;n&amp;gt; table lines when you declare the table object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When this initial area is full, the system makes twice as much extra space available up to a limit of 8KB. Further memory areas of 12KB each &lt;/P&gt;&lt;P&gt;are then allocated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can usually leave it to the system to work out the initial memory requirement. The first time you fill the table, little memory is used. The &lt;/P&gt;&lt;P&gt;space occupied, depending on the line width, is 16 &amp;lt;= &amp;lt;n&amp;gt; &amp;lt;= 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It only makes sense to specify a concrete value of &amp;lt;n&amp;gt; if you can specify a precise number of table entries when you create the table and &lt;/P&gt;&lt;P&gt;need to allocate exactly that amount of memory (exception: Appending table lines to ranked lists). This can be particularly important for &lt;/P&gt;&lt;P&gt;deep-structured internal tables where the inner table only has a few entries (less than 5, for example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To avoid excessive requests for memory, large values of &amp;lt;n&amp;gt; are treated as follows: The largest possible value of &amp;lt;n&amp;gt; is 8KB divided by the &lt;/P&gt;&lt;P&gt;length of the line. If you specify a larger value of &amp;lt;n&amp;gt;, the system calculates a new value so that n times the line width is around 12KB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Examples&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF LINE,&lt;/P&gt;&lt;P&gt;COLUMN1 TYPE I,&lt;/P&gt;&lt;P&gt;COLUMN2 TYPE I,&lt;/P&gt;&lt;P&gt;COLUMN3 TYPE I,&lt;/P&gt;&lt;P&gt;END OF LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES ITAB TYPE SORTED TABLE OF LINE WITH UNIQUE KEY COLUMN1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program defines a table type ITAB. It is a sorted table, with line type of the structure LINE and a unique key of the component &lt;/P&gt;&lt;P&gt;COLUMN1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES VECTOR TYPE HASHED TABLE OF I WITH UNIQUE KEY TABLE LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF LINE,&lt;/P&gt;&lt;P&gt;COLUMN1 TYPE I,&lt;/P&gt;&lt;P&gt;COLUMN2 TYPE I,&lt;/P&gt;&lt;P&gt;COLUMN3 TYPE I,&lt;/P&gt;&lt;P&gt;END OF LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES ITAB TYPE SORTED TABLE OF LINE WITH UNIQUE KEY COLUMN1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF DEEPLINE,&lt;/P&gt;&lt;P&gt;FIELD TYPE C,&lt;/P&gt;&lt;P&gt;TABLE1 TYPE VECTOR,&lt;/P&gt;&lt;P&gt;TABLE2 TYPE ITAB,&lt;/P&gt;&lt;P&gt;END OF DEEPLINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES DEEPTABLE TYPE STANDARD TABLE OF DEEPLINE&lt;/P&gt;&lt;P&gt;WITH DEFAULT KEY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program defines a table type VECTOR with type hashed table, the elementary line type I and a unique key of the entire table line. The &lt;/P&gt;&lt;P&gt;second table type is the same as in the previous example. The structure DEEPLINE contains the internal table as a component. The table &lt;/P&gt;&lt;P&gt;type DEEPTABLE has the line type DEEPLINE. Therefore, the elements of this internal table are themselves internal tables. The key is the &lt;/P&gt;&lt;P&gt;default key - in this case the column FIELD. The key is non-unique, since the table is a standard table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Internal table objects&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables are dynamic variable data objects. Like all variables, you declare them using the DATA statement. You can also declare static &lt;/P&gt;&lt;P&gt;internal tables in procedures using the STATICS statement, and static internal tables in classes using the CLASS-DATA statement. This &lt;/P&gt;&lt;P&gt;description is restricted to the DATA statement. However, it applies equally to the STATICS and CLASS-DATA statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference to Declared Internal Table Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like all other data objects, you can declare internal table objects using the LIKE or TYPE addition of the DATA statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA &amp;lt;itab&amp;gt; TYPE &amp;lt;type&amp;gt;|LIKE &amp;lt;obj&amp;gt; [WITH HEADER LINE].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, the LIKE addition refers to an existing table object in the same program. The TYPE addition can refer to an internal type in the &lt;/P&gt;&lt;P&gt;program declared using the TYPES statement, or a table type in the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must ensure that you only refer to tables that are fully typed. Referring to generic table types (ANY TABLE, INDEX TABLE) or not &lt;/P&gt;&lt;P&gt;specifying the key fully is not allowed (for exceptions, refer to Special Features of Standard Tables).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The optional addition WITH HEADER line declares an extra data object with the same name and line type as the internal table. This data &lt;/P&gt;&lt;P&gt;object is known as the header line of the internal table. You use it as a work area when working with the internal table (see Using the &lt;/P&gt;&lt;P&gt;Header Line as a Work Area). When you use internal tables with header lines, you must remember that the header line and the body of the &lt;/P&gt;&lt;P&gt;table have the same name. If you have an internal table with header line and you want to address the body of the table, you must indicate &lt;/P&gt;&lt;P&gt;this by placing brackets after the table name (&amp;lt;itab&amp;gt;[]). Otherwise, ABAP interprets the name as the name of the header line and not of the &lt;/P&gt;&lt;P&gt;body of the table. You can avoid this potential confusion by using internal tables without header lines. In particular, internal tables nested &lt;/P&gt;&lt;P&gt;in structures or other internal tables must not have a header line, since this can lead to ambiguous expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES VECTOR TYPE SORTED TABLE OF I WITH UNIQUE KEY TABLE LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ITAB TYPE VECTOR,&lt;/P&gt;&lt;P&gt; JTAB LIKE ITAB WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MOVE ITAB TO JTAB.   &amp;lt;-  Syntax error!&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE ITAB TO JTAB[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table object ITAB is created with reference to the table type VECTOR. The table object JTAB has the same data type as ITAB. JTAB also &lt;/P&gt;&lt;P&gt;has a header line. In the first MOVE statement, JTAB addresses the header line. Since this has the data type I, and the table type of ITAB &lt;/P&gt;&lt;P&gt;cannot be converted into an elementary type, the MOVE statement causes a syntax error. The second MOVE statement is correct, since &lt;/P&gt;&lt;P&gt;both operands are table objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Declaring New Internal Tables&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the DATA statement to construct new internal tables as well as using the LIKE or TYPE addition to refer to existing types or &lt;/P&gt;&lt;P&gt;objects. The table type that you construct does not exist in its own right; instead, it is only an attribute of the table object. You can refer to &lt;/P&gt;&lt;P&gt;it using the LIKE addition, but not using TYPE. The syntax for constructing a table object in the DATA statement is similar to that for defining &lt;/P&gt;&lt;P&gt;a table type in the TYPES statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA &amp;lt;itab&amp;gt; TYPE|LIKE &amp;lt;tabkind&amp;gt; OF &amp;lt;linetype&amp;gt; WITH &amp;lt;key&amp;gt;&lt;/P&gt;&lt;P&gt;       [INITIAL SIZE &amp;lt;n&amp;gt;]&lt;/P&gt;&lt;P&gt;       [WITH HEADER LINE].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As when you define a table type , the type constructor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;tabkind&amp;gt; OF &amp;lt;linetype&amp;gt; WITH &amp;lt;key&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;defines the table type &amp;lt;tabkind&amp;gt;, the line type &amp;lt;linekind&amp;gt;, and the key &amp;lt;key&amp;gt; of the internal table &amp;lt;itab&amp;gt;. Since the technical attributes of &lt;/P&gt;&lt;P&gt;data objects are always fully specified, the table must be fully specified in the DATA statement. You cannot create generic table types (ANY &lt;/P&gt;&lt;P&gt;TABLE, INDEX TABLE), only fully-typed tables (STANDARD TABLE, SORTED TABLE, HASHED TABLE). You must also specify the key and whether &lt;/P&gt;&lt;P&gt;it is to be unique (for exceptions, refer to Special Features of Standard Tables).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As in the TYPES statement, you can, if you wish, allocate an initial amount of memory to the internal table using the INITIAL SIZE addition. &lt;/P&gt;&lt;P&gt;You can create an internal table with a header line using the WITH HEADER LINE addition. The header line is created under the same &lt;/P&gt;&lt;P&gt;conditions as apply when you refer to an existing table type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA ITAB TYPE HASHED TABLE OF SPFLI&lt;/P&gt;&lt;P&gt;WITH UNIQUE KEY CARRID CONNID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table object ITAB has the type hashed table, a line type corresponding to the flat structure SPFLI from the ABAP Dictionary, and a &lt;/P&gt;&lt;P&gt;unique key with the key fields CARRID and CONNID. The internal table ITAB can be regarded as an internal template for the database table &lt;/P&gt;&lt;P&gt;SPFLI. It is therefore particularly suitable for working with data from this database table as long as you only access it using the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if usefull&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 05:42:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-internal-table/m-p/2952065#M696152</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T05:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: what is internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-internal-table/m-p/2952066#M696153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Ganeshan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;internal table is a data object which stores the data(multiple records) at run time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we are using these internal tables to retrieve/upload the data from SAP or into SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there are 3 types of internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Standard table&lt;/P&gt;&lt;P&gt;2. Sorted table.&lt;/P&gt;&lt;P&gt;3. Hashed table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both Standard &amp;amp; sorted tables are index based tables.&lt;/P&gt;&lt;P&gt;we can access the data from them by doing index operations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but we can access the data from Hashed table using key based operations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;Reward points if useful&amp;lt;/i&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2007 05:50:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-is-internal-table/m-p/2952066#M696153</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-12T05:50:33Z</dc:date>
    </item>
  </channel>
</rss>

