<?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 and work area in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275624#M783161</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u cannot use the internal table with header line when u deal with abap objects. no big difference other than that.&lt;/P&gt;&lt;P&gt;refer help document-980 for syntax.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Jan 2008 09:58:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-02T09:58:46Z</dc:date>
    <item>
      <title>Internal table and work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275620#M783157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;       can anybody explain the concepts of Internal table and work area.Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 06:43:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275620#M783157</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-02T06:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table and work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275621#M783158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;internal tables&lt;/STRONG&gt; are used for storing records which are obtained as a result when we use select statement on database. internal tables are run time entities and doesn't occupy any memory. they are dynamic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;internal tables are of types.&lt;/P&gt;&lt;P&gt;1. internal tables with header line. header and body&lt;/P&gt;&lt;P&gt;2. internal tables with out header line. only body&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;workarea&lt;/STRONG&gt; is the concept which is mainly useful when working with internal tables with out header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at any point of time we can access only one record through header of a internal table. every thing should be done inserting,modifying, reading through header only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex: data: itab like standard table of mara with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for internal tables with out header line we will create a work area explicit header as type of table for storing data into internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex: data: itab like mara,&lt;/P&gt;&lt;P&gt;wa like mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Internal tables are of 4 types&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1) Standard table&lt;/P&gt;&lt;P&gt;2) Sorted table&lt;/P&gt;&lt;P&gt;3) Hashed table&lt;/P&gt;&lt;P&gt;4) Index table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Standard table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defines the table as a standard table. This will always strore the data into internal table in the sorting order on Key Field using Linear search. This means that the time taken for searching records would be based on no. of records we are reading from the database. You should use index operations to access standard tables.&lt;/P&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;P&gt;data : itab type standard table of vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sorted table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Always defines the table in a sorted order. The records stored in this table will always be sorted using binary saerch on Key Field. If the key is not unique, the system takes the entry with the lowest index. The runtime required for key access is logarithmically related to the number of table entries. You can also access sorted tables by index operations.&lt;/P&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;P&gt;data : itab type sorted table of dfkkop with unique key vkont.&lt;/P&gt;&lt;P&gt;(or)&lt;/P&gt;&lt;P&gt;data : itab type sorted table of dfkkop with non-unique key vkont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Hashed table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defines the table as one that is managed with an internal hash procedure. You can imagine a hashed table as a set, whose elements you can address using their unique key. Unlike standard and sorted tables, you cannot access hash tables using an index. All entries in the table must have a unique key. Access time using the key is constant, regardless of the number of table entries.&lt;/P&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;P&gt;data : itab type hashed table of dfkkop with unique key vkont.&lt;/P&gt;&lt;P&gt;(or)&lt;/P&gt;&lt;P&gt;data : itab type hashed table of dfkkop with non-unique key vkont.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Index table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An index table is one that you can access using an index. Hashed tables are not index tables, and cannot therefore be passed to parameters defined as INDEX TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kanagaraja L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 06:50:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275621#M783158</guid>
      <dc:creator>Kanagaraja_L</dc:creator>
      <dc:date>2008-01-02T06:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table and work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275622#M783159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there are two types of internal tables .&lt;/P&gt;&lt;P&gt;one with header line and the other wothout header line.&lt;/P&gt;&lt;P&gt;the internal table occupies memory only at run time.&lt;/P&gt;&lt;P&gt;In case of internal table with header line , the first line of the table is the header or the workarea where the manipulations are done.&lt;/P&gt;&lt;P&gt;For an internal table without header line , the work area is not a part of the internal table . it is a seperate area where the manipulations are done and the internal table is updated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 06:54:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275622#M783159</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-02T06:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table and work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275623#M783160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kanagaraj /Priya raj&lt;/P&gt;&lt;P&gt;                        Thank you for your immediate responses , can you please give the syntax , In which cases can we use internal table and in which cases can we use wa.I am expecting your reply.................&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 07:12:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275623#M783160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-02T07:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table and work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275624#M783161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u cannot use the internal table with header line when u deal with abap objects. no big difference other than that.&lt;/P&gt;&lt;P&gt;refer help document-980 for syntax.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 09:58:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275624#M783161</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-02T09:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table and work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275625#M783162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Syntax is as folows:&lt;/P&gt;&lt;P&gt;DATA : LIT_TEST TYPE YCUSTOMER OCCURS 0 WITH HEADER LINE   .&lt;/P&gt;&lt;P&gt;DATA :      WA_TEST LIKE  LIT_TEST  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope u find it usefull.&lt;/P&gt;&lt;P&gt;Please awqrd points.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rahul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 10:34:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275625#M783162</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-02T10:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table and work area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275626#M783163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This may help u.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WORKAREA is a structure that can hold only one record at a time. It is a collection of fields. We use workarea as we cannot directly read from a table. In order to interact with a table we need workarea. When a Select Statement is executed on a table then the first record is read and put into the header of the table and from there put into the header or the workarea(of the same structure as that of the table)of the internal table and then transferred top the body of the internal table or directly displayed from the workarea.&lt;/P&gt;&lt;P&gt;Each row in a table is a record and each column is a field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While adding or retrieving records to / from internal table we have to keep the record temporarily.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The area where this record is kept is called as work area for the internal table. The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 10,&lt;/P&gt;&lt;P&gt;ab type c,&lt;/P&gt;&lt;P&gt;cd type i,&lt;/P&gt;&lt;P&gt;end of itab. " this table will have the header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: wa_itab like itab. " explicit work area for itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab1 like itab occurs 10. " table is without header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables are used for storing records which are obtained as a result when we use select statement on database. internal tables are run time entities and doesn't occupy any memory. they are dynamic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;internal tables are of types.&lt;/P&gt;&lt;P&gt;1. internal tables with header line. [header and body]&lt;/P&gt;&lt;P&gt;2. internal tables with out header line. [only body]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Workarea is the concept which is mainly useful when working with internal tables with out header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at any point of time we can access only one record through header of a internal table. every thing should be done [inserting,modifying, reading ] through header only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex: data: itab like standard table of mara with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for internal tables with out header line we will create a work area [explicit header] as type of table for storing data into internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex: data: itab like mara,&lt;/P&gt;&lt;P&gt;wa like mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;more about internal table types:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard table:&lt;/P&gt;&lt;P&gt;The key access to a standard table uses a sequential search. The time required for an access is linearly dependent on the number of entries in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should usually access a standard table with index operations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted table:&lt;/P&gt;&lt;P&gt;The table is always stored internally sorted by its key. Key access to a sorted table can therefore use a binary search. If the key is not unique, the entry with the lowest index is accessed. The time required for an access is logarithmically dependent on the number of entries in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Index accesses to sorted tables are also allowed. You should usually access a sorted table using its key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hash table:&lt;/P&gt;&lt;P&gt;The table is internally managed with a hash procedure. All the entries must have a unique key. The time required for a key access is constant, that is it does not depend on the number of entries in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot access a hash table with an index. Accesses must use generic key operations (SORT, LOOP, etc.).&lt;/P&gt;&lt;P&gt;Hashed tables&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;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;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;with regards,&lt;/P&gt;&lt;P&gt;B.Sowjanya,&lt;/P&gt;&lt;P&gt;reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 12:23:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-and-work-area/m-p/3275626#M783163</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-02T12:23:49Z</dc:date>
    </item>
  </channel>
</rss>

