Clear idea about internal table.

I'm new in sap. i need a clear idea about what is  table type , line type and  type groups   in internal table. and why we are using this ?  and give me an idea about work area also.. theses terms are confusing me. if possible please explain me with example. thanks in advance.
Welcome to SCN - but please do not duplicate post or ask basic questions.
Edited by: Rob Burbank on Apr 19, 2009 4:20 P

I'm new in sap. i need a clear idea about what is  table type , line type and  type groups   in internal table. and why we are using this ?  and give me an idea about work area also.. theses terms are confusing me. if possible please explain me with example. thanks in advance.
Welcome to SCN - but please do not duplicate post or ask basic questions.
Edited by: Rob Burbank on Apr 19, 2009 4:20 P

Similar Messages

  • Need information about Internal Tables

    Hi Every one!
    I Need some information about Internal tables. Pls help be above the same.
    Thanks & with Regards,
    Chandra.

    Hi..,
    <b>
    Internal tables </b>
    Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for storing and formatting data from a database table within a program. They are also a good way of including very complicated data structures in an ABAP program.
    Like all elements in the ABAP type concept, internal tables can exist both as data types and as data objects A data type is the abstract description of an internal table, either in a program or centrally in the ABAP Dictionary, that you use to create a concrete data object. The data type is also an attribute of an existing data object.
    <b>Internal Tables as Data Types</b>
    Internal tables and structures are the two structured data types in ABAP. The data type of an internal table is fully specified by its line type, key, and table type.
    <b>Line type</b>
    The line type of an internal table can be any data type. The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table. However, the line type may also be elementary or another internal table.
    <b>Key</b>
    The key identifies table rows. There are two kinds of key for internal tables - the standard key and a user-defined key. You can specify whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness depends on the table access method.
    If a table has a structured line type, its default key consists of all of its non-numerical columns that are not references or themselves internal tables. If a table has an elementary line type, the default key is the entire line. The default key of an internal table whose line type is an internal table, the default key is empty.
    The user-defined key can contain any columns of the internal table that are not references or themselves internal tables. Internal tables with a user-defined key are called key tables. When you define the key, the sequence of the key fields is significant. You should remember this, for example, if you intend to sort the table according to the key.
    <b>
    Table type</b>
    The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:
    <u>Standard tables</u> have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries.
    <u>
    Sorted tables</u> are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be unique or not. Standard tables and sorted tables are known generically as index tables.
    <u>
    Hashed tables</u> have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.
    <b>
    Generic Internal Tables</b>
    Unlike other local data types in programs, you do not have to specify the data type of an internal table fully. Instead, you can specify a generic construction, that is, the key or key and line type of an internal table data type may remain unspecified. You can use generic internal tables to specify the types of field symbols and the interface parameters of procedures . You cannot use them to declare data objects.
    <b>Internal Tables as Dynamic Data Objects</b>
    Data objects that are defined either with the data type of an internal table, or directly as an internal table, are always fully defined in respect of their line type, key and access method. However, the number of lines is not fixed. Thus internal tables are dynamic data objects, since they can contain any number of lines of a particular type. The only restriction on the number of lines an internal table may contain are the limits of your system installation. The maximum memory that can be occupied by an internal table (including its internal administration) is 2 gigabytes. A more realistic figure is up to 500 megabytes. An additional restriction for hashed tables is that they may not contain more than 2 million entries. The line types of internal tables can be any ABAP data types - elementary, structured, or internal tables. The individual lines of an internal table are called table lines or table entries. Each component of a structured line is called a column in the internal table.
    <b>
    Choosing a Table Type</b>
    The table type (and particularly the access method) that you will use depends on how the typical internal table operations will be most frequently executed.
    <b>
    Standard tables</b>
    This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship with the number of table entries. If you need key access, standard tables are particularly useful if you can fill and process the table in separate steps. For example, you could fill the table by appending entries, and then sort it. If you use the binary search option with key access, the response time is logarithmically proportional to the number of table entries.
    <b>Sorted tables</b>
    This is the most appropriate type if you need a table which is sorted as you fill it. You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the table key in the WHERE condition.
    <b>
    Hashed tables</b>
    This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index. The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for processing large amounts of data.
    regards,
    sai ramesh

  • Briefly about internal tables

    briefly about internal tables
    standerd internal tables
    hash internal tables
    sorted internal tables
    index internal tables

    Hi,
    Internal tables : Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data objects, they save the programmer the task of dynamic memory management in his or her programs.
    Types of internal tables :
    The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:
    Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access records either by using the table index or the key. The response time for key access is proportional to the number of entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key. This means that standard tables can always be filled very quickly, since the system does not have to check whether there are already existing entries.
    Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique or non-unique. When you define the table, you must specify whether the key is to be UNIQUE or NON-UNIQUE. Standard tables and sorted tables are known generically as index tables.
    Hashed tables have no linear index. You can only access a hashed table using its key. The response time is independent of the number of table entries, and is constant, since the system access the table entries using a hash algorithm. The key of a hashed table must be unique. When you define the table, you must specify the key as UNIQUE.
    Creating Internal Tables
    You define internal tables first as an abstract data type in the program or ABAP Dictionary, and then as a data object based on that, or they are declared directly as a fully specified data object. When you create an internal table as a data object, you should ensure that only the administration entry which belongs to an internal table is declared statically. The size of table headers for initial tables is currently 8 bytes. This should be heeded whenever internal tables occur as components of complex data objects. Also, empty tables can use up a relatively high amount of storage space as components of tables. The size of the entire storage space required for an internal table is not defined in the declaration – as is the case for data objects of the type string or xstring. Table rows are added to and deleted from the table dynamically at runtime by the various statements for adding and deleting records.
    Structure of internal tables :
    STRUCTURE OF INTERNAL TABLE
    TYPES : BEGIN OF ITAB,
                    PERNR TYPE PERSNO,
                    WERKS TYPE WERKS,
                   END OF ITAB.
    INTERNAL TABLE DECLARATION FOR THE ABOVE STRUCTURE
    DATA : INT_TAB TYPE STANDARD TABLE OF ITAB,
                WA_TAB TYPE ITAB.        "WORK AREA OF THE INTERNAL TABLE
    Thanks,
    Sakthi C
    Rewards if useful *

  • Details About Internal tables

    Hi Friends,
    Tell me diffrent type of iT with significance
    Thanks,
    Prasad

    Hi,
    I assume you are asking about the Internal Tables in ABAP.
    Types of IT:
    1.Standard Tables: Commonly used  ,here the search is made by Index.
    This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest possible access. You should fill a standard table by appending lines (APPEND statement), and read, modify and delete entries by specifying the index). The response time is proportional to the number of records.
    2.Sorted tables: search is  based on table key.
    You fill sorted tables using the INSERT statement. Entries are inserted according to the sort sequence defined through the table key.
    3.Hashed Tables:
    You cannot access a hashed table using its index. The response time for key access remains constant.
    Thanks,
    Felix

  • Solve this :about internal tables

    hi experts,
    could u pls solve this query asap.
    i have 7 internal tables,
    in  one internal table i've field
    orgunits
    1
    2
    3
    4
    in other internal tables i have fields like this
    orgunits       personalnumbers
    1                     11
    2                     12
    1                     13
    1                     14
    3                     15
    1                     16
    now i want how many personalnumbers in each orgunit.
    i want the count.
    so, how can i solve this in short coding.
    example :for orgunit 1----
    the count is 4.(11,13,14,15).
    pls explain with coding as soon as possible.
    thanks all.
    Message was edited by:
            devender reddy

    REPORT  ZTEST_00000 message-id zmsg.
    data : cnt type i.
    data : begin of itab1 occurs 0, "internal table with all org units
    org type i, "change data type
    end of itab1.
    data : begin of itab2 occurs 0, "internal table with org units and pernrs
    org type i, "change data type
    per type i, "change data type
    end of itab2.
    data : begin of itab3 occurs 0, "internal table with org units and count of pernrs
    org type i,
    count type i,
    end of itab3.
    itab1-org = 1.
    append itab1.
    clear itab1.
    itab1-org = 2.
    append itab1.
    clear itab1.
    itab1-org = 3.
    append itab1.
    clear itab1.
    itab1-org = 4.
    append itab1.
    clear itab1.
    itab2-org = 1.
    itab2-per = 10.
    append itab2.
    clear itab2.
    itab2-org = 1.
    itab2-per = 11.
    append itab2.
    clear itab2.
    itab2-org = 2.
    itab2-per = 9.
    append itab2.
    clear itab2.
    itab2-org = 2.
    itab2-per = 4.
    append itab2.
    clear itab2.
    itab2-org = 2.
    itab2-per = 7.
    append itab2.
    clear itab2.
    itab2-org = 3.
    itab2-per = 11.
    append itab2.
    clear itab2.
    itab2-org = 4.
    itab2-per = 14.
    append itab2.
    clear itab2.
    sort itab2 by org per.
    sort itab1 by org.
    loop at itab2.
    at new org.
    clear cnt.
    endat.
    cnt = cnt + 1.
    at end of org.
    itab3-org = itab2-org.
    itab3-count = cnt.
    append itab3.
    clear itab3.
    endat.
    endloop.
    loop at itab1.
    read table itab3 with key org = itab1-org.
    if sy-subrc <> 0.
    itab3-org = itab1-org.
    itab3-count = 0.
    append itab3.
    clear itab3.
    endif.
    endloop.
    sort itab3 by org count.
    loop at itab3.
    write :/ itab3-org , itab3-count.
    endloop.
    Regards
    vasu

  • About internal tables

    can anybody please tell me
    1. Please tell me How to retrieve data into INPUT/OUTPUT field.
    For example.When u display a particular row from emp table.I want to display the row number ie SY-TFILL in the INPUT/OUTPUT field.i need it very urgently.?
    2. 1. i have two internal tables. both tables which is having 5 records.
    itab1 itab2
    1 1
    3 3
    5 7
    6 9
    8 10.
    i want to develop an report which is used to print the same data (1,3) in both tables.
    in this only one time we are supposed to compare both internal tables?
    tell me logic how we will do that?
    2. in selection screen only one parameter field is there. in that i entered data and press enter?at that time what are all the events are supposed to trigger?
    3.can we delete data in one internal table with help of another internal table data?
    like let us consider this scenerio
    itab1 itab2
    material no description material no material type
    100 some 100 10
    101 thing 101 10
    103 line 103 13
    104 row type 104 15
    106 linetype 106 16
    can i delete material no (100,101)in itab1 with the help of record material type (10) of itab2

    To delete records with the help of other itab..
    have a look at following code...
    REPORT  zprax_try2.
    data:  begin of itab1 occurs 0,
            fld1(3),
           end of itab1,
           begin of itab2 occurs 0,
            fld1(3),
            fld2(2),
           end of itab2.
    initialization.
    append '100' to itab1.
    append '101' to itab1.
    append '102' to itab1.
    append '103' to itab1.
    append '104' to itab1.
    append '10010' to itab2.
    append '10110' to itab2.
    append '10011' to itab2.
    append '10111' to itab2.
    append '10210' to itab2.
    start-of-selection.
    loop at itab1.
    write:/ itab1-fld1.
    endloop.
    skip.
    loop at itab2.
    write:/ itab2-fld1, itab2-fld2.
    endloop.
    loop at itab2.
    check itab2-fld2 eq '10'.
    delete itab1 where fld1 = itab2-fld1.
    endloop.
    skip.
    loop at itab1.
    write:/ itab1-fld1.
    endloop.
    skip.
    loop at itab2.
    write:/ itab2-fld1, itab2-fld2.
    endloop.
    reward if useful
    regards
    Prax

  • Differences between Standard , sorted and hashed internal tables

    Can any body please tell me what are the main Differences between
    1) <b>Standard internal table</b>
    2) <b>Hashed internal table</b>
    3) <b>Sorted internal table</b>
    Please give me a clear idea about these Three.
    Thanks
    Prabhudutta<b></b>

    Hi,
    <b>Standard Internal Tables</b>
    Standard tables have a linear index. You can access them using either the index or the key. If you use the key, the response time is in linear relationship to the number of table entries. The key of a standard table is always non-unique, and you may not include any specification for the uniqueness in the table definition.
    This table type is particularly appropriate if you want to address individual table entries using the index. This is the quickest way to access table entries. To fill a standard table, append lines using the (APPEND) statement. You should read, modify and delete lines by referring to the index (INDEX option with the relevant ABAP command).  The response time for accessing a standard table is in linear relation to the number of table entries. If you need to use key access, standard tables are appropriate if you can fill and process the table in separate steps. For example, you can fill a standard table by appending records and then sort it. If you then use key access with the binary search option (BINARY), the response time is in logarithmic relation to
    the number of table entries.
    <b>Sorted Internal Tables</b>
    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. When you use the key, the response time is in logarithmic relationship to the number of table entries, since the system uses a binary search. The key of a sorted table can be either unique, or non-unique, and you must specify either UNIQUE or NON-UNIQUE in the table definition.  Standard tables and sorted tables both belong to the generic group index tables.
    This table type is particularly suitable if you want the table to be sorted while you are still adding entries to it. You fill the table using the (INSERT) statement, according to the sort sequence defined in the table key. Table entries that do not fit are recognised before they are inserted. The response time for access using the key is in logarithmic relation to the number of
    table entries, since the system automatically uses a binary search. Sorted tables are appropriate for partially sequential processing in a LOOP, as long as the WHERE condition contains the beginning of the table key.
    <b>Hashed Internal Tables</b>
    Hashes tables have no internal linear index. You can only access hashed tables by specifying the key. The response time is constant, regardless of the number of table entries, since the search uses a hash algorithm. The key of a hashed table must be unique, and you must specify UNIQUE in the table definition.
    This table type is particularly suitable if you want mainly to use key access for table entries. You cannot access hashed tables using the index. When you use key access, the response time remains constant, regardless of the number of table entries. As with database tables, the key of a hashed table is always unique. Hashed tables are therefore a useful way of constructing and
    using internal tables that are similar to database tables.
    Regards
    Sudheer

  • About Fact Tables and Image Tables

    Not sure, if this is correct forum for Oracle BI 10.x EE, but still
    I couldn't find another forum, quickly, hence posting here.
    Pardon me.
    Here is the main Q's
    I need little help.
    Our company is implementing Oracle BI 10.x. We don't have much experience in Siebel Analytics/OBI.
    We have few fact tables e.g. W_XXXX_F, which we need/wish to extend. We are not sure about which methodology we should implement. When we talked with few SA experts they mentioned we need to extend based on ROW_WID. Well, this column doesn't exists anymore in many fact tables, so currently we are thinking of creating ROW_WID on this F table manually and then create WC_XXXX_FX and take these two tables in physical layer of RPD.
    Additially, we need to create few Informatica mappings, again SA experts pointed out to use Image tables. Our data source is Oracle Applications, I don't have much idea about Image tables, but clearly there is not S_ETL_I_IMGAGe or so tables in Oracle Apps
    Please guide us as how to proceed on these two issues.
    Rajat

    Not sure, if this is correct forum for Oracle BI 10.x EE, but still
    I couldn't find another forum, quickly, hence posting here.
    Pardon me.
    Here is the main Q's
    I need little help.
    Our company is implementing Oracle BI 10.x. We don't have much experience in Siebel Analytics/OBI.
    We have few fact tables e.g. W_XXXX_F, which we need/wish to extend. We are not sure about which methodology we should implement. When we talked with few SA experts they mentioned we need to extend based on ROW_WID. Well, this column doesn't exists anymore in many fact tables, so currently we are thinking of creating ROW_WID on this F table manually and then create WC_XXXX_FX and take these two tables in physical layer of RPD.
    Additially, we need to create few Informatica mappings, again SA experts pointed out to use Image tables. Our data source is Oracle Applications, I don't have much idea about Image tables, but clearly there is not S_ETL_I_IMGAGe or so tables in Oracle Apps
    Please guide us as how to proceed on these two issues.
    Rajat

  • How internal tables are physicaly located in memory?

    Array, chained list, or else? Plese provide any opinion or documentation.
    Sincerely yours, Long Nguyen.

    A data model is an abstraction of a part of the real world which is represented using formal structures. A relational database basically uses one formal structure known as a table.
    A table can be defined as a two-dimensional matrix made of rows and columns. It can also be described as a group of records of the same type.Records are groups of fields based on existing data types. These data types are previously defined in the datadictionary. A table is a similar concept to a conventional indexed file; the difference is that in the relational model the main index is known as the primary key, which is made of one or more fields of the record. A record is also known as tuple or simply a row. The most significant feature of the primary key is that it identifies univocally one and only one record of the table: a table does not permit records with duplicated primary keys.
    Structures. The object structure refers to the definition of a compound object that does not have any content. It's like a table or a view, but it never has entries: it's only a structure. These types of objects are used in programs for defining data structures or for defining data in the interfaces from the module pools and the screens. The basic difference between structures and tables (or views) is that the
    structure does not exist at the underlying database system level; however, both tables and views do exist in the database. Structures only exist as definitions in the dictionary. As a result, structures do not need to be activated.
    Table. As previously explained, a table is a two-dimensional data matrix. A table can contain zero or many rows, corresponding to the predefined table structure (entity type). This is, at the same time, a complex structure, which can be made up of one or several fields (attributes). Every row that makes up the database table has the same structure and properties. The fields that make up the structure of the table records, as well as its attributes, permitted value range, and so on, are set when defining the table.
    Some general recommendations for internal tables:
    •     As long as all that you need from an internal table is to append lines to it and perhaps to sort it after filling it, standard tables are still the best choice. The other table kinds are too expen-sive for these simple tasks. Keep in mind that when inserting or deleting lines in index tables containing many lines, the administration of the logical index that manages the lines of the ta-ble internally can become expensive, with regard to performance and additional memory space. Only for standard tables that are filled with APPEND only, and where no lines are de-leted except for the last line, is there no need for a logical index, and hence
    no additional costs are incurred.
    •If memory space is an issue, for very large internal tables (> 500000 lines) with a
    small line size, sorted tables might be preferable to hashed tables, since for internal administration, they need only 6 bytes per line compared to 18 bytes for hashed tables.
    •When declaring internal tables, use the addition INITIAL SIZE only for inner tables in nested tables. For outer tables, the automatic allocation of initial memory size is appropriate. For inner tables, though, it may result in saving a large amount of memory.
    •When reading internal tables with READ TABLE or LOOP AT, choose the appropriate output behavior. Writing into a work area wa with the addition INTO wa is only necessary if you want to change the work area without influencing the internal table. For pure reading purposes or for modifying the contents of the internal table, the additions ASSIGNING <fs> for assigning internal table lines to a field symbol <fs> and REFERENCE INTO dref for setting a refer-ence in a data reference variable dref to internal table lines are the better choices by far.
    •Use CLEAR instead of REFRESH for internal tables. The reason is that for internal tables with-out header lines, the general statement CLEAR does exactly the same as the special state-ment REFRESH. Since internal tables with header lines should no longer be used, the state-ment REFRESH is effectively obsolete. In order to free more memory, you can consider the use of FREE.
    •The statement COLLECT should no longer be used for standard tables — use COLLECT mainly for hashed tables. The reason is that COLLECT is based on a hash algorithm. While the hash administration of a hashed table is always available and robust, for standard tables a temporary hash administration must be created when the COLLECT statement is used. This temporary hash administration is invalidated when the table is accessed for changing. If fur-ther COLLECT statements are entered after an invalidation, a linear search of all table rows must be performed. Furthermore, COLLECT only works properly on internal tables with unique lines, while a unique table key is guaranteed for hashed tables only. Therefore, for standard tables it cannot be guaranteed that the contents will always be suitable for editing using COLLECT.
    •Don’t use APPEND SORTED BY — use SORT instead. The reason is that creating a ranked list with APPEND SORTED BY is based on several assumptions about the internal table and how it is filled. Using SORT is the general method that can be applied to all kinds of table and inde-pendent from the mode of filling.
    Chk these links for more information about internal tables
    internal tables
    Regards,
    Balaji Reddy G
    **Rewards for helpful answers

  • How to clear entries from a table view

    Hi All,
      I am using a tableview in a BSP page. I am setting the attribute allrowseditable = 'TRUE'. The internal table I am using for the tableview contains only initial lines. Once the tableview is displayed i am entering some values on the cells. But even after triggering the DO_REQUEST the values i entered in the tableview remains, its not getting cleared eventhough my internal table contains only initial lines. I am not getting back the values from tableview in HANDLE_DATA or EVENT. Can anyone tell me why the cells in tableview is retaining the values. How can i overcome this.
    Thanks,
    regards
    Vishnu Aravind

    Hi Sebastian,
      The following is the code of my view
    <%@page language="abap"%>
    <%@ extension name="bsp" prefix="bsp" %>
    <%@ extension name="htmlb" prefix="htmlb" %>
    <%@ extension name="xhtmlb" prefix="xhtmlb" %>
    <%@ extension name="PlmHelp" prefix="plmhelp" %>
    <htmlb:gridLayout columnSize="1"
                      rowSize="2"
                      cellSpacing="10">
    <htmlb:gridLayoutCell rowIndex="1"
                          columnIndex="1">
    <htmlb:tableView
                        id                     = "attribute1"
                        allRowsEditable        = "X"
                        table                  = "<%= controller->tbl_attributes %>"/>
    </htmlb:gridLayoutCell>
    </htmlb:gridLayout>

  • Internal table and work area

    Hi,
           can anybody explain the concepts of Internal table and work area.Thanks in advance.

    hai,
    This may help u.
    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.
    Each row in a table is a record and each column is a field.
    While adding or retrieving records to / from internal table we have to keep the record temporarily.
    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.
    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.
    e.g.
    data: begin of itab occurs 10,
    ab type c,
    cd type i,
    end of itab. " this table will have the header line.
    data: wa_itab like itab. " explicit work area for itab
    data: itab1 like itab occurs 10. " table is without header line.
    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.
    internal tables are of types.
    1. internal tables with header line. [header and body]
    2. internal tables with out header line. [only body]
    Workarea is the concept which is mainly useful when working with internal tables with out header line.
    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.
    ex: data: itab like standard table of mara with header line.
    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.
    ex: data: itab like mara,
    wa like mara.
    more about internal table types:
    Standard table:
    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.
    You should usually access a standard table with index operations.
    Sorted table:
    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.
    Index accesses to sorted tables are also allowed. You should usually access a sorted table using its key.
    Hash table:
    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.
    You cannot access a hash table with an index. Accesses must use generic key operations (SORT, LOOP, etc.).
    Hashed tables
    This is the most appropriate type for any table where the main operation is key access. You cannot access a hashed table using its index.
    The response time for key access remains constant, regardless of the number of table entries. Like database tables, hashed tables always
    have a unique key. Hashed tables are useful if you want to construct and use an internal table which resembles a database table or for
    processing large amounts of data.
    TYPES VECTOR TYPE HASHED TABLE OF I WITH UNIQUE KEY TABLE LINE.
    TYPES: BEGIN OF LINE,
    COLUMN1 TYPE I,
    COLUMN2 TYPE I,
    COLUMN3 TYPE I,
    END OF LINE.
    DATA ITAB TYPE HASHED TABLE OF SPFLI
    WITH UNIQUE KEY CARRID CONNID.
    with regards,
    B.Sowjanya,
    reward points if helpful.

  • Memory released after delete in internal tables ?

    hi friends,
    i have one quick question about internal tables and memory consumption.
    if i have an internal table of say 100 entries and that does occupy memory for 100 entries. now if i delete 20 lines of this table...is the memory occupied by those 20 also released/freed or will the table size be 100 also and just the 20 deleted lines empty ?

    Hi!
    If you defined you table with the OCCURS 100 statement, then it will allocate always at least 100 records.
    The other tables will occupy only the memory size of their actual record length * record number bytes (plus some header information).
    Use REFRESH / FREE statement to delete the contents of unneccessary internal tables.
    Regards
    Tamá

  • Issue with clearing internal table

    Hi Gurus,
    I am working on an issue, where when we run a std. report we see social number of the employee on the output screen, when I debugged the program I found that there are 2 internal tables where we are putting this SSN. I tried to clear the SSN at the both the places like:
    loop at it_table.
    clear it_table-SSN.
    Endloop.
    but still when I ran the report I am seeing social there. so can you please give me any idea of what I am doing wrong?
    Thanks,
    Rajeev Gupta

    Hi rajeev,
    even after ur clearing if the field is still populating it means again its filling the particular field in the later place.
    1) keep ur code and while debuging just click on watchpoint and give ur field name go with f8 it will take u to the place the field is filling..
    2) below that place clear that field and modify the table..

  • One field gets cleared from ALV to internal table

    I have an ALV grid in a view in which i append a row and add some data. This is giving me a very strange problem.
    I appended a row in the ALV and then filled up the data in the row. I filled three fields, two of them dates and one a decimal field. Then i saved this data. No problems here.
    Now the next time i come on this ALV grid view, i see the previously saved row. I now append another row and fill in some data again. This is where the surprise comes. Out of the two date fields, the first date field is losing its value and is getting cleared when i get the ALV data in an internal table...(using the following code)
      node_et_indices_1->get_static_attributes_table( IMPORTING table = lt_indice ).
    the lt_indice has the following structure...
    field           type
    MANDT     MANDT
    BUKRS     BUKRS
    ZZINDICE     ZEAGR_INDICE
    ZZITEM     CHAR3
    ZZDESC    CHAR40
    ZZINVAL    DATS 8
    ZZFIMVAL  DATS 8
    ZZVATR     DEC
    ZZUATR     DEC
    ERNAM     ERNAM
    AEDAT     AEDAT
    ZCORRIG  CHAR1
    WAERS     WAERS
    out of these, the fields zzinval, zzfimval and zzvatr are being populated from webdynpro and the rest of the fields (including the key fields) are populated in the internal table later and then saved to the database.
    After executing the above statement, the value in ZZINVAL is 00000000, while on the screen i have entered 01.02.2007. The same does not apply to ZZFIMVAL which holds the value 28.02.2007 as entered on the screen. ZZVATR also holds the correct value entered.
    Any ideas why only one of the fields might be getting cleared like this?
    The problem does not occur when i am saving only a single row from the ALV.
    Please help!!
    regards,
    Priyank

    I have checked that the node itself is not containing the value.
    How and what can i check for this. I have mapped the ALV in different views similarly and they are working?
    Any ideas on where can i check ??
    regards,
    Priyank

  • Read info about files in specific folder into internal table

    Hi Experts
    I need to have last modified date and filename information read into an internal table. I need to read in the information of all files in a specific (UNIX) folder (I do not know the name of the single files).
    I really hope someone can help.
    Thanks a lot
    Kind regards,
    Torben

    Hi Guys
    Thanks a lot for you input.
    I managed to get my program to works as follows:
    REPORT  ZDELETE_ARCHIVING_FILES.
    *Step 1: Get the list of files in the directory into internal table :
    DATA: DLIST    LIKE EPSFILI OCCURS 0 WITH HEADER LINE,
          DPATH    LIKE EPSF-EPSDIRNAM,
          MDATE    LIKE SY-DATUM,
          MTIME    LIKE SY-UZEIT.
    DATA: BEGIN OF FATTR OCCURS 0,
              FILE_NAME  LIKE EPSF-EPSFILNAM,
              FILE_SIZE  LIKE EPSF-EPSFILSIZ,
              FILE_OWNER LIKE EPSF-EPSFILOWN,
              FILE_MODE  LIKE EPSF-EPSFILMOD,
              FILE_TYPE  LIKE EPSF-EPSFILTYP,
              FILE_MTIME(12),
          END OF FATTR.
    DATA: P_PATH(50) TYPE C.
    CONCATENATE '/ARCHIVE/' sy-sysid '/archive' INTO P_PATH.
    *        WRITE: / P_PATH.
    DPATH = P_PATH.
    *Get files in folder - read into internal table DLIST
    *if filenames are longer than 40 characters
    *then use FM SUBST_GET_FILE_LIST.
    CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
         EXPORTING
              DIR_NAME               = DPATH
         TABLES
              DIR_LIST               = DLIST
         EXCEPTIONS
              INVALID_EPS_SUBDIR     = 1
              SAPGPARAM_FAILED       = 2
              BUILD_DIRECTORY_FAILED = 3
              NO_AUTHORIZATION       = 4
              READ_DIRECTORY_FAILED  = 5
              TOO_MANY_READ_ERRORS   = 6
              EMPTY_DIRECTORY_LIST   = 7
              OTHERS                 = 8.
    IF SY-SUBRC EQ 0.
    *Step 2: Read the file attributes into an internal table
    *Read info about the files (attributes) into the internal table FATTR
    *as we need info about the last time it was changed (MTIME)
      LOOP AT DLIST.
        CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
             EXPORTING
                  FILE_NAME              = DLIST-NAME
                  DIR_NAME               = DPATH
             IMPORTING
                  FILE_SIZE              = FATTR-FILE_SIZE
                  FILE_OWNER             = FATTR-FILE_OWNER
                  FILE_MODE              = FATTR-FILE_MODE
                  FILE_TYPE              = FATTR-FILE_TYPE
                  FILE_MTIME             = FATTR-FILE_MTIME
             EXCEPTIONS
                  READ_DIRECTORY_FAILED  = 1
                  READ_ATTRIBUTES_FAILED = 2
                  OTHERS                 = 3.
        IF SY-SUBRC EQ 0.
          FATTR-FILE_NAME = DLIST-NAME.
          APPEND FATTR.
        ENDIF.
      ENDLOOP.
      SORT FATTR BY FILE_NAME.
      DATA: time(10), date LIKE sy-datum.
      DATA: months TYPE i.
      DATA: e_file TYPE string.
      LOOP AT FATTR.
      CLEAR: time, months, e_file.
        IF FATTR-FILE_NAME(10) = 'archive_BW'.
    *Convert the unix time into readable time
          PERFORM p6_to_date_time_tz(rstr0400) USING FATTR-FILE_MTIME
                                                     time
                                                     date.
    *Calculate the number of months between date (MTIME) and current day
    *ex 31.03.2009 - 01.04.2009 = 1 month
    *ex 01.02.2009 - 01.04.2009 = 2 month
        CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
          EXPORTING
            i_datum_von = date
            i_datum_bis = sy-datum
          IMPORTING
            e_monate = months.
            CONCATENATE DPATH '/' FATTR-FILE_NAME INTO e_file.
    *        WRITE: / FATTR-FILE_NAME,
    *                 FATTR-FILE_SIZE,
    *                 date,
    *                 time,
    *                 sy-datum,
    *                 months,
    *                 e_file.
    *Step 3: Delete files where months > 1
          IF months > 1.
            OPEN dataset e_file for output in text mode encoding default.
            DELETE dataset e_file.
            CLOSE dataset e_file.
          ENDIF. "months > 1
        ENDIF.
      ENDLOOP.
    ENDIF.

