<?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: internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274757#M782933</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi tanuj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can declatre internal tables in two ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;occurs  N  with header line (N is a integer)&lt;/P&gt;&lt;P&gt;without header line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syntax 1: begin of internal table name occurs N with&lt;/P&gt;&lt;P&gt;header        line,&lt;/P&gt;&lt;P&gt;            filed declarations,&lt;/P&gt;&lt;P&gt;            end of internal table name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syntax 2: begin of internal table name,&lt;/P&gt;&lt;P&gt;            filed declarations,&lt;/P&gt;&lt;P&gt;            end of internal table name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want copy data base table  as internal table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syntax3: itab like DBtable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Jan 2008 05:35:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-21T05:35:39Z</dc:date>
    <item>
      <title>internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274751#M782927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what are the different ways of declaring an internal tables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2008 09:53:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274751#M782927</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-16T09:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274752#M782928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tanuj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Types: begin of ty_itab,&lt;/P&gt;&lt;P&gt;matnr type mara-matrn,&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;end of ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;types: begin of ty_itab.&lt;/P&gt;&lt;P&gt;include type mara.&lt;/P&gt;&lt;P&gt;types: end of ty-itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lt_itab type table of ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: wa_itab type ty_itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Santosh Thorat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2008 09:56:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274752#M782928</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-16T09:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274753#M782929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;  data:&lt;/P&gt;&lt;P&gt;      begin of it_tab occurs 0,&lt;/P&gt;&lt;P&gt;          fieldnames,&lt;/P&gt;&lt;P&gt;      end of it_tab.&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;    it_tab &amp;lt;like or type&amp;gt; table of &amp;lt;tablename&amp;gt; with header line.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Plzz reward points if it helps.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2008 09:57:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274753#M782929</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-16T09:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274754#M782930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. With Header Line.&lt;/P&gt;&lt;P&gt;2. W/o Header Line, need to specify the Work area explicitly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples for 1st case:&lt;/P&gt;&lt;P&gt;Data: Begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;          f1(10) type c,&lt;/P&gt;&lt;P&gt;          f2(10) type c,&lt;/P&gt;&lt;P&gt;          etc...&lt;/P&gt;&lt;P&gt;         End of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: itab like mara occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example for 2nd case&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Types: begin of ty_tab,&lt;/P&gt;&lt;P&gt;            f1(10) type c,&lt;/P&gt;&lt;P&gt;            f2(10) type c,&lt;/P&gt;&lt;P&gt;            etc...&lt;/P&gt;&lt;P&gt;          end of ty_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: itab type table of ty_tab,&lt;/P&gt;&lt;P&gt;        wa type ty_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2008 09:58:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274754#M782930</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-16T09:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274755#M782931</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;In early versions they declare an internal table with the header line, which we can call as a work area in recent versions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now a days we can define an internal area as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first we have to create a structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of &amp;lt;structure name&amp;gt;,&lt;/P&gt;&lt;P&gt;          -&lt;/P&gt;&lt;HR originaltext="----" /&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;          list of feilds,&lt;/P&gt;&lt;P&gt;         -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;,&lt;/P&gt;&lt;P&gt;         end of &amp;lt;structure name&amp;gt;.&lt;/P&gt;&lt;P&gt;          &lt;/P&gt;&lt;P&gt;after that we have to define table type as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type &amp;lt;internal table name&amp;gt; type &amp;lt; table type&amp;gt; of &amp;lt; structure name&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after that we can create table object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data &amp;lt;internal table name&amp;gt; type &amp;lt;internal table name&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after this we ahve to create a work area.. this is hsud of above struct type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data &amp;lt;wa&amp;gt; type &amp;lt;struct name&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is basic thing..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sandeep&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sandeep Manukonda on Jan 20, 2008 11:08 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Jan 2008 22:08:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274755#M782931</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-20T22:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274756#M782932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&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;Internal tables&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;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, &lt;/P&gt;&lt;P&gt;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 &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;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 &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;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 &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;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 &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;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 &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;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 &lt;/P&gt;&lt;P&gt;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 &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;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 &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;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. &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;Creating Internal Tables&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;Internal table types&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;Examples&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;Internal table objects&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;Declaring New Internal Tables&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 05:22:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274756#M782932</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-21T05:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274757#M782933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi tanuj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can declatre internal tables in two ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;occurs  N  with header line (N is a integer)&lt;/P&gt;&lt;P&gt;without header line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syntax 1: begin of internal table name occurs N with&lt;/P&gt;&lt;P&gt;header        line,&lt;/P&gt;&lt;P&gt;            filed declarations,&lt;/P&gt;&lt;P&gt;            end of internal table name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syntax 2: begin of internal table name,&lt;/P&gt;&lt;P&gt;            filed declarations,&lt;/P&gt;&lt;P&gt;            end of internal table name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you want copy data base table  as internal table,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syntax3: itab like DBtable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 05:35:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274757#M782933</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-21T05:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274758#M782934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;    Following are the ways of declaring an Internal Table.&lt;/P&gt;&lt;P&gt;***************&lt;STRONG&gt;Internal table declaration Type1&lt;/STRONG&gt;**********&lt;/P&gt;&lt;P&gt;types : begin of customer,&lt;/P&gt;&lt;P&gt;             fname(12) type c,&lt;/P&gt;&lt;P&gt;             lname(12),&lt;/P&gt;&lt;P&gt;       end of customer.&lt;/P&gt;&lt;P&gt;data : Internal_tab1 type customer occurs 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***************&lt;STRONG&gt;Internal table declaration Type2&lt;/STRONG&gt;**********&lt;/P&gt;&lt;P&gt;types : begin of customer1,&lt;/P&gt;&lt;P&gt;             fname(12) type c,&lt;/P&gt;&lt;P&gt;             lname(12),&lt;/P&gt;&lt;P&gt;       end of customer1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : internal_tab2 type standard table of customer1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*************&lt;STRONG&gt;Internal table declaration Type3&lt;/STRONG&gt;************&lt;/P&gt;&lt;P&gt;data : begin of internal_tab3 occurs 0,&lt;/P&gt;&lt;P&gt;             fname(12) type c,&lt;/P&gt;&lt;P&gt;             lname(12),&lt;/P&gt;&lt;P&gt;       end of internal_tab3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*************&lt;STRONG&gt;Internal table declaration Type4&lt;/STRONG&gt;************&lt;/P&gt;&lt;P&gt;data : Internal_tab4 type standard table of but000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*************&lt;STRONG&gt;Internal table declaration Type5&lt;/STRONG&gt;************&lt;/P&gt;&lt;P&gt;data : Internal_tab5 type but000 occurs 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward if helpful.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 05:49:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274758#M782934</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-21T05:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274759#M782935</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 can be declared in two types :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. with header line.&lt;/P&gt;&lt;P&gt;2. without header line.&lt;/P&gt;&lt;P&gt;3. Referring to a structure declared in the program.&lt;/P&gt;&lt;P&gt;4. Referring to a standard table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. data:begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;    -&lt;/P&gt;&lt;HR originaltext="------" /&gt;&lt;P&gt; end of itab.&lt;/P&gt;&lt;P&gt;2. data: begin of itab,&lt;/P&gt;&lt;P&gt; -&lt;/P&gt;&lt;HR originaltext="--------" /&gt;&lt;P&gt; end of itab.&lt;/P&gt;&lt;P&gt;3.  types: begin of st,&lt;/P&gt;&lt;P&gt;    -&lt;/P&gt;&lt;HR originaltext="--------------" /&gt;&lt;P&gt;  end of st.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab type table of st with header line.&lt;/P&gt;&lt;P&gt;   (or)&lt;/P&gt;&lt;P&gt;data: itab type table of st,&lt;/P&gt;&lt;P&gt;        wa type st.&lt;/P&gt;&lt;P&gt;4...Data: itab like standard table of vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;types of Internat table&lt;/U&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. hash table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2008 14:07:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274759#M782935</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-09T14:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274760#M782936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;
