<?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: difference in LIKE / TYPE /  TYPE REF TO in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-in-like-type-type-ref-to/m-p/3756449#M903683</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;Type ref to ..... is used to create objects of class &lt;/P&gt;&lt;P&gt;data : object1 type ref to class1.&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 is type definition do not hold any data its just a structure..&lt;/P&gt;&lt;P&gt;types : begin of itab,&lt;/P&gt;&lt;P&gt;f1 type c,&lt;/P&gt;&lt;P&gt;f2 type c,&lt;/P&gt;&lt;P&gt;end of itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can use TYPE not LIKE for this because this is just a structure.defining an internal table/ DATA OBJECT&lt;/P&gt;&lt;P&gt;data : it_itab TYPE STANDARD TABLE OF itab. "you are using type to structures&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now another table&lt;/P&gt;&lt;P&gt;data ITAB2 LIKE it_itab. "you can use LIKE to data Objects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can 't do like this&lt;/P&gt;&lt;P&gt;data itab2 like itab. "this is wrong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type is generally used for declaring variables, parameters for existing data types in abap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ex: to declare a inter value and character variable of length 10 is as,&lt;/P&gt;&lt;P&gt;data: i1 type i,&lt;/P&gt;&lt;P&gt;c1(10) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like generally refers to existing data objects in abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ex:&lt;/P&gt;&lt;P&gt;data: matnr like mara-matnr,&lt;/P&gt;&lt;P&gt;vbeln like vbap-vbeln.&lt;/P&gt;&lt;P&gt;creating variables matnr, vbeln from existing fields of tables mara, vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when user creates a user defiend structure for work areas, internal tables we generally use type keyword as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of itab,&lt;/P&gt;&lt;P&gt;.........&lt;/P&gt;&lt;P&gt;.........&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;data: itab1 type itab occurs 0 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;*********&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go through the link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE - Type is used to tell the system what is the type of data object(variable) you want to create .&lt;/P&gt;&lt;P&gt;LIKE: If there is already a data object declared and you want to declare a similar data object you can just refer to the previous data object using like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this thread.&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=711746&amp;amp;messageID=2270752" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=711746&amp;amp;messageID=2270752&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=711746&amp;amp;messageID=512214" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=711746&amp;amp;messageID=512214&lt;/A&gt;&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;Vasu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Apr 2008 10:39:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-23T10:39:40Z</dc:date>
    <item>
      <title>difference in LIKE / TYPE /  TYPE REF TO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-in-like-type-type-ref-to/m-p/3756446#M903680</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;Kindly let me know what is the purpose of the below words in OOABAP.&lt;/P&gt;&lt;P&gt;LIKE&lt;/P&gt;&lt;P&gt;TYPE&lt;/P&gt;&lt;P&gt;TYPE REF TO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Akshitha.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 10:30:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-in-like-type-type-ref-to/m-p/3756446#M903680</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T10:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: difference in LIKE / TYPE /  TYPE REF TO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-in-like-type-type-ref-to/m-p/3756447#M903681</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;ABAP distinguishes between types and objects. Types are descriptions that do not occupy memory. Objects are instances of types, and do occupy their own memory space. A type describes the technical attributes of all of the objects with that type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the addition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE &amp;lt;type&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to refer to any data type &amp;lt;type&amp;gt; that is already known at this point in the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA &amp;lt;f&amp;gt; TYPE &amp;lt;type&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data object &amp;lt;f&amp;gt; has a data type corresponding to the type &amp;lt;type&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA &amp;lt;f&amp;gt; LIKE &amp;lt;obj&amp;gt;.&lt;/P&gt;&lt;P&gt;The data object &amp;lt;f&amp;gt; inherits all of the technical attributes of the data object &amp;lt;obj&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take an example :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types : begin of ty_tab,&lt;/P&gt;&lt;P&gt;name(30),&lt;/P&gt;&lt;P&gt;pwd(10),&lt;/P&gt;&lt;P&gt;end of ty_tab.&lt;/P&gt;&lt;P&gt;data : itab like ty_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See here we declared the structure of ty_tab, which do not occupy memory. So if we run this, we will get compile time error like this : Field TY_TAB is unknown. It is neither in one of the specified tables nor defined by a DATA statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in this case u need to correct the error with "TYPE" statement...like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types : begin of ty_tab,&lt;/P&gt;&lt;P&gt;name(30),&lt;/P&gt;&lt;P&gt;pwd(10),&lt;/P&gt;&lt;P&gt;end of ty_tab.&lt;/P&gt;&lt;P&gt;data : itab type ty_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer these&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Satish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 10:33:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-in-like-type-type-ref-to/m-p/3756447#M903681</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T10:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: difference in LIKE / TYPE /  TYPE REF TO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-in-like-type-type-ref-to/m-p/3756448#M903682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Maybe this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="477275"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=11067086&amp;amp;messageID=3653006" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=11067086&amp;amp;messageID=3653006&lt;/A&gt;&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;Kiran Sure&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 10:37:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-in-like-type-type-ref-to/m-p/3756448#M903682</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T10:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: difference in LIKE / TYPE /  TYPE REF TO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-in-like-type-type-ref-to/m-p/3756449#M903683</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;Type ref to ..... is used to create objects of class &lt;/P&gt;&lt;P&gt;data : object1 type ref to class1.&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 is type definition do not hold any data its just a structure..&lt;/P&gt;&lt;P&gt;types : begin of itab,&lt;/P&gt;&lt;P&gt;f1 type c,&lt;/P&gt;&lt;P&gt;f2 type c,&lt;/P&gt;&lt;P&gt;end of itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you can use TYPE not LIKE for this because this is just a structure.defining an internal table/ DATA OBJECT&lt;/P&gt;&lt;P&gt;data : it_itab TYPE STANDARD TABLE OF itab. "you are using type to structures&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now another table&lt;/P&gt;&lt;P&gt;data ITAB2 LIKE it_itab. "you can use LIKE to data Objects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can 't do like this&lt;/P&gt;&lt;P&gt;data itab2 like itab. "this is wrong&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type is generally used for declaring variables, parameters for existing data types in abap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ex: to declare a inter value and character variable of length 10 is as,&lt;/P&gt;&lt;P&gt;data: i1 type i,&lt;/P&gt;&lt;P&gt;c1(10) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like generally refers to existing data objects in abap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for ex:&lt;/P&gt;&lt;P&gt;data: matnr like mara-matnr,&lt;/P&gt;&lt;P&gt;vbeln like vbap-vbeln.&lt;/P&gt;&lt;P&gt;creating variables matnr, vbeln from existing fields of tables mara, vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when user creates a user defiend structure for work areas, internal tables we generally use type keyword as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of itab,&lt;/P&gt;&lt;P&gt;.........&lt;/P&gt;&lt;P&gt;.........&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;end of itab.&lt;/P&gt;&lt;P&gt;data: itab1 type itab occurs 0 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;*********&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go through the link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE - Type is used to tell the system what is the type of data object(variable) you want to create .&lt;/P&gt;&lt;P&gt;LIKE: If there is already a data object declared and you want to declare a similar data object you can just refer to the previous data object using like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this thread.&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=711746&amp;amp;messageID=2270752" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=711746&amp;amp;messageID=2270752&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=711746&amp;amp;messageID=512214" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=711746&amp;amp;messageID=512214&lt;/A&gt;&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;Vasu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 10:39:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-in-like-type-type-ref-to/m-p/3756449#M903683</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T10:39:40Z</dc:date>
    </item>
    <item>
      <title>Re: difference in LIKE / TYPE /  TYPE REF TO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-in-like-type-type-ref-to/m-p/3756450#M903684</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; &lt;U&gt;&lt;STRONG&gt;TYPE Addition&lt;/STRONG&gt;&lt;/U&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You use the TYPE addition in various ABAP statements for defining data types and specifying the types of interface parameters or field symbols.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Referring to Known Data Types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the addition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE &amp;lt;type&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to refer to any data type &amp;lt;type&amp;gt; that is already known at this point in the program. It can be used in any of the statements listed below. The expression &amp;lt;obj&amp;gt; is either the name of the data object or the expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Definition of local program types using &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TYPES &amp;lt;t&amp;gt; TYPE &amp;lt;type&amp;gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declaration of data objects using &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA &amp;lt;f&amp;gt; TYPE &amp;lt;type&amp;gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;U&gt;&lt;STRONG&gt;LIKE Addition&lt;/STRONG&gt;&lt;/U&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You use the LIKE addition, similarly to the TYP E addition , in various ABAP statements for defining data types and specifying the types of interface parameters or field symbols. The addition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIKE &amp;lt;obj&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can be used in the same ABAP statements as the TYPE addition to refer to any data object &amp;lt;obj&amp;gt; that is already visible at that point in the program. The expression &amp;lt;obj&amp;gt; is either the name of the data object or the expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;You use LIKE to make the new object or type inherit the technical attributes of an existing data object.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Definition of local types in a program using&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TYPES &amp;lt;t&amp;gt; LIKE &amp;lt;obj&amp;gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The new data type &amp;lt;t&amp;gt; inherits all of the technical attributes of the data object &amp;lt;obj&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declaration of data objects using &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA &amp;lt;f&amp;gt; LIKE &amp;lt;obj&amp;gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Objects&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Objects are instances of classes. Each object has a unique identity and its own attributes. All transient objects reside in the context of an internal session (memory area of an ABAP program). Persistent objects in the database are not yet available. A class can have any number of objects (instances). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Object References&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To access an object from an ABAP program, you use object references. Object references are pointers to objects. In ABAP, they are always contained in reference variables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Reference variables&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference variables contain references. A reference variable is either initial or contains a reference to an existing object. The identity of an object depends on its reference. A reference variable that points to an object knows the identity of that object. Users cannot access the identity of the object directly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reference variables in ABAP are treated like other elementary data objects. This means that a reference variable can occur as a component of a structure or internal table as well as on its own. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Data Types for References&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP contains a predefined data type for references, comparable to the data types for structures or internal tables. The full data type is not defined until the declaration in the ABAP program. The data type of a reference variable determines how the program handles its value (that is, the object reference). There are two principal types of references: Class references and interface references (see Interfaces). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You define class references using the &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... TYPE REF TO &amp;lt;class&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;data : cref type ref to class_name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;addition in the TYPES or DATA statement, where &amp;lt;class&amp;gt; refers to a class. A reference variable with the type class reference is called a class reference variable, or class reference for short. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A class reference &amp;lt;cref&amp;gt; allows a user to create an instance (object) of the corresponding class, and to address a visible component &amp;lt;comp&amp;gt; within it using the form&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cref-&amp;gt;comp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 12:55:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-in-like-type-type-ref-to/m-p/3756450#M903684</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-23T12:55:09Z</dc:date>
    </item>
    <item>
      <title>Re: difference in LIKE / TYPE /  TYPE REF TO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-in-like-type-type-ref-to/m-p/3756451#M903685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TYPE - defines data with a specific type defined in the data dictionary&lt;/P&gt;&lt;P&gt;LIKE - defines data to have the same type as another data object already defined, or in the data dictionary&lt;/P&gt;&lt;P&gt;TYPE REF TO - defines that the data is a reference to a more complex object - that could be some data, a class or an interface.  It's like a pointer to where the object is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Apr 2008 14:45:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-in-like-type-type-ref-to/m-p/3756451#M903685</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-04-23T14:45:32Z</dc:date>
    </item>
  </channel>
</rss>

