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

How we will decide which INTERNAL TABLE should be used What is the criteri

How we will decide which INTERNAL TABLE should be used What is the criteria to decide such?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2007 at 06:18 AM

    based on table type.

    select db table.

    TYPES - TABLE OF

    Syntax

    TYPES dtype { {TYPE tabkind OF [REF TO] type}

    | {LIKE tabkind OF dobj} }

    [WITH key] [INITIAL SIZE n].

    Addition:

    ... INITIAL SIZE n

    Effect

    This statement defines a table type dtype with a specific row type, a table type tabkind, and a table key key.

    The row type is determined by entering the data type type after TYPE and data type dobj after LIKE:

    type can be a non-generic data type from the ABAP Dictionary, a non-generic public data type of a global class, a non-generic program-local data type, or any ABAP type from the table of predefined ABAP types. The generic ABAP types c, n, p, and x are implicitly extended to the standard length without decimal places from the table of predefined ABAP types.

    If the addition REF TO is specified before type or dobj, then the row type is a reference type. The information specified in section reference types can then be entered for type and dobj.

    dobj can be a data object visible at this point, whose type is adopted as the row type. Within a procedure, you cannot specify a generic typed formal parameter for dobj.

    Addition

    ... INITIAL SIZE n

    Effect

    After the optional addition INITIAL SIZE, you can specify a number of rows n as a numeric literal or numeric constant to adjust the size of the first block in the memory that is reserved by the system for an internal table of the table type. Without this addition, if the number 0 is entered, or the value of n exceeds a maximum value, the system automatically allocates an appropriate memory area. If this is no longer sufficient, the system creates an additional block twice the size of the first block as long as this size does not exceed 8 KB. Additional areas are created where necessary with a size of 12 KB. The maximum value is calculated as 8 KB divided by the memory required for a row. In the case of larger values, a block size of 12 KB is automatically selected.

    Note

    You are advised to specify the initial memory requirements only when the number of entries in the table has already been specified and the initial main memory requirement has an adequate value. This can be especially important for internal tables that are components of table types and only contain a few rows.

    Example

    Definition of a non-generic sorted table type. The row type corresponds the structure of the database table SPFLI. Two key fields are defined for the table key.

    TYPES spfli_sort TYPE SORTED TABLE OF spfli

    WITH UNIQUE KEY carrid connid.

    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.