We have many ways to define internal tables
1.
&lt;PRE&gt;&lt;CODE&gt;"with header line
DATA:
      BEGIN OF I_PA0001 OCCURS 0,
        PERNR TYPE PA0001-PERNR,
        ENAME TYPE PA0001-ENAME,
      END OF I_PA0001.&lt;/CODE&gt;&lt;/PRE&gt;
2.
&lt;PRE&gt;&lt;CODE&gt;"with header line
DATA:
      BEGIN OF w_PA0001, 
        PERNR TYPE PA0001-PERNR,
        ENAME TYPE PA0001-ENAME,
      END OF w_PA0001.
DATA: i_pa0001 like w_PA0001 OCCURS 0 WITH HEADER LINE.&lt;/CODE&gt;&lt;/PRE&gt;
3.
&lt;PRE&gt;&lt;CODE&gt;"without header line
DATA:
      BEGIN OF w_PA0001, 
        PERNR TYPE PA0001-PERNR,
        ENAME TYPE PA0001-ENAME,
      END OF w_PA0001.
DATA: i_pa0001 like w_PA0001 OCCURS 0.&lt;/CODE&gt;&lt;/PRE&gt;
4.
&lt;PRE&gt;&lt;CODE&gt;"with header line
TYPES:
      BEGIN OF t_pa0001,
        pernr TYPE pa0001-pernr,
        ename TYPE pa0001-ename,
      END OF t_pa0001.
DATA: i_pa0001 TYPE t_pa0001 OCCURS 0 WITH HEADER LINE.&lt;/CODE&gt;&lt;/PRE&gt;
5.
&lt;PRE&gt;&lt;CODE&gt;"without header line
TYPES:
      BEGIN OF t_pa0001,
        pernr TYPE pa0001-pernr,
        ename TYPE pa0001-ename,
      END OF t_pa0001.
