<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448886#M548705</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while declaring data we use statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE , FOR ,LIKE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please tell me the diff between them&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 30 Jun 2007 16:50:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-06-30T16:50:11Z</dc:date>
    <item>
      <title>Difference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448886#M548705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while declaring data we use statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE , FOR ,LIKE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please tell me the diff between them&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jun 2007 16:50:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448886#M548705</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-30T16:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Difference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448887#M548706</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 - 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;Rewards&lt;/P&gt;&lt;P&gt;Aneesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jun 2007 16:53:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448887#M548706</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-30T16:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Difference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448888#M548707</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;&amp;lt;b&amp;gt;TYPE&amp;lt;/b&amp;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. The TYPE addition can have various meanings depending on the syntax and context. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;LIKE&amp;lt;/b&amp;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;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;&amp;lt;b&amp;gt;FOR&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We use FOR statement for processing the selection table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Ashok reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jun 2007 18:49:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448888#M548707</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-06-30T18:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Difference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448889#M548708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not similar. Identical.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use LIKE e.g. when you declare a local copy of a parameter to a form. As far as I know SAP's recommendation is now to use LIKE when you want to ensure and indicate (to later program maintainers) that a data object is identical in type to another data object. The main point being that they are not &amp;lt;i&amp;gt;accidentally&amp;lt;/i&amp;gt; the same data type, it is deliberate (and thus usually important so you don't want things to change if someone changes the referred data object).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For everything else you should use TYPE, also in function module parameters. Previously you were forced to use LIKE for some of the function module parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR is not used to declare data, only to declare selection screen parameters (ranges).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2007 10:06:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448889#M548708</guid>
      <dc:creator>KjetilKilhavn</dc:creator>
      <dc:date>2007-07-02T10:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Difference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448890#M548709</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;Check this SAP help :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... TYPE REF TO type &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;... TYPE type &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;... LIKE f1 &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;FOR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We use FOR statement for processing the selection table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        skk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2007 10:10:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448890#M548709</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-02T10:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Difference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448891#M548710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;Hi, Basavraj 

&amp;lt;b&amp;gt;TYPE&amp;lt;/b&amp;gt; : it will allocate memory during execution (object type).
&amp;lt;b&amp;gt;Type will improve performance.&amp;lt;/b&amp;gt;

When we want to create a data object of an existing data type we use TYPE
E.g. DATA gv_var1 TYPE i. &amp;#147;Create a data object of type integer.

TYPES &amp;#150; When u want to create a data type and not an object.
TYPES : ty_int TYPE i. &amp;#147; ty_int is an integer type



&amp;lt;b&amp;gt;LIKE&amp;lt;/b&amp;gt; : it will allocate memory immediately.
When we declare a variable, with reference to some object in memory, we use LIKE.

When we have a data object and u want to create a similar data object. 
E.g.DATA gv_var2 LIKE gv_var1. &amp;#147;gv_var2 is an integer like gv_var1.


Whenever you need any internal table in your program which should have same fields as in a database table, we can declare the internal table 

Using LIKE addition.

DATA gt_itab LIKE &amp;lt;dbtab&amp;gt; WITH HEADER LINE.

But like addition is not recommended as a coding standard, and so is WITH HEADER LINE addition.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2007 11:43:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448891#M548710</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-02T11:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Difference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448892#M548711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LIKE only describes the characteristics of that field type.(default memory not allocated and cant store default values )&lt;/P&gt;&lt;P&gt;Type does the same and also we can store default values using type (ie....Default memory is allocated when we use type )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful. and close the thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jul 2007 04:33:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448892#M548711</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2007-07-06T04:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Difference</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448893#M548712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; in the program, then in the ABAP Dictionary for a database table or flat structure with the same name. You can no longer use this kind of type reference in ABAP Objects classes. You should also avoid using the LIKE addition in other ABAP programs except to refer to data objects. To refer to data types, you should use the TYPE addition instead. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward  points if it is usefull ..&lt;/P&gt;&lt;P&gt;Girish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jul 2007 05:38:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/difference/m-p/2448893#M548712</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-06T05:38:52Z</dc:date>
    </item>
  </channel>
</rss>

