<?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 Declaring variables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-declaring-variables/m-p/1483321#M225896</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer the following 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="655322"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Aug 2006 15:13:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-25T15:13:00Z</dc:date>
    <item>
      <title>Difference between Declaring variables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-declaring-variables/m-p/1483319#M225894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Consider three cases :&lt;/P&gt;&lt;P&gt;1.g_table1 like sscrfields,&lt;/P&gt;&lt;P&gt;2.g_table2 type sscrfields,&lt;/P&gt;&lt;P&gt;3.g_table3 type ref to sscrfields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the difference between &amp;lt;b&amp;gt;like&amp;lt;/b&amp;gt; , &amp;lt;b&amp;gt;type&amp;lt;/b&amp;gt; and &amp;lt;b&amp;gt;type ref&amp;lt;/b&amp;gt; statements ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Illustrate with examples.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Aug 2006 15:10:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-declaring-variables/m-p/1483319#M225894</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-25T15:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Declaring variables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-declaring-variables/m-p/1483320#M225895</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;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.&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;Ashok&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Aug 2006 15:12:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-declaring-variables/m-p/1483320#M225895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-25T15:12:20Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Declaring variables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-declaring-variables/m-p/1483321#M225896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer the following 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="655322"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Aug 2006 15:13:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-declaring-variables/m-p/1483321#M225896</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-25T15:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Declaring variables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-declaring-variables/m-p/1483322#M225897</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;Check this SAP help :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;... TYPE REF TO type&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Defining a typed data reference variable. Types you can use include elementary types, types defined using TYPES, or types created in the ABAP Dictionary. You can dereference completely typed data reference variables using the dereferencing operator -&amp;gt;* at any operand position. &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;types: &lt;/P&gt;&lt;P&gt;  LNTYP  type I. &lt;/P&gt;&lt;P&gt;data: &lt;/P&gt;&lt;P&gt;  CNT    type ref to I, &lt;/P&gt;&lt;P&gt;  LINE   type ref to LNTYP, &lt;/P&gt;&lt;P&gt;  FLIGHT type ref to SFLIGHT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create data CNT. &lt;/P&gt;&lt;P&gt;create data LINE. &lt;/P&gt;&lt;P&gt;create data FLIGHT. &lt;/P&gt;&lt;P&gt;CNT-&amp;gt;*  =  20. &lt;/P&gt;&lt;P&gt;LINE-&amp;gt;* = 110. &lt;/P&gt;&lt;P&gt;FLIGHT-&amp;gt;FLDATE = SY-DATUM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;... TYPE type&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The field f is created with type type. For the type, you can specify either one of the predefined types listed below, a type defined using the TYPES statement, or a type created in the ABAP Dictionary. &lt;/P&gt;&lt;P&gt;The standard length ( SL ) of a field depends on its type. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type        Explanation         SL   Initial value &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;C    Text (Character)        1      space &lt;/P&gt;&lt;P&gt;N    Numeric text            1      '00...0' &lt;/P&gt;&lt;P&gt;D    Date (YYYYMMDD)         8      '00000000' &lt;/P&gt;&lt;P&gt;T    Time (HHMMSS)           6      '000000' &lt;/P&gt;&lt;P&gt;X    Hexadecimal (HeX code)  1      X'00' &lt;/P&gt;&lt;P&gt;I    Integer                 4      0 &lt;/P&gt;&lt;P&gt;P    Packed number           8      0 &lt;/P&gt;&lt;P&gt;F    Floating point number   8      0 &lt;/P&gt;&lt;P&gt;STRING Character sequence (string)  variable-length empty string &lt;/P&gt;&lt;P&gt;XSTRING Byte sequence (X string) &lt;/P&gt;&lt;P&gt;variable-length empty hexadecimal string &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;DATA NUMBER TYPE I. &lt;/P&gt;&lt;P&gt;DATA WA_SPFLI TYPE SPFLI. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field NUMBER is created with type I. You can now use it in the program. In particular, you can assign numeric values to the field and use it in calculations ( ABAP number types). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field WA_SPFLI is created using the type of the database table SPFLI from the ABAP Dictionary. This field is structured and can be used especially for working with data from database table SPFLI. &lt;/P&gt;&lt;P&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 f1&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See Cannot Use LIKE References to Dictionary Types. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Field f is created with the same field attribtues as the data object f1, which has already been declared. Any data object (field, parameter, structure...) is allowed as long as its type has been fully specified. &lt;/P&gt;&lt;P&gt;f1 can be any ABAP Dictionary reference. &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;DATA TABLE_INDEX LIKE SY-TABIX. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The field TABLE_INDEX now has the same attributes as SY-TABIX (index field for internal tables). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;You should use this addition whenever you can. If the type of a field to which you are referring changes, the ABAP runtime system updates all references automatically. It also stops the system from carrying out unnecessry (and maybe undesirable) type conversions. &lt;/P&gt;&lt;P&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;Appana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Aug 2006 15:16:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-declaring-variables/m-p/1483322#M225897</guid>
      <dc:creator>Laxmana_Appana_</dc:creator>
      <dc:date>2006-08-25T15:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Difference between Declaring variables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-declaring-variables/m-p/1483323#M225898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt; Welcome to SDN...&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="655322"&gt;&lt;/A&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="512214"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Aug 2006 15:32:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference-between-declaring-variables/m-p/1483323#M225898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-25T15:32:55Z</dc:date>
    </item>
  </channel>
</rss>

