<?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: reg: internal table? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-table/m-p/1475936#M223161</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYI..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA - Defining an Internal Table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variants: &lt;/P&gt;&lt;P&gt;1. DATA itab TYPE itabtype [WITH HEADER LINE]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. DATA itab {TYPE tabkind OF linetype| &lt;/P&gt;&lt;P&gt;              LIKE tabkind OF lineobj} &lt;/P&gt;&lt;P&gt;          WITH [UNIQUE|NON-UNIQUE] keydef &lt;/P&gt;&lt;P&gt;          [INITIAL SIZE n] [WITH HEADER LINE]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. DATA itab {TYPE TABLE OF linetype|LIKE TABLE OF lineobj}. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. DATA itab TYPE RANGE OF type. &lt;/P&gt;&lt;P&gt;DATA itab LIKE RANGE OF f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. DATA itab [TYPE linetype|LIKE lineobj] OCCURS n &lt;/P&gt;&lt;P&gt;          [WITH HEADER LINE]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. DATA: BEGIN OF itab OCCURS n, &lt;/P&gt;&lt;P&gt;        ... &lt;/P&gt;&lt;P&gt;      END   OF itab [VALID BETWEEN f1 AND f2]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In an ABAP Objects context, a more severe syntax check is performed that in other ABAP areas. See New naming conventions and LIKE references to Dictionary Types not allowed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Defines an internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fill and process internal tables, use the statements INSERT, APPEND, READ TABLE, LOOP, SORT, and so on. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The OCCURS or INITIAL SIZE parameter (OCCURS value) determines the number of lines that are created when the table itself is created. However, the table is extended dynamically on demand. For details, refer to Performance Notes for Internal Tables. The OCCURS value, has no other semantic meaning (apart from one exception in the APPEND SORTED BY statement). If you do not specify an INIT IAL SIZE , the system uses the default value 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you specify WITH HEADER LINE, the table is created with a header line, that is, a field with the same name. It has the same type as the line type of the table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition is not allowed in an ABAP Objects context. See Tables with header line not allowed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 1 &lt;/P&gt;&lt;P&gt;DATA itab TYPE itabtype [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;Effect &lt;/P&gt;&lt;P&gt;itabtype must be an internal table type that you have already defined using TYPES. The statement creates an internal table in the program with this type. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general, the type specification for the table object must be complete. The exception to this is a standard table, in which the key definition may be missing. In this case, the system automatically uses a default key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Creating a hashed table by referring to an existing table type: &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: BEGIN OF STRUC, NAME(10), AGE TYPE I, END OF STRUC, &lt;/P&gt;&lt;P&gt;       HTAB TYPE HASHED TABLE OF STRUC WITH UNIQUE KEY NAME. &lt;/P&gt;&lt;P&gt;DATA : PERSONS TYPE HTAB. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 2 &lt;/P&gt;&lt;P&gt;DATA itab {TYPE tabkind OF linetype|LIKE tabkind OF lineobj}           WITH [UNIQUE|NON-UNIQUE] keydef &lt;/P&gt;&lt;P&gt;          [INITIAL SIZE n] [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;Effect &lt;/P&gt;&lt;P&gt;Creates an internal table in the program with the type tabkind. Since there are no generic field definitions, you cannot use the table types ANY TABLE or INDEX TABLE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The structure of the table lines is defined by the type linetype if you use a TYPE reference) or by the type of the referred object lineobj (when you use a LIKE reference). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same rules apply to the UNIQUE and NON-UNIQUE additions in the DATA statement as in a TYPES definition. You may only omit the definition when defining a standard table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do not specify the INITIAL SIZE the system uses a default initial size of 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 3 &lt;/P&gt;&lt;P&gt;DATA itab {TYPE TABLE OF linetype|LIKE TABLE OF lineobj}. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This is a shortened form of the definition of a standard table. It corresponds to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   DATA itab {TYPE STANDARD TABLE OF linetype| &lt;/P&gt;&lt;P&gt;              LIKE STANDARD TABLE OF lineobj} WITH DEFAULT KEY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or the old definition (compare variant 4) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   DATA itab {TYPE linetype|LIKE lineobj} OCCURS 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 4 &lt;/P&gt;&lt;P&gt;DATA itab TYPE RANGE OF type. DATA itab LIKE RANGE OF f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additions: &lt;/P&gt;&lt;P&gt;1. ... INITIAL SIZE n &lt;/P&gt;&lt;P&gt;2. ... WITH HEADER LINE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Creates an internal table itab with table type STANDARD. The line type is a structure with the following components: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SIGN(1)   TYPE C &lt;/P&gt;&lt;P&gt;  OPTION(2) TYPE C &lt;/P&gt;&lt;P&gt;  LOW       TYPE type bzw. LIKE f &lt;/P&gt;&lt;P&gt;  HIGH      TYPE type bzw. LIKE f &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1 &lt;/P&gt;&lt;P&gt;...INITIAL SIZE n &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The INITIAL SIZE specification determines how many table lines are created when the table itself is created. The table is also dynamically expanded as required. For further information, refer to Performance Notes for Internal Tables. The INITIAL SIZE value has no semantic meaning (apart from one exception in the ei APPEND SORTED BY statement). If you do not specify the INITIAL SIZE, the system uses the default value 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... WITH HEADER LINE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition is not allowed in an ABAP Objects context. See Tables with Header Lines Not Allowed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Creates an internal table and a header line for it, that is, a field with the same name as the internal table and the same type as the line type of the internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 5 &lt;/P&gt;&lt;P&gt;DATA itab [TYPE linetype|LIKE lineobj] OCCURS n                                        [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;This variant is not allowed in an ABAP Objects context. See Declaration with OCCURS not allowed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This variant exists to ensure compatibility with Release 3.x. If you do not specify a line type, the system uses type C with length 1. Otherwise, the variant is the same as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   DATA itab {TYPE STANDARD TABLE OF linetype| &lt;/P&gt;&lt;P&gt;              LIKE STANDARD TABLE OF lineobj} &lt;/P&gt;&lt;P&gt;             INITIAL SIZE n [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;Example&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF LINE_TYPE, &lt;/P&gt;&lt;P&gt;         NAME(20) TYPE C, &lt;/P&gt;&lt;P&gt;         AGE      TYPE I, &lt;/P&gt;&lt;P&gt;       END   OF LINE_TYPE. &lt;/P&gt;&lt;P&gt;DATA:  PERSONS    TYPE LINE_TYPE OCCURS 20, &lt;/P&gt;&lt;P&gt;       PERSONS_WA TYPE LINE_TYPE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERSONS_WA-NAME = 'Michael'.  PERSONS_WA-AGE  = 25. &lt;/P&gt;&lt;P&gt;APPEND PERSONS_WA TO PERSONS. &lt;/P&gt;&lt;P&gt;PERSONS_WA-NAME = 'Gabriela'. PERSONS_WA-AGE  = 22. &lt;/P&gt;&lt;P&gt;APPEND PERSONS_WA TO PERSONS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table PERSONS now contains two entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 6 &lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab OCCURS n,         ... &lt;/P&gt;&lt;P&gt;      END   OF itab [VALID BETWEEN f1 AND f2]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This variant is not allowed in an ABAP Objects context. See Declaration with OCCURS not allowed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Creates an internal table itab with type STANDARD and a header line. The line type consists of the fields between "BEGIN OF itab OCCURS n" and " END OF itab". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the VALID BETWEEN f1 AND f2 addition to specify that the components f1 and f2 of the internal table itab contain a line-based validity interval. You can only use this addition in conjunction with the PROVIDE statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF PERSONS OCCURS 20, &lt;/P&gt;&lt;P&gt;        NAME(20), &lt;/P&gt;&lt;P&gt;        AGE TYPE I, &lt;/P&gt;&lt;P&gt;      END   OF PERSONS. &lt;/P&gt;&lt;P&gt;PERSONS-NAME = 'Michael'. &lt;/P&gt;&lt;P&gt;PERSONS-AGE  = 25. &lt;/P&gt;&lt;P&gt;APPEND PERSONS. &lt;/P&gt;&lt;P&gt;PERSONS-NAME = 'Gabriela'. &lt;/P&gt;&lt;P&gt;PERSONS-AGE  = 22. &lt;/P&gt;&lt;P&gt;APPEND PERSONS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table consists of two entries. PERSONS also has a header line (work area), which is an interface between the program and the actual table contents. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional help &lt;/P&gt;&lt;P&gt;Internal Table Objects &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ramesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Sep 2006 07:08:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-05T07:08:50Z</dc:date>
    <item>
      <title>reg: internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-table/m-p/1475931#M223156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello friends?&lt;/P&gt;&lt;P&gt;i have one basic doubts,&lt;/P&gt;&lt;P&gt;please clear this things,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what are all the ways we can create the internal table?&lt;/P&gt;&lt;P&gt;how we create internal table using data statement?&lt;/P&gt;&lt;P&gt;how we create internal table using types statement?&lt;/P&gt;&lt;P&gt;what is the difference between these two methods?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 05:50:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-table/m-p/1475931#M223156</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T05:50:34Z</dc:date>
    </item>
    <item>
      <title>Re: reg: internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-table/m-p/1475932#M223157</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi selva,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. what are all the ways we can create the internal table?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   a) using BEGIN OF &lt;/P&gt;&lt;P&gt;   b) using some data dictionary table/structure&lt;/P&gt;&lt;P&gt;   c) using types and then data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. how we create internal table using data statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : T001 LIKE T001 OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;  DATA : T001 LIKE TABLE OF T001 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;  DATA : BEGIN OF T001 OCCURS 0,&lt;/P&gt;&lt;P&gt;         F1(10) TYPE C,&lt;/P&gt;&lt;P&gt;         END OF T001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. how we create internal table using types statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF MYTYPE,&lt;/P&gt;&lt;P&gt;       F(10) TYPE C,&lt;/P&gt;&lt;P&gt;        END OF MYTYPE.&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;DATA : MYITAB TYPE MYTYPE OCCURS 0 WITH HEADER LINE.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. what is the difference between these two methods? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For practical purpose,&lt;/P&gt;&lt;P&gt;there is no difference.&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;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 05:53:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-table/m-p/1475932#M223157</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T05:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: reg: internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-table/m-p/1475933#M223158</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;1- there is two kind of internal table&lt;/P&gt;&lt;P&gt;a-internal table with header line&lt;/P&gt;&lt;P&gt;b-internal table withoug heder line&lt;/P&gt;&lt;P&gt;2-DATA: BEGIN of ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;3-DATA: BEGIN of ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;     FIDLEDS,&lt;/P&gt;&lt;P&gt;  END OF ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: ITAB1 TYPE ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4-IN DATA YOU R DIRECTLY DECLARING AN INTENAL TABLE,&lt;/P&gt;&lt;P&gt;  but in case of TYPE you r using the reference of the first table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 05:59:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-table/m-p/1475933#M223158</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T05:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: reg: internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-table/m-p/1475934#M223159</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Selva, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It really depends on your company standards and your personal preference. Anyway, here are the ways you can declare an internal table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*TYPES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of itab, &lt;/P&gt;&lt;P&gt;        f1(20) type c,&lt;/P&gt;&lt;P&gt;        f2     type i, &lt;/P&gt;&lt;P&gt;        f3     type i,&lt;/P&gt;&lt;P&gt;       end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_itab type standard table of itab with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"OR YOU CAN DECLARE YOUR ITAB W/O HEADER LINE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_itab type standard table of itab.&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;fs_itab&amp;gt; like line of it_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*DATA&lt;/P&gt;&lt;P&gt;data: begin of itab occurs 0, &lt;/P&gt;&lt;P&gt;       f1(20) type c,&lt;/P&gt;&lt;P&gt;        f2     type i, &lt;/P&gt;&lt;P&gt;        f3     type i,&lt;/P&gt;&lt;P&gt;       end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I always go types since it is more 'formal' for me and I am using ABAP OO in some of my reports.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S. Please award points for useful answers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 06:24:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-table/m-p/1475934#M223159</guid>
      <dc:creator>aris_hidalgo</dc:creator>
      <dc:date>2006-09-05T06:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: reg: internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-table/m-p/1475935#M223160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 1: using TYPES&lt;/P&gt;&lt;P&gt;( This is the suggested way of declaring internal table)&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF ty_itab,&lt;/P&gt;&lt;P&gt;         matnr type matnr,&lt;/P&gt;&lt;P&gt;       ENDOF ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lwa_itab type ty_itab,&lt;/P&gt;&lt;P&gt;      gt_itab  like standard table of lwa_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 2:&lt;/P&gt;&lt;P&gt;( This is not suggested)&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF dt_itab occurs 10, ( or occurs 0)&lt;/P&gt;&lt;P&gt;         matnr type matnr,&lt;/P&gt;&lt;P&gt;      ENDOF dt_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Case 2 is not suggested because when ever the internal table is appended the internal table length is increased by size 10 rows ( Just think about eh wastage of space if you have n fields in the internal table).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in case 1, the internal table row will be created only when you append to the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also it is not suggested to use occurs or with header line clause, as it decreases the performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this clarifies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regs,&lt;/P&gt;&lt;P&gt;Venkat Ramanan N&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Venkat Ramanan Natarajan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 06:41:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-table/m-p/1475935#M223160</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T06:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: reg: internal table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-table/m-p/1475936#M223161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYI..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA - Defining an Internal Table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variants: &lt;/P&gt;&lt;P&gt;1. DATA itab TYPE itabtype [WITH HEADER LINE]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. DATA itab {TYPE tabkind OF linetype| &lt;/P&gt;&lt;P&gt;              LIKE tabkind OF lineobj} &lt;/P&gt;&lt;P&gt;          WITH [UNIQUE|NON-UNIQUE] keydef &lt;/P&gt;&lt;P&gt;          [INITIAL SIZE n] [WITH HEADER LINE]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. DATA itab {TYPE TABLE OF linetype|LIKE TABLE OF lineobj}. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. DATA itab TYPE RANGE OF type. &lt;/P&gt;&lt;P&gt;DATA itab LIKE RANGE OF f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. DATA itab [TYPE linetype|LIKE lineobj] OCCURS n &lt;/P&gt;&lt;P&gt;          [WITH HEADER LINE]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6. DATA: BEGIN OF itab OCCURS n, &lt;/P&gt;&lt;P&gt;        ... &lt;/P&gt;&lt;P&gt;      END   OF itab [VALID BETWEEN f1 AND f2]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In an ABAP Objects context, a more severe syntax check is performed that in other ABAP areas. See New naming conventions and LIKE references to Dictionary Types not allowed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Defines an internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To fill and process internal tables, use the statements INSERT, APPEND, READ TABLE, LOOP, SORT, and so on. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The OCCURS or INITIAL SIZE parameter (OCCURS value) determines the number of lines that are created when the table itself is created. However, the table is extended dynamically on demand. For details, refer to Performance Notes for Internal Tables. The OCCURS value, has no other semantic meaning (apart from one exception in the APPEND SORTED BY statement). If you do not specify an INIT IAL SIZE , the system uses the default value 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you specify WITH HEADER LINE, the table is created with a header line, that is, a field with the same name. It has the same type as the line type of the table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition is not allowed in an ABAP Objects context. See Tables with header line not allowed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 1 &lt;/P&gt;&lt;P&gt;DATA itab TYPE itabtype [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;Effect &lt;/P&gt;&lt;P&gt;itabtype must be an internal table type that you have already defined using TYPES. The statement creates an internal table in the program with this type. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general, the type specification for the table object must be complete. The exception to this is a standard table, in which the key definition may be missing. In this case, the system automatically uses a default key. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Creating a hashed table by referring to an existing table type: &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: BEGIN OF STRUC, NAME(10), AGE TYPE I, END OF STRUC, &lt;/P&gt;&lt;P&gt;       HTAB TYPE HASHED TABLE OF STRUC WITH UNIQUE KEY NAME. &lt;/P&gt;&lt;P&gt;DATA : PERSONS TYPE HTAB. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 2 &lt;/P&gt;&lt;P&gt;DATA itab {TYPE tabkind OF linetype|LIKE tabkind OF lineobj}           WITH [UNIQUE|NON-UNIQUE] keydef &lt;/P&gt;&lt;P&gt;          [INITIAL SIZE n] [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;Effect &lt;/P&gt;&lt;P&gt;Creates an internal table in the program with the type tabkind. Since there are no generic field definitions, you cannot use the table types ANY TABLE or INDEX TABLE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The structure of the table lines is defined by the type linetype if you use a TYPE reference) or by the type of the referred object lineobj (when you use a LIKE reference). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The same rules apply to the UNIQUE and NON-UNIQUE additions in the DATA statement as in a TYPES definition. You may only omit the definition when defining a standard table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do not specify the INITIAL SIZE the system uses a default initial size of 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 3 &lt;/P&gt;&lt;P&gt;DATA itab {TYPE TABLE OF linetype|LIKE TABLE OF lineobj}. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This is a shortened form of the definition of a standard table. It corresponds to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   DATA itab {TYPE STANDARD TABLE OF linetype| &lt;/P&gt;&lt;P&gt;              LIKE STANDARD TABLE OF lineobj} WITH DEFAULT KEY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or the old definition (compare variant 4) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   DATA itab {TYPE linetype|LIKE lineobj} OCCURS 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 4 &lt;/P&gt;&lt;P&gt;DATA itab TYPE RANGE OF type. DATA itab LIKE RANGE OF f. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additions: &lt;/P&gt;&lt;P&gt;1. ... INITIAL SIZE n &lt;/P&gt;&lt;P&gt;2. ... WITH HEADER LINE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Creates an internal table itab with table type STANDARD. The line type is a structure with the following components: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SIGN(1)   TYPE C &lt;/P&gt;&lt;P&gt;  OPTION(2) TYPE C &lt;/P&gt;&lt;P&gt;  LOW       TYPE type bzw. LIKE f &lt;/P&gt;&lt;P&gt;  HIGH      TYPE type bzw. LIKE f &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1 &lt;/P&gt;&lt;P&gt;...INITIAL SIZE n &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The INITIAL SIZE specification determines how many table lines are created when the table itself is created. The table is also dynamically expanded as required. For further information, refer to Performance Notes for Internal Tables. The INITIAL SIZE value has no semantic meaning (apart from one exception in the ei APPEND SORTED BY statement). If you do not specify the INITIAL SIZE, the system uses the default value 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... WITH HEADER LINE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This addition is not allowed in an ABAP Objects context. See Tables with Header Lines Not Allowed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Creates an internal table and a header line for it, that is, a field with the same name as the internal table and the same type as the line type of the internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 5 &lt;/P&gt;&lt;P&gt;DATA itab [TYPE linetype|LIKE lineobj] OCCURS n                                        [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;This variant is not allowed in an ABAP Objects context. See Declaration with OCCURS not allowed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;This variant exists to ensure compatibility with Release 3.x. If you do not specify a line type, the system uses type C with length 1. Otherwise, the variant is the same as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   DATA itab {TYPE STANDARD TABLE OF linetype| &lt;/P&gt;&lt;P&gt;              LIKE STANDARD TABLE OF lineobj} &lt;/P&gt;&lt;P&gt;             INITIAL SIZE n [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;Example&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF LINE_TYPE, &lt;/P&gt;&lt;P&gt;         NAME(20) TYPE C, &lt;/P&gt;&lt;P&gt;         AGE      TYPE I, &lt;/P&gt;&lt;P&gt;       END   OF LINE_TYPE. &lt;/P&gt;&lt;P&gt;DATA:  PERSONS    TYPE LINE_TYPE OCCURS 20, &lt;/P&gt;&lt;P&gt;       PERSONS_WA TYPE LINE_TYPE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERSONS_WA-NAME = 'Michael'.  PERSONS_WA-AGE  = 25. &lt;/P&gt;&lt;P&gt;APPEND PERSONS_WA TO PERSONS. &lt;/P&gt;&lt;P&gt;PERSONS_WA-NAME = 'Gabriela'. PERSONS_WA-AGE  = 22. &lt;/P&gt;&lt;P&gt;APPEND PERSONS_WA TO PERSONS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table PERSONS now contains two entries. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 6 &lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab OCCURS n,         ... &lt;/P&gt;&lt;P&gt;      END   OF itab [VALID BETWEEN f1 AND f2]. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This variant is not allowed in an ABAP Objects context. See Declaration with OCCURS not allowed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Creates an internal table itab with type STANDARD and a header line. The line type consists of the fields between "BEGIN OF itab OCCURS n" and " END OF itab". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the VALID BETWEEN f1 AND f2 addition to specify that the components f1 and f2 of the internal table itab contain a line-based validity interval. You can only use this addition in conjunction with the PROVIDE statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF PERSONS OCCURS 20, &lt;/P&gt;&lt;P&gt;        NAME(20), &lt;/P&gt;&lt;P&gt;        AGE TYPE I, &lt;/P&gt;&lt;P&gt;      END   OF PERSONS. &lt;/P&gt;&lt;P&gt;PERSONS-NAME = 'Michael'. &lt;/P&gt;&lt;P&gt;PERSONS-AGE  = 25. &lt;/P&gt;&lt;P&gt;APPEND PERSONS. &lt;/P&gt;&lt;P&gt;PERSONS-NAME = 'Gabriela'. &lt;/P&gt;&lt;P&gt;PERSONS-AGE  = 22. &lt;/P&gt;&lt;P&gt;APPEND PERSONS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table consists of two entries. PERSONS also has a header line (work area), which is an interface between the program and the actual table contents. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional help &lt;/P&gt;&lt;P&gt;Internal Table Objects &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ramesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Sep 2006 07:08:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reg-internal-table/m-p/1475936#M223161</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-05T07:08:50Z</dc:date>
    </item>
  </channel>
</rss>

