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

structure

hai SAP Guru's,

can any one give the difference between structure and internal table

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 10:55 AM

    Hi,

    May be this ll help u.

    <u><b>Structures</b></u>

    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.

    The following terms are important when we talk about structures:

    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.

    <u><b>Internal Tables</b></u>

    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.

    And also go through this link:

    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fcc358411d1829f0000e829fbfe/content.htm

    Regards,

    Deepika

    Message was edited by:

    Deepika Nayak

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 10:56 AM

    hi,

    Structure is the single line that consists of certain fields of certain types. Can hold only 1 line.

    While internal table can be of type any structure. Can hold many lines.

    Regards,

    Kunjal

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2007 at 11:04 AM

    Hi Pramodh,

    Struture is a just template containg all your fields.

    internal table is also a template of fields but can hold data in it.

    structure do not contain any data..

    regards,

    vikas

    plz reward if useful..

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 11:13 AM

    Hi Pramodh,

    Strusture is one line is is able to store on record only,

    Internal table can store multiple line ( Like Arrays in C Language).

    Reward if useful,

    Mahi.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 11:17 AM

    hi,

    In structure u can declare fields but it cant hold data.

    In internal table u can hold data.

    U can declare fields in one structure and that structure u can assign to internal table.....

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 11:19 AM

    What is the difference between internal table and structure?

    There are there types of structure:-

    1. Flat structure( elementary fields)

    2. Nested structure ( type reference to other structure)

    3. deep structure ( type reference to database tables)

    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fcc358411d1829f0000e829fbfe/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fcc358411d1829f0000e829fbfe/content.htm">http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2fcc358411d1829f0000e829fbfe/content.htm>

    if it is useful plz reward me.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 05, 2007 at 11:19 AM

    internal tables are local to a particular program.

    structures are global.

    internal tables can hold data.

    structures cannot hold data.

    any prg can use structure,but as told earlier internal tables are specific to a program.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 05, 2007 at 11:36 AM

    1.Structure is a group of fields that can store only one line at a time

    2.Internal table can store multiple values

    3.Internal table of one program can not be used in another program.

    4.But once u create a structure it can be used in any program again and again.

    Structure has three types..

    a.Elementary Structure

    b.Nested Structure and

    c.Deep structure

    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.