Skip to Content
author's profile photo Former Member
Former Member

internal table

why do we have structure and internal table at the same time

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on Oct 26, 2006 at 11:36 AM

    In an internal table, we have multiple records.

    But to do some processing , we need record by record.

    So we need some work area to hold one record at a time. hence we have a structure and an internal table.

    Regards,

    ravi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 26, 2006 at 11:38 AM

    hi,

    Structure is we can call that directly in program as a set of datatypes

    we can include the 1 or more structure in one internal table.

    Structure is available anywhere not only in run time

    but internal table available only when you execute the program

    Regards,

    nandha

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 26, 2006 at 11:48 AM

    <b>Structures</b>

    A structure is a logically-connected set of fields. It is a sequence of any other data types from the ABAP Dictionary, that is, data elements, structures, table types, or database tables. When you create a structure in the ABAP Dictionary, each component must have a name and a data type.

    A structure is a sequence of any elementary types, reference types, or complex data types.

    You use structures in ABAP programs to group work areas that logically belong together. Since the elements of a structure can have any data type, structures can have a large range of uses. For example, you can use a structure with elementary data types to display lines from a database table within a program. You can also use structures containing aggregated elements to include all of the attributes of a screen or control in a single data object.

    Nested and non-nested structures

    Flat and deep structures

    A nested structure is a structure that contains one or more other structures as components. Flat structures contain only elementary data types with a fixed length (no internal tables, reference types, or strings). The term deep structure can apply regardless of whether the structure is nested or not. Nested structures are flat so long as none of the above types is contained in any nesting level.

    Any structure that contains at least one internal table, reference type, or string as a component (regardless of nesting) is a deep structure. Accordingly, internal tables, references, and strings are also known as deep data types. The technical difference between deep structures and all others is as follows. When you create a deep structure, the system creates a pointer in memory that points to the real field contents or other administrative information. When you create a flat data type, the actual field contents are stored with the type in memory. Since the field contents are not stored with the field descriptions in the case of deep structures, assignments, offset and length specifications and other operations are handled differently from flat structures.

    <b>Internal Tables</b>

    Internal tables consists of a series of lines that all have the same data type. Internal tables are characterized by:

    The line type, which can be any elementary type, reference type, or complex data type.

    The key identifies table rows. It is made up of the elementary fields in the line. The key can be unique or non-unique.

    The access method determines how ABAP will access individual table entries. There are three access types, namely unsorted tables, sorted index tables and hash tables. For index tables, the system maintains a linear index, so you can access the table either by specifying the index or the key.

    Hashed tables have no linear index. You can only access hashed tables by specifying the key. The system has its own hash algorithm for managing the table.

    You should use internal tables whenever you need to use structured data within a program. One imprint use is to store data from the database within a program.

    I hope it gives you clear idea abt them.

    Best Regards,

    Vibha

    *Please mark all the helpful answers

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 26, 2006 at 11:49 AM

    hi ,

    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.

    So 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.

    cheers,

    shan

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.