<?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 between types and like in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-types-and-like/m-p/3065886#M726504</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you define with TYPE it won&amp;#146;t have memory allocated. But define with data it will occupy some memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type is just like structure&lt;/P&gt;&lt;P&gt;Data is just like table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Siva Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Dec 2007 10:17:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-05T10:17:06Z</dc:date>
    <item>
      <title>difference between types and like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-types-and-like/m-p/3065884#M726502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i'm not getting a clear idea of difference between these statements.please help me out..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of itab,&lt;/P&gt;&lt;P&gt;          field1,&lt;/P&gt;&lt;P&gt;          field2,&lt;/P&gt;&lt;P&gt;        end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types : begin of itab,&lt;/P&gt;&lt;P&gt;          field1,&lt;/P&gt;&lt;P&gt;          field2,&lt;/P&gt;&lt;P&gt;        end of itab.&lt;/P&gt;&lt;P&gt;data : wa like mara.&lt;/P&gt;&lt;P&gt;data : t_ekbe     TYPE        TABLE OF ty_ekbe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2007 06:11:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-types-and-like/m-p/3065884#M726502</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-05T06:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: difference between types and like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-types-and-like/m-p/3065885#M726503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gourav,&lt;/P&gt;&lt;P&gt;When you are declaraing a varibale with DATA Memory will allocate for this,but when you are using TYPE statement only one type will create memory will not allocate for the type.&lt;/P&gt;&lt;P&gt;Hop dis is clear&lt;/P&gt;&lt;P&gt;Message Edited&lt;/P&gt;&lt;P&gt;shibu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2007 09:07:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-types-and-like/m-p/3065885#M726503</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-05T09:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: difference between types and like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-types-and-like/m-p/3065886#M726504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you define with TYPE it won&amp;#146;t have memory allocated. But define with data it will occupy some memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type is just like structure&lt;/P&gt;&lt;P&gt;Data is just like table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Siva Kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2007 10:17:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-types-and-like/m-p/3065886#M726504</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-05T10:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: difference between types and like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-types-and-like/m-p/3065887#M726505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;The main difference between TYPE and LIKE parameter when defining or declaring the object is that TYPE is used to refer existing DATA TYPE (elementary or structured or user defined) while LIKE is used to declare data objects with reference to existing DATA OBJECTS.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For all practical purposes there are the same. The only additional advantage with types is that you can define your own types(including complex ones) in the data dictionary and reuse them accross various programs. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But within a program if two variables are defined one using LIKE and another using TYPE, both referring to the same field, then there is no difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I include a type pool within a program, then I can define my variables only using TYPE to refer to any type defined in that pool. I cannot use LIKE in this scenario. Also, if I want to use native types like C, N, etc, I cannot use LIKE there either. I can use LIKE ABC only if ABC is in the database or if ABC is defined previously in the same program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can use TYPE ABC, if ABC is defined in database as a TYPE and included in the program with the statement TYPE-POOLS. I can use it, if it is the native types. I can use it, if it is already defined in the dictionary as a structure/table or structure/table field, or even if it is defined as a data element or a domain. So I can declare a variable V_BUKRS TYPE BUKRS, but I cannot define a variable V_BUKRS LIKE BUKRS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I intend to use V_BUKRS to store company code, I will prefer to declare it as V_BUKRS LIKE T001-BUKRS, only because if tomorrow for some reason, the definition of T001-BUKRS changes to a data element for example, BUKRS_N(say DEC 4) instead of the data element BUKRS(CHAR 4) that it refers to now, I don't have to change my programs because I am referring to the table field and inhereting its properties. Whereas, had I declared my V_BUKRS TYPE BUKRS and the table now changed to BUKRS_N, I will be forced to change my program as there will be a type incompatability. &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;Refer the links -&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3578565"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="2270752"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="655322"&gt;&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/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;LIKE is used inorder to refer to a present object and to have the semantic definition of that object that is being refered to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE is used in declaring the object using an elementary data type or a data element which has the same semantic definition that is required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is good practice to use TYPE as much as possible when there is a possibility to avoid LIKE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;TYPE&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. The TYPE addition can have various meanings depending on the syntax and context&amp;lt;/b&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;LIKE&lt;/P&gt;&lt;P&gt;You use the LIKE addition, similarly to 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;it 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.&amp;lt;/b&amp;gt;You use LIKE to make the new object or type inherit the technical attributes of an existing data object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The LIKE Addition:&lt;/P&gt;&lt;P&gt;You use the LIKE addition, similarly to the TYPE 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;LIKE &amp;lt;obj&amp;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;LINE OF &amp;lt;table-object&amp;gt;&lt;/P&gt;&lt;P&gt;In this case, the LIKE addition describes the line type of a table object that is visible at that point in the program.&lt;/P&gt;&lt;P&gt;You use LIKE to make the new object or type inherit the technical attributes of an existing data object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The TYPE Addition:&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. The TYPE addition can have various meanings depending on the syntax and context.&lt;/P&gt;&lt;P&gt;Referring to Known Data Types You can use the addition&lt;/P&gt;&lt;P&gt;TYPE &amp;lt;type&amp;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;LINE OF &amp;lt;table-type&amp;gt; In this case, the TYPE addition describes the line type of a table type &amp;lt;table-type&amp;gt; that is visible at that point in the program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3701261"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;use this links...&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;for like....&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/9b/239fa610de11d295390000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/9b/239fa610de11d295390000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Dec 2007 10:20:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-types-and-like/m-p/3065887#M726505</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-05T10:20:09Z</dc:date>
    </item>
  </channel>
</rss>

