<?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 Tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190639#M760030</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.Internal table events are,&lt;/P&gt;&lt;P&gt;AT first,AT END OF ,AT LAST,ON CHANGE, AT NEW.&lt;/P&gt;&lt;P&gt;2.SCREEN IS AN TABLE &lt;/P&gt;&lt;P&gt;it contains group and invisible,active options.&lt;/P&gt;&lt;P&gt;it is used in reporting for change selection screen properties dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION SCREE OUTPUT EVENT USES SCREEN TABLE .&lt;/P&gt;&lt;P&gt;5.on change event only triggers when ever field changes in control field,and also it won't change change values to right of tha control field.&lt;/P&gt;&lt;P&gt;at new field trigers changes in control field and to left of that field changes .but to right of this fields marks 0 if numeric&lt;/P&gt;&lt;P&gt;otherwise *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A  B     &lt;/P&gt;&lt;P&gt;1   X&lt;/P&gt;&lt;P&gt;2   X&lt;/P&gt;&lt;P&gt;3   Y&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT NEW ON B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st record triggers at new &lt;/P&gt;&lt;P&gt;2nd record triggers at new&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ON CHANGE OF B.&lt;/P&gt;&lt;P&gt;1st trigers but second record won't trigger y means value of b doesn't change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is main difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;database objects means it allocates memory when it is created.&lt;/P&gt;&lt;P&gt;runtime object means it allocates memory at run time and generate at run time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 29 Dec 2007 06:01:26 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-29T06:01:26Z</dc:date>
    <item>
      <title>Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190635#M760026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let me know the answers for these questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.	What are events of Internal Table?&lt;/P&gt;&lt;P&gt;2.	What is screen internal table?&lt;/P&gt;&lt;P&gt;3.	How field properties are set with * for password?&lt;/P&gt;&lt;P&gt;4.	How the dialog programming for screen displays?&lt;/P&gt;&lt;P&gt;5. What is the difference between on change of field and at new field events?&lt;/P&gt;&lt;P&gt;6. What is the difference between data base objects and runtime objects?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanking u in advance.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2007 09:42:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190635#M760026</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-28T09:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190636#M760027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just Use the "search" option before posting any question in the forums.&lt;/P&gt;&lt;P&gt;Almost for every question you will find the answer.&lt;/P&gt;&lt;P&gt;Even then u didn't find any solution, better u post the question in the forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try searching the forum first..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;SImha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2007 09:51:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190636#M760027</guid>
      <dc:creator>Simha_</dc:creator>
      <dc:date>2007-12-28T09:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190637#M760028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi this will help u get answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables are the core of ABAP. They are like soul of a body. For any program we use &lt;/P&gt;&lt;P&gt;internal tables extensively. We can use Internal tables like normal data base tables only, but the &lt;/P&gt;&lt;P&gt;basic difference is the memory allocated for internal tables is temporary. Once the program is &lt;/P&gt;&lt;P&gt;closed the memory allocated for internal tables will also be out of memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But while using the internal tables, there are many performance issues to be considered. i.e which &lt;/P&gt;&lt;P&gt;type of internal table to be used for the program..like standard internal table, hashed internal &lt;/P&gt;&lt;P&gt;table or sorted internal table etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;line in memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays. Since they are dynamic data &lt;/P&gt;&lt;P&gt;objects, they save the programmer the task of dynamic memory management in his or her programs. You should use internal tables &lt;/P&gt;&lt;P&gt;whenever you want to process a dataset with a fixed structure within a program. A particularly important use for internal tables is for &lt;/P&gt;&lt;P&gt;storing and formatting data from a database table within a program. They are also a good way of including very complicated data &lt;/P&gt;&lt;P&gt;structures in an ABAP program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;data type is also an attribute of an existing data object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal Tables as Data Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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, &lt;/P&gt;&lt;P&gt;key, and table type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;structure is a column in the internal table. However, the line type may also be elementary or another internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;whether the key should be UNIQUE or NON-UNIQUE. Internal tables with a unique key cannot contain duplicate entries. The uniqueness &lt;/P&gt;&lt;P&gt;depends on the table access method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;is an internal table, the default key is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user-defined key can contain any columns of the internal table that are not references or themselves internal tables. Internal tables &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;this, for example, if you intend to sort the table according to the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard tables have an internal linear index. From a particular size upwards, the indexes of internal tables are administered as trees. In &lt;/P&gt;&lt;P&gt;this case, the index administration overhead increases in logarithmic and not linear relation to the number of lines. The system can access &lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;very quickly, since the system does not have to check whether there are already existing entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted tables are always saved sorted by the key. They also have an internal index. The system can access records either by using the &lt;/P&gt;&lt;P&gt;table index or the key. The response time for key access is logarithmically proportional to the number of table entries, since the system &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;the key is to be unique or not. Standard tables and sorted tables are known generically as index tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;When you define the table, you must specify the key as UNIQUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generic Internal Tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;generic construction, that is, the key or key and line type of an internal table data type may remain unspecified. You can use generic &lt;/P&gt;&lt;P&gt;internal tables to specify the types of field symbols and the interface parameters of procedures . You cannot use them to declare data &lt;/P&gt;&lt;P&gt;objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal Tables as Dynamic Data Objects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;respect of their line type, key and access method. However, the number of lines is not fixed. Thus internal tables are dynamic data objects, &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;the limits of your system installation. The maximum memory that can be occupied by an internal table (including its internal administration) &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;than 2 million entries. The line types of internal tables can be any ABAP data types - elementary, structured, or internal tables. The &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Choosing a Table Type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table type (and particularly the access method) that you will use depends on how the typical internal table operations will be most &lt;/P&gt;&lt;P&gt;frequently executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the most appropriate type if you are going to address the individual table entries using the index. Index access is the quickest &lt;/P&gt;&lt;P&gt;possible access. You should fill a standard table by appending lines (ABAP APPEND statement), and read, modify and delete entries by &lt;/P&gt;&lt;P&gt;specifying the index (INDEX option with the relevant ABAP command). The access time for a standard table increases in a linear relationship &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;access, the response time is logarithmically proportional to the number of table entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;are inserted according to the sort sequence defined through the table key. Any illegal entries are recognized as soon as you try to add &lt;/P&gt;&lt;P&gt;them to the table. The response time for key access is logarithmically proportional to the number of table entries, since the system always &lt;/P&gt;&lt;P&gt;uses a binary search. Sorted tables are particularly useful for partially sequential processing in a LOOP if you specify the beginning of the &lt;/P&gt;&lt;P&gt;table key in the WHERE condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed tables&lt;/P&gt;&lt;P&gt;&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;Creating Internal Tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like other elements in the ABAP type concept, you can declare internal tables as abstract data &lt;/P&gt;&lt;P&gt;types in programs or in the ABAP Dictionary, and then use them to define data objects. &lt;/P&gt;&lt;P&gt;Alternatively, you can define them directly as data objects. When you create an internal table as a &lt;/P&gt;&lt;P&gt;data object, you should ensure that only the administration entry which belongs to an internal &lt;/P&gt;&lt;P&gt;table is declared statically. The minimum size of an internal table is 256 bytes. This is important if an &lt;/P&gt;&lt;P&gt;internal table occurs as a component of an aggregated data object, since even empty internal &lt;/P&gt;&lt;P&gt;tables within tables can lead to high memory usage. (In the next functional release, the size of the &lt;/P&gt;&lt;P&gt;table header for an initial table will be reduced to 8 bytes). Unlike all other ABAP data objects, you &lt;/P&gt;&lt;P&gt;do not have to specify the memory required for an internal table. Table rows are added to and &lt;/P&gt;&lt;P&gt;deleted from the table dynamically at runtime by the various statements for adding and deleting &lt;/P&gt;&lt;P&gt;records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can create internal tables in different types.&lt;/P&gt;&lt;P&gt;You can create standard internal table and then make it sort in side the program.&lt;/P&gt;&lt;P&gt;The same way you can change to hashed internal tables also.&lt;/P&gt;&lt;P&gt;There will be some performance issues with regard to standard internal tables/ hashed internal &lt;/P&gt;&lt;P&gt;tables/ sorted internal tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal table types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This section describes how to define internal tables locally in a program. You can also define internal tables globally as data types in the &lt;/P&gt;&lt;P&gt;ABAP Dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like all local data types in programs , you define internal tables using the TYPES statement. If you do not refer to an existing table type &lt;/P&gt;&lt;P&gt;using the TYPE or LIKE addition, you can use the TYPES statement to construct a new local internal table in your program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES &amp;lt;t&amp;gt; TYPE|LIKE &amp;lt;tabkind&amp;gt; OF &amp;lt;linetype&amp;gt; WITH &amp;lt;key&amp;gt;&lt;/P&gt;&lt;P&gt;INITIAL SIZE &amp;lt;n&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After TYPE or LIKE, there is no reference to an existing data type. Instead, the type constructor occurs:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;tabkind&amp;gt; OF &amp;lt;linetype&amp;gt; WITH &amp;lt;key&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The type constructor defines the table type &amp;lt;tabkind&amp;gt;, the line type &amp;lt;linetype&amp;gt;, and the key &amp;lt;key&amp;gt; of the internal table &amp;lt;t&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can, if you wish, allocate an initial amount of memory to the internal table using the INITIAL SIZE addition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can specify the table type &amp;lt;tabkind&amp;gt; as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generic table types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INDEX TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating a generic table type with index access.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ANY TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating a fully-generic table type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data types defined using generic types can currently only be used for field symbols and for interface parameters in procedures . The generic &lt;/P&gt;&lt;P&gt;type INDEX TABLE includes standard tables and sorted tables. These are the two table types for which index access is allowed. You cannot &lt;/P&gt;&lt;P&gt;pass hashed tables to field symbols or interface parameters defined in this way. The generic type ANY TABLE can represent any table. You &lt;/P&gt;&lt;P&gt;can pass tables of all three types to field symbols and interface parameters defined in this way. However, these field symbols and &lt;/P&gt;&lt;P&gt;parameters will then only allow operations that are possible for all tables, that is, index operations are not allowed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fully-Specified Table Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;STANDARD TABLE or TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating standard tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORTED TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating sorted tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HASHED TABLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For creating hashed tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fully-specified table types determine how the system will access the entries in the table in key operations. It uses a linear search for &lt;/P&gt;&lt;P&gt;standard tables, a binary search for sorted tables, and a search using a hash algorithm for hashed tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the line type &amp;lt;linetype&amp;gt;, you can specify:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any data type if you are using the TYPE addition. This can be a predefined ABAP type, a local type in the program, or a data type from the &lt;/P&gt;&lt;P&gt;ABAP Dictionary. If you specify any of the generic elementary types C, N, P, or X, any attributes that you fail to specify (field length, number &lt;/P&gt;&lt;P&gt;of decimal places) are automatically filled with the default values. You cannot specify any other generic types.&lt;/P&gt;&lt;P&gt;Any data object recognized within the program at that point if you are using the LIKE addition. The line type adopts the fully-specified data &lt;/P&gt;&lt;P&gt;type of the data object to which you refer. Except for within classes, you can still use the LIKE addition to refer to database tables and &lt;/P&gt;&lt;P&gt;structures in the ABAP Dictionary (for compatibility reasons).&lt;/P&gt;&lt;P&gt;All of the lines in the internal table have the fully-specified technical attributes of the specified data type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can specify the key &amp;lt;key&amp;gt; of an internal table as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NON-UNIQUE KEY &amp;lt;col1&amp;gt; ... &amp;lt;col n&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In tables with a structured line type, all of the components &amp;lt;coli&amp;gt; belong to the key as long as they are not internal tables or references, &lt;/P&gt;&lt;P&gt;and do not contain internal tables or references. Key fields can be nested structures. The substructures are expanded component by &lt;/P&gt;&lt;P&gt;component when you access the table using the key. The system follows the sequence of the key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NON-UNIQUE KEY TABLE LINE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a table has an elementary line type (C, D, F, I, N, P, T, X), you can define the entire line as the key. If you try this for a table whose line &lt;/P&gt;&lt;P&gt;type is itself a table, a syntax error occurs. If a table has a structured line type, it is possible to specify the entire line as the key. However, &lt;/P&gt;&lt;P&gt;you should remember that this is often not suitable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NON-UNIQUE DEFAULT KEY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This declares the fields of the default key as the key fields. If the table has a structured line type, the default key contains all non-numeric &lt;/P&gt;&lt;P&gt;columns of the internal table that are not and do not contain references or internal tables. If the table has an elementary line type, the &lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifying a key is optional. If you do not specify a key, the system defines a table type with an arbitrary key. You can only use this to &lt;/P&gt;&lt;P&gt;define the types of field symbols and the interface parameters of procedures . For exceptions, refer to Special Features of Standard Tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The optional additions UNIQUE or NON-UNIQUE determine whether the key is to be unique or non-unique, that is, whether the table can &lt;/P&gt;&lt;P&gt;accept duplicate entries. If you do not specify UNIQUE or NON-UNIQUE for the key, the table type is generic in this respect. As such, it can &lt;/P&gt;&lt;P&gt;only be used for specifying types. When you specify the table type simultaneously, you must note the following restrictions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You cannot use the UNIQUE addition for standard tables. The system always generates the NON-UNIQUE addition automatically.&lt;/P&gt;&lt;P&gt;You must always specify the UNIQUE option when you create a hashed table.&lt;/P&gt;&lt;P&gt;Initial Memory Requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can specify the initial amount of main memory assigned to an internal table object when you define the data type using the following &lt;/P&gt;&lt;P&gt;addition:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INITIAL SIZE &amp;lt;n&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This size does not belong to the data type of the internal table, and does not affect the type check. You can use the above addition to &lt;/P&gt;&lt;P&gt;reserve memory space for &amp;lt;n&amp;gt; table lines when you declare the table object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When this initial area is full, the system makes twice as much extra space available up to a limit of 8KB. Further memory areas of 12KB each &lt;/P&gt;&lt;P&gt;are then allocated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can usually leave it to the system to work out the initial memory requirement. The first time you fill the table, little memory is used. The &lt;/P&gt;&lt;P&gt;space occupied, depending on the line width, is 16 &amp;lt;= &amp;lt;n&amp;gt; &amp;lt;= 100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It only makes sense to specify a concrete value of &amp;lt;n&amp;gt; if you can specify a precise number of table entries when you create the table and &lt;/P&gt;&lt;P&gt;need to allocate exactly that amount of memory (exception: Appending table lines to ranked lists). This can be particularly important for &lt;/P&gt;&lt;P&gt;deep-structured internal tables where the inner table only has a few entries (less than 5, for example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To avoid excessive requests for memory, large values of &amp;lt;n&amp;gt; are treated as follows: The largest possible value of &amp;lt;n&amp;gt; is 8KB divided by the &lt;/P&gt;&lt;P&gt;length of the line. If you specify a larger value of &amp;lt;n&amp;gt;, the system calculates a new value so that n times the line width is around 12KB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples&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;TYPES ITAB TYPE SORTED TABLE OF LINE WITH UNIQUE KEY COLUMN1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program defines a table type ITAB. It is a sorted table, with line type of the structure LINE and a unique key of the component &lt;/P&gt;&lt;P&gt;COLUMN1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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;TYPES ITAB TYPE SORTED TABLE OF LINE WITH UNIQUE KEY COLUMN1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF DEEPLINE,&lt;/P&gt;&lt;P&gt;FIELD TYPE C,&lt;/P&gt;&lt;P&gt;TABLE1 TYPE VECTOR,&lt;/P&gt;&lt;P&gt;TABLE2 TYPE ITAB,&lt;/P&gt;&lt;P&gt;END OF DEEPLINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES DEEPTABLE TYPE STANDARD TABLE OF DEEPLINE&lt;/P&gt;&lt;P&gt;WITH DEFAULT KEY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The program defines a table type VECTOR with type hashed table, the elementary line type I and a unique key of the entire table line. The &lt;/P&gt;&lt;P&gt;second table type is the same as in the previous example. The structure DEEPLINE contains the internal table as a component. The table &lt;/P&gt;&lt;P&gt;type DEEPTABLE has the line type DEEPLINE. Therefore, the elements of this internal table are themselves internal tables. The key is the &lt;/P&gt;&lt;P&gt;default key - in this case the column FIELD. The key is non-unique, since the table is a standard table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal table objects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables are dynamic variable data objects. Like all variables, you declare them using the DATA statement. You can also declare static &lt;/P&gt;&lt;P&gt;internal tables in procedures using the STATICS statement, and static internal tables in classes using the CLASS-DATA statement. This &lt;/P&gt;&lt;P&gt;description is restricted to the DATA statement. However, it applies equally to the STATICS and CLASS-DATA statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference to Declared Internal Table Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like all other data objects, you can declare internal table objects using the LIKE or TYPE addition of the DATA statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA &amp;lt;itab&amp;gt; TYPE &amp;lt;type&amp;gt;|LIKE &amp;lt;obj&amp;gt; WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, the LIKE addition refers to an existing table object in the same program. The TYPE addition can refer to an internal type in the &lt;/P&gt;&lt;P&gt;program declared using the TYPES statement, or a table type in the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You must ensure that you only refer to tables that are fully typed. Referring to generic table types (ANY TABLE, INDEX TABLE) or not &lt;/P&gt;&lt;P&gt;specifying the key fully is not allowed (for exceptions, refer to Special Features of Standard Tables).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The optional addition WITH HEADER line declares an extra data object with the same name and line type as the internal table. This data &lt;/P&gt;&lt;P&gt;object is known as the header line of the internal table. You use it as a work area when working with the internal table (see Using the &lt;/P&gt;&lt;P&gt;Header Line as a Work Area). When you use internal tables with header lines, you must remember that the header line and the body of the &lt;/P&gt;&lt;P&gt;table have the same name. If you have an internal table with header line and you want to address the body of the table, you must indicate &lt;/P&gt;&lt;P&gt;this by placing brackets after the table name (&amp;lt;itab&amp;gt;[]). Otherwise, ABAP interprets the name as the name of the header line and not of the &lt;/P&gt;&lt;P&gt;body of the table. You can avoid this potential confusion by using internal tables without header lines. In particular, internal tables nested &lt;/P&gt;&lt;P&gt;in structures or other internal tables must not have a header line, since this can lead to ambiguous expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES VECTOR TYPE SORTED TABLE OF I WITH UNIQUE KEY TABLE LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ITAB TYPE VECTOR,&lt;/P&gt;&lt;P&gt;JTAB LIKE ITAB WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE ITAB TO JTAB. &amp;lt;- Syntax error! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE ITAB TO JTAB[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table object ITAB is created with reference to the table type VECTOR. The table object JTAB has the same data type as ITAB. JTAB also &lt;/P&gt;&lt;P&gt;has a header line. In the first MOVE statement, JTAB addresses the header line. Since this has the data type I, and the table type of ITAB &lt;/P&gt;&lt;P&gt;cannot be converted into an elementary type, the MOVE statement causes a syntax error. The second MOVE statement is correct, since &lt;/P&gt;&lt;P&gt;both operands are table objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declaring New Internal Tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the DATA statement to construct new internal tables as well as using the LIKE or TYPE addition to refer to existing types or &lt;/P&gt;&lt;P&gt;objects. The table type that you construct does not exist in its own right; instead, it is only an attribute of the table object. You can refer to &lt;/P&gt;&lt;P&gt;it using the LIKE addition, but not using TYPE. The syntax for constructing a table object in the DATA statement is similar to that for defining &lt;/P&gt;&lt;P&gt;a table type in the TYPES statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA &amp;lt;itab&amp;gt; TYPE|LIKE &amp;lt;tabkind&amp;gt; OF &amp;lt;linetype&amp;gt; WITH &amp;lt;key&amp;gt;&lt;/P&gt;&lt;P&gt;INITIAL SIZE &amp;lt;n&amp;gt;&lt;/P&gt;&lt;P&gt;WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As when you define a table type , the type constructor&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;tabkind&amp;gt; OF &amp;lt;linetype&amp;gt; WITH &amp;lt;key&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;defines the table type &amp;lt;tabkind&amp;gt;, the line type &amp;lt;linekind&amp;gt;, and the key &amp;lt;key&amp;gt; of the internal table &amp;lt;itab&amp;gt;. Since the technical attributes of &lt;/P&gt;&lt;P&gt;data objects are always fully specified, the table must be fully specified in the DATA statement. You cannot create generic table types (ANY &lt;/P&gt;&lt;P&gt;TABLE, INDEX TABLE), only fully-typed tables (STANDARD TABLE, SORTED TABLE, HASHED TABLE). You must also specify the key and whether &lt;/P&gt;&lt;P&gt;it is to be unique (for exceptions, refer to Special Features of Standard Tables).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As in the TYPES statement, you can, if you wish, allocate an initial amount of memory to the internal table using the INITIAL SIZE addition. &lt;/P&gt;&lt;P&gt;You can create an internal table with a header line using the WITH HEADER LINE addition. The header line is created under the same &lt;/P&gt;&lt;P&gt;conditions as apply when you refer to an existing table type.&lt;/P&gt;&lt;P&gt;&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;The table object ITAB has the type hashed table, a line type corresponding to the flat structure SPFLI from the ABAP Dictionary, and a &lt;/P&gt;&lt;P&gt;unique key with the key fields CARRID and CONNID. The internal table ITAB can be regarded as an internal template for the database table &lt;/P&gt;&lt;P&gt;SPFLI. It is therefore particularly suitable for working with data from this database table as long as you only access it using the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards,&lt;/P&gt;&lt;P&gt;Hema sundara&lt;/P&gt;&lt;P&gt;pls give points if u find it helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2007 10:05:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190637#M760028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-28T10:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190638#M760029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kiran...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope these answers will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Internaltable Events:&lt;/P&gt;&lt;P&gt;      At First&lt;/P&gt;&lt;P&gt;      At Last&lt;/P&gt;&lt;P&gt;      At End of&lt;/P&gt;&lt;P&gt;      At New&lt;/P&gt;&lt;P&gt;      On change Of&lt;/P&gt;&lt;P&gt;2. Screen Is Internal Table which Consists of these fields.&lt;/P&gt;&lt;P&gt;    Fnam(Field name)&lt;/P&gt;&lt;P&gt;    Active&lt;/P&gt;&lt;P&gt;    Group&lt;/P&gt;&lt;P&gt;    Input&lt;/P&gt;&lt;P&gt;    Invisible&lt;/P&gt;&lt;P&gt;If You wanto apply password Characteristics to your field, you can do like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;parameters : pwd(10) modif id  'A'.&lt;/P&gt;&lt;P&gt;At Selection-scree output.&lt;/P&gt;&lt;P&gt;Loop at screen.&lt;/P&gt;&lt;P&gt;If screen-group1 = 'A'.&lt;/P&gt;&lt;P&gt;  screen-invisible = 1.&lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. At New...event checks for not only the changes in given field but also the field which is before of that.&lt;/P&gt;&lt;P&gt;   On change of....the above thing wont happen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sandeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Dec 2007 18:07:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190638#M760029</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-28T18:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190639#M760030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi kiran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.Internal table events are,&lt;/P&gt;&lt;P&gt;AT first,AT END OF ,AT LAST,ON CHANGE, AT NEW.&lt;/P&gt;&lt;P&gt;2.SCREEN IS AN TABLE &lt;/P&gt;&lt;P&gt;it contains group and invisible,active options.&lt;/P&gt;&lt;P&gt;it is used in reporting for change selection screen properties dynamically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION SCREE OUTPUT EVENT USES SCREEN TABLE .&lt;/P&gt;&lt;P&gt;5.on change event only triggers when ever field changes in control field,and also it won't change change values to right of tha control field.&lt;/P&gt;&lt;P&gt;at new field trigers changes in control field and to left of that field changes .but to right of this fields marks 0 if numeric&lt;/P&gt;&lt;P&gt;otherwise *.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A  B     &lt;/P&gt;&lt;P&gt;1   X&lt;/P&gt;&lt;P&gt;2   X&lt;/P&gt;&lt;P&gt;3   Y&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT NEW ON B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st record triggers at new &lt;/P&gt;&lt;P&gt;2nd record triggers at new&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ON CHANGE OF B.&lt;/P&gt;&lt;P&gt;1st trigers but second record won't trigger y means value of b doesn't change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is main difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;database objects means it allocates memory when it is created.&lt;/P&gt;&lt;P&gt;runtime object means it allocates memory at run time and generate at run time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Dec 2007 06:01:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190639#M760030</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-29T06:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190640#M760031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How field properties are set with * for password?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hello have u got the answer for these Q do post me the method as soon as possible &lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Feb 2008 18:30:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190640#M760031</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-27T18:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190641#M760032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.the events are a)at first&lt;/P&gt;&lt;P&gt;                        b)at new&lt;/P&gt;&lt;P&gt;                        c)on change of&lt;/P&gt;&lt;P&gt;                        d)at end&lt;/P&gt;&lt;P&gt;                        e)at last &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.screen is a internal table consisting the following fields&lt;/P&gt;&lt;P&gt;                      a)group1&lt;/P&gt;&lt;P&gt;                      b)input&lt;/P&gt;&lt;P&gt;                      c)invisible&lt;/P&gt;&lt;P&gt;                     d)active&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;3. by setting screen field invisible to ' 1'.      &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5.'at new event take' consideration of left justified fields so it should be defined only on the first field but it is not the case with 'on change of'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 04:57:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190641#M760032</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T04:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190642#M760033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal Tables as Data Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Line type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Key&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table type determines how ABAP will access individual table entries. Internal tables can be divided into three types: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 not. Standard tables and sorted tables are known generically as index tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generic Internal Tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal Tables as Dynamic Data Objects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Choosing a Table Type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Standard tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorted tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashed tables&lt;/P&gt;&lt;P&gt;&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. 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. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Internal table in ABAP&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;*An internal table is a run time instance.  It get created when program starts execution. &lt;/P&gt;&lt;P&gt;*It get destroyed when program terminates. it has two different parts.  HeaderLine(optional) &amp;amp; Body(Compulsory). &lt;/P&gt;&lt;P&gt;*Any value that comes to or goes from interanal table , that travels through headerline.\ &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*A related program is . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*declaration. &lt;/P&gt;&lt;P&gt;data: begin of inernaltable occurs 0, &lt;/P&gt;&lt;P&gt;         x type c, &lt;/P&gt;&lt;P&gt;         y type i, &lt;/P&gt;&lt;P&gt;      end of itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*initializing headerline &lt;/P&gt;&lt;P&gt;   internaltable-x = 'd'. &lt;/P&gt;&lt;P&gt;   internaltable-y = 34. &lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;*storing value into internal table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;appene internaltable .  &lt;/P&gt;&lt;P&gt;appene internaltable . &lt;/P&gt;&lt;P&gt;appene internaltable . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*reading internal table &lt;/P&gt;&lt;P&gt;loop at itab . &lt;/P&gt;&lt;P&gt;   write: / internaltable-x, internaltable-y.  "writes to output list &lt;/P&gt;&lt;P&gt;endloop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP Tips by : Abdul Sayeed &lt;/P&gt;&lt;P&gt;Email : sayeed_mail2005@yahoo.com &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fields of Internal Tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-TABIX &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SEARCH &amp;lt;itab&amp;gt; FOR sets SY-TABIX to the index of the table line in which the search string is found. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-TFILL &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TFILL contains the number of lines in the relevant internal table.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-TLENG &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TLENG contains the length of the lines in the relevant internal table.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-TOCCU &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the statements DESCRIBE TABLE, LOOP AT, and READ TABLE, SY-TLENG contains the initial amount of memory allocated to the relevant internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it will clear some of your doubts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;sreelatha gullapalli&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sreelatha Gullapalli on Feb 28, 2008 6:04 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 05:03:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190642#M760033</guid>
      <dc:creator>sreelatha_gullapalli</dc:creator>
      <dc:date>2008-02-28T05:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190643#M760034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt; events of Internal Table:&lt;/P&gt;&lt;P&gt;At first.&lt;/P&gt;&lt;P&gt;	&amp;lt;Statement block&amp;gt;&lt;/P&gt;&lt;P&gt;Endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the first statement to get executed inside the loop (remember control break statements are applicable only inside the loop)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in this block you can write or process those statements which you want to get executed when the loop starts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At New carrid.&lt;/P&gt;&lt;P&gt;	Write:/ carrid.&lt;/P&gt;&lt;P&gt;Endat.&lt;/P&gt;&lt;P&gt;In this case whenever the new carrid is reached, carrid will be written.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At End of carrid.&lt;/P&gt;&lt;P&gt;	Uline.&lt;/P&gt;&lt;P&gt;Endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case whenever the end of carrid is reached, a line will be drawn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At Last.&lt;/P&gt;&lt;P&gt;	Write:/ &amp;#145;Last Record is reached&amp;#146;.&lt;/P&gt;&lt;P&gt;Endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Processing of statements within this block is done when entire processing of entire internal table is over.  Usually used to display grand totals.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use either all or one of the above control break statements with in the loop for processing internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At end of carrid.&lt;/P&gt;&lt;P&gt;	Sum.&lt;/P&gt;&lt;P&gt;Endat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In above case the statement SUM (applicable only within AT-ENDAT) will sum up all the numeric fields in internal table and result is stored in same internal table variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How field properties are set with * for password?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN OUTPUT.&lt;/P&gt;&lt;P&gt;  LOOP AT SCREEN.&lt;/P&gt;&lt;P&gt; IF screen-group1   = 'GRC'.&lt;/P&gt;&lt;P&gt;      screen-invisible = '1'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt; MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 05:42:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190643#M760034</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T05:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190644#M760035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;3. How field properties are set with * for password?&lt;/P&gt;&lt;P&gt;Ans: &lt;/P&gt;&lt;P&gt;LOOP AT SCREEN.&lt;/P&gt;&lt;P&gt;IF SCREEN-NAME='password'.&lt;/P&gt;&lt;P&gt;SCREEN-INPUT = &amp;#145;1&amp;#146;.&lt;/P&gt;&lt;P&gt;SCREEN-INVISIBLE = &amp;#145;1&amp;#146;.&lt;/P&gt;&lt;P&gt;MODIFY SCREEN.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 06:22:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190644#M760035</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T06:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190645#M760036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;4. What is the difference between on change of field and at new field events?&lt;/P&gt;&lt;P&gt;ANS: The main difference is &lt;/P&gt;&lt;P&gt;At new follows only one field but on change of follows multiple fields of internal table.&lt;/P&gt;&lt;P&gt;Ex:&lt;/P&gt;&lt;P&gt;AT NEW MATNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ON CHANGE OF MATNR WERKS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Feb 2008 06:26:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190645#M760036</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-28T06:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Internal Tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190646#M760037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. What are events of Internal Table?&lt;/P&gt;&lt;P&gt;2. What is screen internal table?&lt;/P&gt;&lt;P&gt;3. How field properties are set with * for password?&lt;/P&gt;&lt;P&gt;4. How the dialog programming for screen displays?&lt;/P&gt;&lt;P&gt;5. What is the difference between on change of field and at new field events?&lt;/P&gt;&lt;P&gt;6. What is the difference between data base objects and runtime objects?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1  events of Internal Table are&lt;/P&gt;&lt;P&gt;at new&lt;/P&gt;&lt;P&gt;at first&lt;/P&gt;&lt;P&gt;at last&lt;/P&gt;&lt;P&gt;at end-of&lt;/P&gt;&lt;P&gt;on change-of&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5)the difference b/w on chnage-of and at new is that....&lt;/P&gt;&lt;P&gt;at new is controlbreak statment and on change of is not and &lt;/P&gt;&lt;P&gt;we can use onchange of  out side the loop&lt;/P&gt;&lt;P&gt; and on at new the left side feild change  the event &lt;/P&gt;&lt;P&gt;trigers and the values become 0 and *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;vineela&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Mar 2008 10:36:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-tables/m-p/3190646#M760037</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-03T10:36:01Z</dc:date>
    </item>
  </channel>
</rss>

