<?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: What's difference between the following two structure declaration? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947186#M390306</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much.&lt;/P&gt;&lt;P&gt;I will learn ABAP OBJECTS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Feb 2007 03:09:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-15T03:09:28Z</dc:date>
    <item>
      <title>What's difference between the following two structure declaration?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947177#M390297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am new to SAP ABAP/4 programming.&lt;/P&gt;&lt;P&gt;I declared the structure,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF DATA_ITEM,&lt;/P&gt;&lt;P&gt;               CARRID LIKE SPFLI-CARRID,&lt;/P&gt;&lt;P&gt;               CONNID LIKE SPFLI-CONNID,&lt;/P&gt;&lt;P&gt;           END OF DATA_ITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I read some material,its declaration is &lt;/P&gt;&lt;P&gt;DATA: BEGIN OF DATA_ITEM,&lt;/P&gt;&lt;P&gt;               CARRID TYPE SPFLI-CARRID,&lt;/P&gt;&lt;P&gt;               CONNID TYPE SPFLI-CONNID,&lt;/P&gt;&lt;P&gt;           END OF DATA_ITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know why?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 01:22:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947177#M390297</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T01:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: What's difference between the following two structure declaration?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947178#M390298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you are using Object Oriented programming with classes use TYPE declaration, if you are using normal programming use LIKE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Newer versions of SAP are classes so better to start your programming with TYPE declaration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Subramanian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 02:02:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947178#M390298</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T02:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: What's difference between the following two structure declaration?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947179#M390299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi xin chen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No difference. But "LIKE" is an obsolete word after ABAP 4.6C. "Type" is suggested to use by SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Julian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 02:06:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947179#M390299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T02:06:10Z</dc:date>
    </item>
    <item>
      <title>Re: What's difference between the following two structure declaration?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947180#M390300</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;DATA - TYPE, LIKE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;DATA dobj { {TYPE [LINE OF] type} &lt;/P&gt;&lt;P&gt;| {LIKE [LINE OF] dobj} } &lt;/P&gt;&lt;P&gt;[VALUE val|{IS INITIAL}] &lt;/P&gt;&lt;P&gt;[READ-ONLY]. &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;In the specification of a data type type or a data object dobj, the data type of the variable dobj is already fully defined before the declaration. The syntax and meaning of the additions TYPE and LIKE has exactly the same meaning as the definition of data types with TYPES, except that for DATA after TYPE a standard table type with a generic table key can be specified. In this case, a bound table type with a standard key is created. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Prior to Release 6.10, no VALUE addition was possible if the data type deep, specified using TYPE or LIKE, was a string, a reference type, a table type, or a structured type with deep components. As of Release 6.10, the VALUE addition can also be used for deep data types; however, with the limitation that a start value val can only be specified for the ABAP type string, and otherwise only IS INITIAL. &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;&lt;/P&gt;&lt;P&gt;These statements define two data objects, both of which have the same data type as the database table spfli. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: spfli_wa1 TYPE spfli, &lt;/P&gt;&lt;P&gt;spfli_wa2 LIKE spfli_wa1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 02:10:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947180#M390300</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T02:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: What's difference between the following two structure declaration?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947181#M390301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The above declared structures hold the same meaning. However, the basic difference between TYPE and LIKE is... TYPE refers to existing data type and LIKE refers to existing data object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: var1 type i.&lt;/P&gt;&lt;P&gt;data: var2 like var1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, var1 refers to existing data type i.e. i. &lt;/P&gt;&lt;P&gt;var2 refers to existing data object i.e. var1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 02:14:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947181#M390301</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T02:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: What's difference between the following two structure declaration?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947182#M390302</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;&lt;/P&gt;&lt;P&gt;there only the difference between LIKE and TYPE statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIKE-&amp;gt;&lt;/P&gt;&lt;P&gt;LIKE Use an existing field as a reference &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-&amp;gt;Creates a new type with the name type. If you do nont use the TYPE addition, the new type has the default type C. &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, 13 Feb 2007 04:17:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947182#M390302</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T04:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: What's difference between the following two structure declaration?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947183#M390303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually&lt;/P&gt;&lt;P&gt;Correct typeing is:&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF DATA_ITEM,&lt;/P&gt;&lt;P&gt;CARRID TYPE S_CARR_ID,&lt;/P&gt;&lt;P&gt;CONNID TYPE S_CONN_ID,&lt;/P&gt;&lt;P&gt;END OF DATA_ITEM.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;DATA: BEGIN OF DATA_ITEM,&lt;/P&gt;&lt;P&gt;CARRID TYPE SPFLI-CARRID,&lt;/P&gt;&lt;P&gt;CONNID TYPE SPFLI-CONNID,&lt;/P&gt;&lt;P&gt;END OF DATA_ITEM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE is not interchangable with LIKE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gareth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 04:22:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947183#M390303</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T04:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: What's difference between the following two structure declaration?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947184#M390304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for response.&lt;/P&gt;&lt;P&gt;But in this case why SPFLI-CARRID can not only act as data type but also data object?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 07:46:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947184#M390304</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T07:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: What's difference between the following two structure declaration?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947185#M390305</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;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF DATA_ITEM,
             CARRID LIKE SPFLI-CARRID,
             CONNID LIKE SPFLI-CONNID,
           END OF DATA_ITEM.

DATA: BEGIN OF DATA_ITEM,
              CARRID TYPE SPFLI-CARRID,
              CONNID TYPE SPFLI-CONNID,
           END OF DATA_ITEM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These two definations are the same in ABAP 4 language, there isn't a really difference, just as many guys have said to you before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From release 4.6A the ABAP OBJECT (ABAP OBJECT ORIENTED PROGRAMMING) language was introducted as extension of ABAP. In the ABAP OBJECT only TYPE statament can be used to define the variables, so a declaration like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: BEGIN OF DATA_ITEM,
             CARRID LIKE SPFLI-CARRID,
             CONNID LIKE SPFLI-CONNID,
           END OF DATA_ITEM&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it's not allowed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP and ABAP OBJECT are two way of programming.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2007 07:58:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947185#M390305</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-13T07:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: What's difference between the following two structure declaration?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947186#M390306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much.&lt;/P&gt;&lt;P&gt;I will learn ABAP OBJECTS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 03:09:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/what-s-difference-between-the-following-two-structure-declaration/m-p/1947186#M390306</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T03:09:28Z</dc:date>
    </item>
  </channel>
</rss>

