<?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/1784524#M337971</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;If you are using occurs 0 you need not use work area .This itself acts as work area .It defaultly reserves a memory space for you to manipulate the data .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal table declared as&lt;/P&gt;&lt;P&gt;data : itab type table of &amp;lt;tablename&amp;gt;.&lt;/P&gt;&lt;P&gt;does not have field names hence by using ' with header line ' the line type &lt;/P&gt;&lt;P&gt;( field name ) is included.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But ' occurs ' and ' with header line ' are obsolete statements .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Dec 2006 08:26:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-07T08:26:07Z</dc:date>
    <item>
      <title>internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784510#M337957</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;     can any one explain mewhat is occurs 0 in internal tables?&lt;/P&gt;&lt;P&gt;what is the use with header line in internal tables?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 09:23:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784510#M337957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T09:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784511#M337958</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically occurs 0 indicates the initial size of the internal table ...SAP would allocate memory space for the specified records in SAP memory and if it exceeds the same it would put the store records in auxillary memory area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for header line..when you read the internal table either via read or loop the record read from the internal table is fetched and stored in the header..but as SAP standard they now specify to use work-areas instead of header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anurag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 09:29:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784511#M337958</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T09:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784512#M337959</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;Occurs '0' addition will not allocate memory area at first instance but at runtime it picks up all data.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Whenever u loop /read data from internal table either it will be read in hader area or workarea for tables without header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bharathi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 09:57:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784512#M337959</guid>
      <dc:creator>Bharathi_j</dc:creator>
      <dc:date>2006-11-30T09:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784513#M337960</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;Header line is a implicit work area for the internal table. The header line is a field string with the same structure as a row of the body, but it can only hold a single row , whereas internal table can have more than one record.&lt;/P&gt;&lt;P&gt;Data : itab like mara occurs 0 with header line.&lt;/P&gt;&lt;P&gt;will create internal table with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: itab like mara occurs 0. &lt;/P&gt;&lt;P&gt;will create internal table without header line. For this u need to create work area explicitly.&lt;/P&gt;&lt;P&gt;data: wa_itab like itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for more info,,&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb367a358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb367a358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sachidanand.B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls award helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 09:58:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784513#M337960</guid>
      <dc:creator>former_member758419</dc:creator>
      <dc:date>2006-11-30T09:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784514#M337961</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;pls go thru this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u will get good idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZTYPES                                                      *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
REPORT  ZTYPES                                                  .

* Table declaration (old method)
DATA: BEGIN OF tab_ekpo OCCURS 0,             "itab with header line
  ebeln TYPE ekpo-ebeln,
  ebelp TYPE ekpo-ebelp,
 END OF tab_ekpo.

*Table declaration (new method)     "USE THIS WAY!!!
TYPES: BEGIN OF t_ekpo,
  ebeln TYPE ekpo-ebeln,
  ebelp TYPE ekpo-ebelp,
 END OF t_ekpo.

DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,      "itab
      wa_ekpo TYPE t_ekpo.                    "work area (header line)

* Build internal table and work area from existing internal table
DATA: it_datatab LIKE tab_ekpo OCCURS 0,      "old method
      wa_datatab LIKE LINE OF tab_ekpo.

* Build internal table and work area from existing internal table,
* adding additional fields
TYPES: BEGIN OF t_repdata.
        INCLUDE STRUCTURE tab_ekpo.  "could include EKKO table itself!!

TYPES: bukrs  TYPE ekpo-werks,
       bstyp  TYPE ekpo-bukrs.
TYPES: END OF t_repdata.

