<?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 Differences in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/differences/m-p/2268126#M492429</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In following two way of defining the internal table which is the best one and what are the advantages in each one.&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;      TYPES ITAB TYPE LINE OCCURS 10.&lt;/P&gt;&lt;P&gt;       DATA ITAB1 TYPE ITAB.&lt;/P&gt;&lt;P&gt;       DATA ITAB2 LIKE ITAB1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 May 2007 05:46:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-18T05:46:14Z</dc:date>
    <item>
      <title>Differences</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/differences/m-p/2268126#M492429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In following two way of defining the internal table which is the best one and what are the advantages in each one.&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;      TYPES ITAB TYPE LINE OCCURS 10.&lt;/P&gt;&lt;P&gt;       DATA ITAB1 TYPE ITAB.&lt;/P&gt;&lt;P&gt;       DATA ITAB2 LIKE ITAB1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 05:46:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/differences/m-p/2268126#M492429</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T05:46:14Z</dc:date>
    </item>
    <item>
      <title>Re: Differences</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/differences/m-p/2268127#M492430</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 table without header line is having high performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types : begin of ty_mara,&lt;/P&gt;&lt;P&gt;            matnr type matnr,&lt;/P&gt;&lt;P&gt;            erdat type erdat,&lt;/P&gt;&lt;P&gt;             end of ty_mara.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since we are creating workarea as per client requirement..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward with points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 05:56:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/differences/m-p/2268127#M492430</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T05:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Differences</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/differences/m-p/2268128#M492431</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;the best way of defining internal table is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF itab,&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 itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*internal table&lt;/P&gt;&lt;P&gt;data : it_itab type standard table of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we can declare work area's where ever needed&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;nazeer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        nazeer shaik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 05:56:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/differences/m-p/2268128#M492431</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T05:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: Differences</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/differences/m-p/2268129#M492432</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;chk this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZTYPES                                                      *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
REPORT  ZTYPES                                                  .

* Table declaration (old method)
DATA: BEGIN OF tab_ekpo OCCURS 0,             "itab with header line
  ebeln TYPE ekpo-ebeln,
  ebelp TYPE ekpo-ebelp,
 END OF tab_ekpo.

*Table declaration (new method)     "USE THIS WAY!!!
TYPES: BEGIN OF t_ekpo,
  ebeln TYPE ekpo-ebeln,
  ebelp TYPE ekpo-ebelp,
 END OF t_ekpo.
DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,      "itab
      wa_ekpo TYPE t_ekpo.                    "work area (header line)

* Build internal table and work area from existing internal table
DATA: it_datatab LIKE tab_ekpo OCCURS 0,      "old method
      wa_datatab LIKE LINE OF tab_ekpo.

* Build internal table and work area from existing internal table,
* adding additional fields
TYPES: BEGIN OF t_repdata.
        INCLUDE STRUCTURE tab_ekpo.  "could include EKKO table itself!!
TYPES: bukrs  TYPE ekpo-werks,
       bstyp  TYPE ekpo-bukrs.
TYPES: END OF t_repdata.

DATA: it_repdata TYPE STANDARD TABLE OF t_repdata INITIAL SIZE 0,   "itab
      wa_repdata TYPE t_repdata.                 "work area (header line)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Reshma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 05:57:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/differences/m-p/2268129#M492432</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T05:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Differences</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/differences/m-p/2268130#M492433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shri Ram,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The statement OCCURS 0 (or 10) has become obsolete. so you should avoid using the same. Also, the internal table with header line should also be avoided. As such OOPs concepts in ABAP doesnt support internal table with header line. The ideal way of declaring an internal table is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of ty_itab,&lt;/P&gt;&lt;P&gt;          field1,&lt;/P&gt;&lt;P&gt;          field2,&lt;/P&gt;&lt;P&gt;          end of ty_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: itab type table of ty_itab,   declares internal table&lt;/P&gt;&lt;P&gt;         wa  like line of itab ( or wa type ty_itab) . this declares the work area for the internal table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now you use it in way&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(logic)&lt;/P&gt;&lt;P&gt;endloop .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps. &lt;/P&gt;&lt;P&gt;Revert incase of any issues,&lt;/P&gt;&lt;P&gt;Reward points if helpful.&lt;/P&gt;&lt;P&gt;Karan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 May 2007 05:59:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/differences/m-p/2268130#M492433</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-18T05:59:02Z</dc:date>
    </item>
  </channel>
</rss>