DATA:w_pa0001 TYPE t_pa0001
data: i_pa0001 TYPE t_pa0001 OCCURS 0.&lt;/CODE&gt;&lt;/PRE&gt;
6.
&lt;PRE&gt;&lt;CODE&gt;"without header line
TYPES:
      BEGIN OF t_pa0001,
        pernr TYPE pa0001-pernr,
        ename TYPE pa0001-ename,
      END OF t_pa0001.
DATA:w_pa0001 TYPE t_pa0001.
DATA: i_pa0001 TYPE TABLE OF t_pa0001.&lt;/CODE&gt;&lt;/PRE&gt;
7.
&lt;PRE&gt;&lt;CODE&gt;"with header line
TYPES:
      BEGIN OF t_pa0001,
        pernr TYPE pa0001-pernr,
        ename TYPE pa0001-ename,
      END OF t_pa0001.
DATA:w_pa0001 TYPE t_pa0001.
DATA: i_pa0001 TYPE TABLE OF t_pa0001 WITH HEADER LINE.&lt;/CODE&gt;&lt;/PRE&gt;
8.STANDARD TABLE 
&lt;PRE&gt;&lt;CODE&gt;"without header line
TYPES:
      BEGIN OF t_pa0001,
        pernr TYPE pa0001-pernr,
        ename TYPE pa0001-ename,
      END OF t_pa0001.
DATA:w_pa0001 TYPE t_pa0001.
DATA: i_pa0001 TYPE STANDARD TABLE OF t_pa0001.&lt;/CODE&gt;&lt;/PRE&gt;
9.STANDARD TABLE 
&lt;PRE&gt;&lt;CODE&gt;"with header line
TYPES:
      BEGIN OF t_pa0001,
        pernr TYPE pa0001-pernr,
        ename TYPE pa0001-ename,
      END OF t_pa0001.
DATA:w_pa0001 TYPE t_pa0001.
DATA: i_pa0001 TYPE STANDARD TABLE OF t_pa0001 WITH HEADER LINE.&lt;/CODE&gt;&lt;/PRE&gt;
10.STANDARD TABLE 
&lt;PRE&gt;&lt;CODE&gt;"without header line
TYPES:
      BEGIN OF t_pa0001,
        pernr TYPE pa0001-pernr,
        ename TYPE pa0001-ename,
      END OF t_pa0001.
DATA:w_pa0001 TYPE t_pa0001.
DATA: i_pa0001 TYPE STANDARD TABLE OF t_pa0001 WITH NON-UNIQUE KEY pernr.&lt;/CODE&gt;&lt;/PRE&gt;
11.SORTED TABLE
&lt;PRE&gt;&lt;CODE&gt;"without header line and without specifying key
TYPES:
      BEGIN OF t_pa0001,
        pernr TYPE pa0001-pernr,
        ename TYPE pa0001-ename,
      END OF t_pa0001.
DATA:w_pa0001 TYPE t_pa0001.
DATA: i_pa0001 TYPE SORTED TABLE OF t_pa0001.&lt;/CODE&gt;&lt;/PRE&gt;
12.SORTED TABLE
&lt;PRE&gt;&lt;CODE&gt;"without header line and with key specification
TYPES:
      BEGIN OF t_pa0001,
        pernr TYPE pa0001-pernr,
        ename TYPE pa0001-ename,
      END OF t_pa0001.
DATA:w_pa0001 TYPE t_pa0001.
DATA: i_pa0001 TYPE SORTED TABLE OF t_pa0001 WITH UNIQUE KEY pernr.&lt;/CODE&gt;&lt;/PRE&gt;
13.HASHED TABLE 
&lt;PRE&gt;&lt;CODE&gt;"without header line
TYPES:
      BEGIN OF t_pa0001,
        pernr TYPE pa0001-pernr,
        ename TYPE pa0001-ename,
      END OF t_pa0001.
DATA:w_pa0001 TYPE t_pa0001.
DATA: i_pa0001 TYPE HASHED TABLE OF t_pa0001.&lt;/CODE&gt;&lt;/PRE&gt;
14.HASHED TABLE 
&lt;PRE&gt;&lt;CODE&gt;"without header line
TYPES:
      BEGIN OF t_pa0001,
        pernr TYPE pa0001-pernr,
        ename TYPE pa0001-ename,
      END OF t_pa0001.
DATA:w_pa0001 TYPE t_pa0001.
DATA: i_pa0001 TYPE HASHED TABLE OF t_pa0001 WITH UNIQUE KEY pernr.&lt;/CODE&gt;&lt;/PRE&gt;
15.If it is HR table, we have to define like below. u can define the way as well.
&lt;PRE&gt;&lt;CODE&gt;INFOTYPES:0001,0002.&lt;/CODE&gt;&lt;/PRE&gt;

I hope that it helps you to understand .

Regards,
Venkat.O
&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2008 15:26:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3274760#M782936</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2008-04-09T15:26:45Z</dc:date>
    </item>
  </channel>
</rss>