Maybe you are looking for

  • New mac mini slow?

    Hi, is it normal that the new mac mini (i5 gheepst model, uphradet to 8 gb ram) is slower than my macbook pro 13, 2010 modell (2.4ghz core 2 duo)? When i try to open programs from dock it is very slow on the mini.. My mbp runs snow leopard, and the m

  • Auto batch detmn for components in Process Order selects batch in Q status.

    Hi Gurus, We have the following issue with automatic batch determination for component batches for a Process Order: Say for a Process Order it requires components A,B, and C. The issue is with component C. if the PO requires 100 Qty of C. the system

  • No SQL*Loader in Instant Client;  any alternatives?

    My Windows application uses SQL*Loader to bulk-load very large data files. Instant Client appears not to include SQL*Loader. Is there an alternative to SQL*Loader that my application should be using instead? And (getting greedy here) does the same al

  • Currency traslation with rule type "routine with unit" in trasformations

    hi all, i am loading a flat file.in that file i am getting just amount.in target i have to load amount and currency as USD.i have to use the option " routine with unit" in trasformations. can any one please through some light.can any one provide samp

  • Multi-step content approval process

    Dear All, We have a requirement like this: A content (after it has been authored) has to go through an n-step approval process. In our requirement, suppose if the 3rd approver rejects the content, then it should go back to the 2nd approver. But if we