<?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 Difference between Type and Like in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141793#M746747</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone tell me the basic difference between type and like in variable declaration?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Dec 2007 11:02:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-06T11:02:54Z</dc:date>
    <item>
      <title>Difference between Type and Like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141793#M746747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone tell me the basic difference between type and like in variable declaration?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 11:02:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141793#M746747</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-06T11:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Type and Like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141794#M746748</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;/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;&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;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 11:05:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141794#M746748</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-06T11:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Type and Like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141795#M746749</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;Refer this link&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="204025"&gt;&lt;/A&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;Re: LIKE &amp;amp; TYPE &lt;/P&gt;&lt;P&gt;Posted: Jul 23, 2007 6:18 AM in response to: Mohit Goel Reply &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HI&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)&lt;/P&gt;&lt;P&gt;For TYPE&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For LIKE&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/d3/2e974d35c511d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb367a358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb367a358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;LIKE means the datatype of the variable is similar to the referenced variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE means it is a predefined data type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg: &lt;/P&gt;&lt;P&gt;DATA int TYPE i.&lt;/P&gt;&lt;P&gt;Here int is of integer data type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA var LIKE int.&lt;/P&gt;&lt;P&gt;var IS a variable having same data type of int. which in turn is integer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find these helpful when you reference database table variables... You need not know what is the datatype defined. &lt;/P&gt;&lt;P&gt;Also it adds to FLEXIBILITY.&lt;/P&gt;&lt;P&gt;Whenever you make changes to your database tables and fields,&lt;/P&gt;&lt;P&gt;that change is REFLECTED back to your program that is,&lt;/P&gt;&lt;P&gt;You need not change all your program code when you change your table fields...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2)Passing the table using the TABLES parameters in a function module is one solution. However, using the IMPORT or CHANGING parameters is a better solution. Just create in the Dictionary a table type like your internal table to be able to TYPE your parameters. &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;rgds,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 11:06:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141795#M746749</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-06T11:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Type and Like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141796#M746750</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 is used to declare W.R.F to global field (EX. VBAK-VBELN) here u can not use like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIKE is used in declaring any object which is already created in program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex. DATA: &amp;lt;b&amp;gt;l_vbeln&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;TYPE&amp;lt;/b&amp;gt; vbak-vbelln.&lt;/P&gt;&lt;P&gt;     DATA: g_vbeln &amp;lt;b&amp;gt;LIKE&amp;lt;/b&amp;gt; &amp;lt;b&amp;gt;l_VBELN&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: LIKE is obsolete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 11:07:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141796#M746750</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-06T11:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Type and Like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141797#M746751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi gopi,&lt;/P&gt;&lt;P&gt;  The basic difference is in,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TYPE, you can assign datatype directly to the data object while declaring. But in&lt;/P&gt;&lt;P&gt;LIKE,you can assign the datatype of another object to the declaring data object. The datatype is referenced indirectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 11:12:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141797#M746751</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-06T11:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Type and Like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141798#M746752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Gopi,&lt;/P&gt;&lt;P&gt;       type will create structure,&lt;/P&gt;&lt;P&gt;       like uses existing field as reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data declared can hold values&lt;/P&gt;&lt;P&gt;but structure can't hold values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RULE:&lt;/P&gt;&lt;P&gt;type:  xxx  type  xxxx   define type&lt;/P&gt;&lt;P&gt;type:  xxx  like   xxxx   create type&lt;/P&gt;&lt;P&gt;data : xxx  type xxxx   define field&lt;/P&gt;&lt;P&gt;data : xxx  like  xxxx    create field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                       with Regards&lt;/P&gt;&lt;P&gt;                         muthu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 11:12:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141798#M746752</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-06T11:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Type and Like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141799#M746753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi gopi,&lt;/P&gt;&lt;P&gt; through type you can create variable of your liking format&lt;/P&gt;&lt;P&gt;eg data: temp(6) type c.&lt;/P&gt;&lt;P&gt;temp is a character of length 6&lt;/P&gt;&lt;P&gt;data: tt like temp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tt is another character with same format as of temp.&lt;/P&gt;&lt;P&gt;there is no much difference in the above example, but helps much when you create local structure of your own and need its more than one copy in a code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2007 11:30:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/3141799#M746753</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-06T11:30:26Z</dc:date>
    </item>
  </channel>
</rss>

