<?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 table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997779#M406348</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Two types of internal tables:&lt;/P&gt;&lt;P&gt;One &amp;lt;b&amp;gt;with header line&amp;lt;/b&amp;gt; and &lt;/P&gt;&lt;P&gt;Another &amp;lt;b&amp;gt;&amp;lt;b&amp;gt;without Header line&amp;lt;/b&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on your requirement you use the either type.&lt;/P&gt;&lt;P&gt;Mostly we use the first one with Header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Mar 2007 07:54:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-07T07:54:06Z</dc:date>
    <item>
      <title>internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997778#M406347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;types of internal table? how we decide which type we have to use? could u plzz tell me the answer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2007 07:50:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997778#M406347</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-07T07:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997779#M406348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Two types of internal tables:&lt;/P&gt;&lt;P&gt;One &amp;lt;b&amp;gt;with header line&amp;lt;/b&amp;gt; and &lt;/P&gt;&lt;P&gt;Another &amp;lt;b&amp;gt;&amp;lt;b&amp;gt;without Header line&amp;lt;/b&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on your requirement you use the either type.&lt;/P&gt;&lt;P&gt;Mostly we use the first one with Header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2007 07:54:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997779#M406348</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-07T07:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997780#M406349</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;Three types of internal tables :&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Standard Internal Tables&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;Standard tables have a linear index. You can access them using either the index or the key.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Sorted Internal Tables&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;Sorted tables are always saved correctly sorted by key. They also have a linear key, and, like standard tables, you can access them using either the table index or the key.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Hashed Internal Tables&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;Hashes tables have no internal linear index. You can only access hashed tables by specifying the key.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satyendra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2007 08:00:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997780#M406349</guid>
      <dc:creator>satykumar</dc:creator>
      <dc:date>2007-03-07T08:00:00Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997781#M406350</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; there are Standard tables, Sorted Tables, Hashed Tables,Indexed Tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  based on your requirement , you can choose the table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  let me explain the details of tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard Table - the most commonly used type of table. You can sort and resort this table anytime. You can have duplicate records in them. Recommend that when accessing these tables, you sort them by a key and then READ via a BINARY SEARCH - better performance. When you write to this table the record is "appended" to the end of the table. In order to maintain the sort sequence (if any) you must use the SORT command again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted table - this table has a defined sort sequence. You cannot resort. You can have duplicates. When you READ these tables, SAP automatically tries to use a BINARY SEARCH. Because you use a Binary Search, the retrieval time isexpodential to the number of records. When you write a record to this table the table is resorted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed Table - this table has a defined key. When you write to the table it uses a hashing algorithm to identify where the record is stored (think if this as writing the location of a page in an index of a book). When you READ this table the system looks up this "index" and retrieves the record. Because of this the retrieval time is constant. Writing to this type of table takes the most time as it needs to calculate the hashing algorithm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward useful points&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2007 08:00:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997781#M406350</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-07T08:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997782#M406351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;see this link: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb366d358411d1829f0000e829fbfe/content.htm"&amp;gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb366d358411d1829f0000e829fbfe/content.htm&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2007 08:02:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997782#M406351</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-07T08:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997783#M406352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer to the following.&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 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;P&gt;&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prasanth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*reward all the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2007 08:03:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997783#M406352</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-07T08:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997784#M406353</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 &amp;lt;b&amp;gt;with header line&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;without header line&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we can declare them in different ways.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)&amp;lt;this has header line&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Data: Begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;         matnr like mara-matnr,&lt;/P&gt;&lt;P&gt;          -&lt;/P&gt;&lt;HR originaltext="---------------------" /&gt;&lt;P&gt;         end of itab.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can specify whatever fields you require.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 2) &amp;lt; has header line&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;data:itab type standard table of mara with header line.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it has all the fields of MARA table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3)&amp;lt;this is type declaration&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types:begin of ty_tab, &lt;/P&gt;&lt;P&gt;       matnr like mara-matnr,&lt;/P&gt;&lt;P&gt;      end of ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;internal table declaration using above type&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;it has header line&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;data:itab type standard table of ty_itab with header line.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or you can declare like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;internal table declaration using above type&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&amp;lt;int. table without header line&amp;gt;&lt;/P&gt;&lt;P&gt;data:itab type table of ty_itab,&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;work area&amp;gt;&lt;/P&gt;&lt;P&gt;wa_itab type itab. &amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the itab has header line, you can loop at itab directly and fetch the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;loop at itab.&lt;/P&gt;&lt;P&gt;write:/ itab-matnr.&lt;/P&gt;&lt;P&gt;endloop.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when u execute in debug mode, you can understand clearly&lt;/P&gt;&lt;P&gt;with header line means it has implicit work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when you loop,each record one by one comes to the header and gets displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it does not have header line, you have to explicitly use the work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;loop at itab into wa_itab.&lt;/P&gt;&lt;P&gt;write:/ wa-itab-matnr,&lt;/P&gt;&lt;P&gt;endloop.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have to move each record into workarea and display that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for more help, you can look at F1 help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it helps you&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        sowjanya s&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2007 08:04:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1997784#M406353</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-07T08:04:31Z</dc:date>
    </item>
  </channel>
</rss>

