<?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 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/1859421#M362977</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The way you have declared is:&lt;/P&gt;&lt;P&gt;First stmt: is an internal table without a header line,&lt;/P&gt;&lt;P&gt;second stmt : is just a work area.&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>Fri, 12 Jan 2007 06:02:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-01-12T06:02:02Z</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/1859420#M362976</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;     Data it1_mara &amp;lt;b&amp;gt;like&amp;lt;/b&amp;gt; standard table of mara,&lt;/P&gt;&lt;P&gt;     Data it1_mara &amp;lt;b&amp;gt;type&amp;lt;/b&amp;gt; standard table of mara&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what's the diff b/w two statements?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bala.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jan 2007 05:57:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/1859420#M362976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-12T05:57:25Z</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/1859421#M362977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The way you have declared is:&lt;/P&gt;&lt;P&gt;First stmt: is an internal table without a header line,&lt;/P&gt;&lt;P&gt;second stmt : is just a work area.&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>Fri, 12 Jan 2007 06:02:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/1859421#M362977</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-12T06:02:02Z</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/1859422#M362978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bala,&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;-Priyanka.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jan 2007 06:04:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/1859422#M362978</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-12T06:04:45Z</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/1859423#M362979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bala,&lt;/P&gt;&lt;P&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;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 across 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 inheriting 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 incompatibility.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. try this code (just copy paste)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report abc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types : char50(50) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------" /&gt;&lt;P&gt; type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : d1 type c, "--- native&lt;/P&gt;&lt;P&gt;d2 type n, "--- native&lt;/P&gt;&lt;P&gt;d25 type char50 , "----&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; User defined data type&lt;/P&gt;&lt;P&gt;d3 type bukrs, "---- data element / domain&lt;/P&gt;&lt;P&gt;d4 type persno, "---- data element / domain&lt;/P&gt;&lt;P&gt;d5 type t001, "---- table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;d99 type c&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*l1 like c "----&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt; Not Allowed&lt;/P&gt;&lt;P&gt;*l2 like n "----&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt; Not Allowed&lt;/P&gt;&lt;P&gt;*l25 like char50 , "----&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; User defined data type&lt;/P&gt;&lt;P&gt;*l3 like bukrs "----&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt; Not Allowed&lt;/P&gt;&lt;P&gt;*l4 like persno, "----&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&lt;P&gt; Not Allowed&lt;/P&gt;&lt;P&gt;l5 like t001 , "---- table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l99 like pa0001&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the Best!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward Points if Useful!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the Best!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gokul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Jan 2007 06:06:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-type-and-like/m-p/1859423#M362979</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-12T06:06:27Z</dc:date>
    </item>
  </channel>
</rss>