DATA: it_repdata TYPE STANDARD TABLE OF t_repdata INITIAL SIZE 0,   "itab
      wa_repdata TYPE t_repdata.                 "work area (header line)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds&lt;/P&gt;&lt;P&gt;Anver&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 09:58:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784514#M337961</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-11-30T09:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784515#M337962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;    occurs statement is used to specify the body of the internal table. if you specify occurs 0, then the system inially allocates 8 bytes of memory to the internal table body and as the records filled the size of the table will be increased.&lt;/P&gt;&lt;P&gt;if you know the exact size of the internal table then you can specify that in the defination of the internal table itself through OCCURS clause to improve the performance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 09:59:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784515#M337962</guid>
      <dc:creator>srinivas_akiri</dc:creator>
      <dc:date>2006-11-30T09:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784516#M337963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  When you give Occurs addition it will try to allocate that much memory &lt;/P&gt;&lt;P&gt;  initially, when ever more data comes it will extend it.&lt;/P&gt;&lt;P&gt;  for example if you give occurs 0 , it will  not allocate any memory initially but at &lt;/P&gt;&lt;P&gt;  run time it will allocate.&lt;/P&gt;&lt;P&gt;  if you say occurs 5, it will allocate memory for 5 records and &lt;/P&gt;&lt;P&gt;  accordingly it will allocate at runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Header line is like work area, when you process records in your itab to store&lt;/P&gt;&lt;P&gt;  current record we use it. When you give this addition automatically it will have&lt;/P&gt;&lt;P&gt;  work area explicit work area is not required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Siri.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 10:05:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784516#M337963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T10:05:24Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784517#M337964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi kan ath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'll put it in my words&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wid d occurs statement u can reserve d memory space before d program runs&lt;/P&gt;&lt;P&gt;for eg: itab like table occurs 5&lt;/P&gt;&lt;P&gt;this will reserve memory space for 5 rows of the object itab...&lt;/P&gt;&lt;P&gt;the length of 1 row will be equal to the lenght of the structure table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wid header line wil create a workarea for the table object of d table name&lt;/P&gt;&lt;P&gt;wen u want to access d tables' data, u cant directly access it like in an array&lt;/P&gt;&lt;P&gt;i.e itab(2)-field and so on is not possible.&lt;/P&gt;&lt;P&gt;wat u need is a seperate data element which will hold the data from d table temprorarily&lt;/P&gt;&lt;P&gt;this is d use of a workarea...&lt;/P&gt;&lt;P&gt;Every int table has a workarea where d table data can be modified and accessed from&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u specify with header line while creating the table object....a workarea will be created wid d same name as that of d table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;d following r d differrences while workin wid tables wid and widout header lines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Header line                                           No header line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab                                           loop at itab into workarea&lt;/P&gt;&lt;P&gt;endloop                                                endloop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify itab                                           modify itab from workarea&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append itab                                          append workarea to itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and more.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here the name of the table refers to both the workarea and the table&lt;/P&gt;&lt;P&gt;to access the int table u can use the sqr brackets---&amp;gt; itab[]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can any points if this is helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vs&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 10:09:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784517#M337964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T10:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784518#M337965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The occurs clause addition or Initial size addition while declaring an internal table refers to the size of the memory area getting allocated at ruin time for the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The header line of an internal table is similar to that of a work area and with which the lineitems of the internal table can be processed according to your needs.&lt;/P&gt;&lt;P&gt;Object oriented programming approach in ABAP doesn't support internal tables with header lines. So other than the internal table, a work area has to be declared explicitly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Radhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2006 10:21:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784518#M337965</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-30T10:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784519#M337966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1). Allocating the extra memory for the structure is the concept of Internal table.&lt;/P&gt;&lt;P&gt;By default a structure can hold one record data. To make it to handle multiple records data, we use &amp;#145;occurs 0&amp;#146; statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#145;Occurs 0&amp;#146; statement allocates 8 kb (8*1024 bytes) of memory to the given table.&lt;/P&gt;&lt;P&gt;When we enter the data into the internal table. The records uses this memory. Even we entered 2 or 3 records, It consumes all the 8kb data. If we enters the records that exceeds to have more than 8kb memory, The &amp;#145;occurs 0&amp;#146; statement again allocates 8kb of memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So&amp;#133; if we use &amp;#145;occurs 0&amp;#146; statement, each time 8kb of memory will be allocated to the internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we use &amp;#145;occurs 1&amp;#146; statement rather than &amp;#145;occurs 0&amp;#146; it allocates memory for only one record. If we continue to enter the data into the ITAB. This statement passes the required memory dynamically. So, It is a good programming practice to use &amp;#145;occurs 1&amp;#146; as for as memory is considered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2). Internal table have two parts. One is header area and another one is body area.&lt;/P&gt;&lt;P&gt;When ever we enter a record into the ITAB. First it enters into the body area. When we use append statement. It populates the data in to the body area. Then 2nd record enters into the header. The same process continues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While reading also, We cant read the data of an ITAB directly from the body area. We need to bring a record into header and use it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 13:59:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784519#M337966</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T13:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784520#M337967</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;Occurs 0 specifies the initial size of your internal table.&lt;/P&gt;&lt;P&gt;The memory of any internal table is assigned in the form of blocks.. suppose you write occurs 10 initial size of the internal table will be 10 and as soon as you append the 11th record another block of memory of double the size of previous one that is 20 will  be created this time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Occurs 0 is used when you dont have the idea of number of records, it automatically gets adjusted to the number of records you are appending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;-pankaj singh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Dec 2006 14:03:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784520#M337967</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-05T14:03:15Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784521#M337968</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;An internal table is one of two structured data types in ABAP. It can contain any number of identically structured rows, with or without a header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The header line is similar to a structure and serves as the work area of the internal table. The data type of individual rows can be either elementary or structured.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When defining internal tables before release 6.40, you could not specify a start value with addition VALUE. As of release 6.40, you can specify IS INITIAL as a start value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The initial memory requirement defined during the creation of the internal table with the addition INITIAL SIZE or the obsolete addition OCCURS is determined and assigned to the data object n.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So occurs 0 is nothing but intial size is 0 for the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;gunasree.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 07:29:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784521#M337968</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T07:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784522#M337969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi kan ath&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By definition, Internal tables and Field strings&lt;/P&gt;&lt;P&gt;are user defined structured data types.&lt;/P&gt;&lt;P&gt;These internal tables can be created as a&lt;/P&gt;&lt;P&gt;replica of data base table, using some or all&lt;/P&gt;&lt;P&gt;fields of one table or more tables.&lt;/P&gt;&lt;P&gt;These internal tables are created only during &lt;/P&gt;&lt;P&gt;run time. No memory is reserved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Long Life data is stored in database tables. &lt;/P&gt;&lt;P&gt;When we are directly modifying data, there is &lt;/P&gt;&lt;P&gt;every possibility that we may loose data by &lt;/P&gt;&lt;P&gt;accident, which we can not afford to do so. &lt;/P&gt;&lt;P&gt;As such we need some intermediate tables to &lt;/P&gt;&lt;P&gt;do some operations. Up on satisfactory &lt;/P&gt;&lt;P&gt;results, we can modify database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically there are 2 types of Internal tables.&lt;/P&gt;&lt;P&gt;Internal tables with header line.&lt;/P&gt;&lt;P&gt;Internal tables without header line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you create internal table with header &lt;/P&gt;&lt;P&gt;line, a default work area is created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case, we need to create explicit work &lt;/P&gt;&lt;P&gt;area to work with it.&lt;/P&gt;&lt;P&gt;When we need to nest the tables with in &lt;/P&gt;&lt;P&gt;tables, we need to use this type of internal &lt;/P&gt;&lt;P&gt;table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 3 steps involved in creating Internal &lt;/P&gt;&lt;P&gt;tables.&lt;/P&gt;&lt;P&gt;Declaration of Internal table.&lt;/P&gt;&lt;P&gt;Populating Internal table.&lt;/P&gt;&lt;P&gt;Processing Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) data : itab like &amp;lt;table name&amp;gt; occurs 0 with   	      header line.&lt;/P&gt;&lt;P&gt;Itab : name of internal table.&lt;/P&gt;&lt;P&gt;&amp;lt;table name&amp;gt; : name of data base table.&lt;/P&gt;&lt;P&gt;Occurs 0 : performance factor.&lt;/P&gt;&lt;P&gt;By default internal table created is without &lt;/P&gt;&lt;P&gt;header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) data : begin of itab occurs 0.&lt;/P&gt;&lt;P&gt; 		     include structure &amp;lt;table name&amp;gt;.&lt;/P&gt;&lt;P&gt;    data : end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) data : begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;              carrid like sflight-carrid,&lt;/P&gt;&lt;P&gt;              connid like sflight-connid,&lt;/P&gt;&lt;P&gt;              fldate like sflight-fldate,&lt;/P&gt;&lt;P&gt;              end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) data : begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;              carrdid like sflight-carrid,&lt;/P&gt;&lt;P&gt;              connid like sflight-connid,&lt;/P&gt;&lt;P&gt;              bookid like sbook-bookid,&lt;/P&gt;&lt;P&gt;              fldate like sbook-fldate,&lt;/P&gt;&lt;P&gt;              end of itab.&lt;/P&gt;&lt;P&gt;( In this case we are using fields from more than one table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) itab-name = &amp;#145;abcd&amp;#146;.&lt;/P&gt;&lt;P&gt;    Append itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal table can be declared in the following ways:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;#149;	Data	:	Itab like sflight occurs 0 with header line&lt;/P&gt;&lt;P&gt;		Here you are declaring internal table, which is similar to sflight i.e., itab like sflight i.e., you are referring to existing table (like).&lt;/P&gt;&lt;P&gt;(By default internal table created with this declaration is without header line).&lt;/P&gt;&lt;P&gt;		&lt;/P&gt;&lt;P&gt;&amp;#149;	Data	:	Begin of itab occurs 0.&lt;/P&gt;&lt;P&gt;  Include structure sflight&lt;/P&gt;&lt;P&gt;      Data	:	End of itab&lt;/P&gt;&lt;P&gt;		(Internal Table created with this type of declaration is similar to declaration done in &amp;#145;a&amp;#146; type the only difference is by default internal table created by this type is with header line)&lt;/P&gt;&lt;P&gt;		&lt;/P&gt;&lt;P&gt;&amp;#149;	Data	:	Begin of itab occurs 0&lt;/P&gt;&lt;P&gt;  carrid like sflight-carrid,&lt;/P&gt;&lt;P&gt;  connid like sflight-connid,&lt;/P&gt;&lt;P&gt;  fldate like sflight-f1date&lt;/P&gt;&lt;P&gt;End of itab.&lt;/P&gt;&lt;P&gt;		By default internal table created by this type of declaration is with header line.  In this type of declaration, you are using only those fields from database table, which you require for processing.&lt;/P&gt;&lt;P&gt;		&lt;/P&gt;&lt;P&gt;&amp;#149;	Data	:	Begin of itab occurs 0&lt;/P&gt;&lt;P&gt;  carrid like sflight-carrid,&lt;/P&gt;&lt;P&gt;  connid like sflight-connid,&lt;/P&gt;&lt;P&gt;  bookid like sbook-bookid&lt;/P&gt;&lt;P&gt;  id like scustom-id,&lt;/P&gt;&lt;P&gt;End of itab.&lt;/P&gt;&lt;P&gt;		Here you are combining fields from three different tables in one internal table.&lt;/P&gt;&lt;P&gt;		&lt;/P&gt;&lt;P&gt;&amp;#149;	Data	:	Begin of itab occurs 0&lt;/P&gt;&lt;P&gt;  Carrid1 like sflight-carrid,&lt;/P&gt;&lt;P&gt;End of itab.&lt;/P&gt;&lt;P&gt;Here you are specifying different field names.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 07:59:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784522#M337969</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T07:59:54Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784523#M337970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Occurs 0 indicates the initial size of the internal table ...SAP would allocate memory space for the specified records in SAP memory and if it exceeds the same it would put the store records in auxillary memory area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Header line is an implicit work area for the internal table..when you read the internal table either via read or loop the record read from the internal table is fetched and stored in the header..but now we use work area instead of headerl line..its obsolete as per sap standards..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 08:18:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784523#M337970</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T08:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784524#M337971</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;If you are using occurs 0 you need not use work area .This itself acts as work area .It defaultly reserves a memory space for you to manipulate the data .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal table declared as&lt;/P&gt;&lt;P&gt;data : itab type table of &amp;lt;tablename&amp;gt;.&lt;/P&gt;&lt;P&gt;does not have field names hence by using ' with header line ' the line type &lt;/P&gt;&lt;P&gt;( field name ) is included.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But ' occurs ' and ' with header line ' are obsolete statements .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 08:26:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784524#M337971</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T08:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784525#M337972</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;Using ' occurs ' in internal table will allocate memory for the internal table at runtime .&lt;/P&gt;&lt;P&gt;example ;&lt;/P&gt;&lt;P&gt;data : it_makt type makt occurs 2 with header line.&lt;/P&gt;&lt;P&gt;Generally in internal table the field names are not included ie.,&lt;/P&gt;&lt;P&gt;data : itab type table of  &amp;lt;table name&amp;gt; .  does not contain line type  (field name).&lt;/P&gt;&lt;P&gt;  '  with header line ' includes line type to the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but ' occurs ' and ' with header line ' are obsolete .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Dec 2006 08:54:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784525#M337972</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-07T08:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784526#M337973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;while declaring internal tables we need to give occurs 0.occurs is used to reserve the memory space.if we do not give occurs then it is not treated as internal table.&lt;/P&gt;&lt;P&gt;there r two types with header line and without  header line.&lt;/P&gt;&lt;P&gt;with header line is to include the work area.if we use with header line then it includes both header and the body or else it will include only the body of the internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2007 11:18:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784526#M337973</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-11T11:18: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/1784527#M337974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi kan,&lt;/P&gt;&lt;P&gt;the internal tables can be defined in 2 ways:&lt;/P&gt;&lt;P&gt;1) internal tables with header line&lt;/P&gt;&lt;P&gt;2) internal table without header line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First let me tell u about occurs 0 in internal table:&lt;/P&gt;&lt;P&gt;Whenever we define an internal table with occurs 0...it will allocate an 8Kb of memory size to that internal table. also when we define an internal table with occurs 0 it will be with header line...Also work area (body) will be assigned to that internal table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define:&lt;/P&gt;&lt;P&gt;Data : begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;          field1 like Databasetable-field,&lt;/P&gt;&lt;P&gt;          end of itab.&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;data : itab like Databasetable occurs 0 with header line. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here the internal table ITAB will have a memory size of 8Kb intially...also it will be with header line...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now internal table without header line will not have the work area (body). we will have to define the work area for that internal table...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 May 2007 07:13:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784527#M337974</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-12T07:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784528#M337975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi kan&lt;/P&gt;&lt;P&gt;      Occurs 0-allocates 8kb of default memory&lt;/P&gt;&lt;P&gt;there are 2 types of internal table&lt;/P&gt;&lt;P&gt;1.internal table with header line&lt;/P&gt;&lt;P&gt;2.internal table without header line&lt;/P&gt;&lt;P&gt;---If you use Occurs 0 then it is Internal table with header line,so default work area will be automatically created.so the records that you need to append into internal table first goes into work area and then into internal table.so records are appended one by one..&lt;/P&gt;&lt;P&gt;---But if you do not use Occurs 0 then it is internal table without header line,so you have to create default work area.This is always recommended since if you create your own work area then it will be effiecient since you are decalaring it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REWARD IT PLEASE....!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 May 2007 09:10:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784528#M337975</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-14T09:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784529#M337976</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Internal table with Header line:&lt;/STRONG&gt; By default with header line creates one work area with the name of internal table. That means the name of the work area as well as name of the internal table as similarly.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Types:   begin of &amp;lt;type_name&amp;gt;&lt;BR /&gt;            --------------&lt;BR /&gt;            ---------------&lt;BR /&gt;          End of &amp;lt;type_name&amp;gt; . &lt;BR /&gt;Data: it_tab type table of &amp;lt;type_name&amp;gt; with header line.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;Occurs 0 in internal table : &lt;/STRONG&gt;occurs 0 indicates the initial size of the internal table...  occurs 0 by default allocates 8 kb of memory for the internal table. If the data in the internal table exceeds 8 kb, then it’ll provide one more 8 kb of memory … up to 2 GB.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;EM&gt;Syntax: -&lt;/EM&gt;
Data: begin of &amp;lt;type_name&amp;gt; occurs 0, &lt;BR /&gt;      ------------------- &lt;BR /&gt;      ----------------- &lt;BR /&gt;       End of &amp;lt;type_name&amp;gt;. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt; Occurs ‘n’: - &lt;/STRONG&gt;By default it allocates ‘n’ records of memory for internal table. If the data in the internal 
table exceeds 10 records. Then it’ll be allocates one more ‘n’ records of memory ---- up to 2 GB.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jan 2022 07:50:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/1784529#M337976</guid>
      <dc:creator>Preetha33</dc:creator>
      <dc:date>2022-01-23T07:50:43Z</dc:date>
    </item>
  </channel>
</rss>

