<?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: Differance between Type &amp; Like in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/differance-between-type-like/m-p/2175900#M462115</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 while refering to the data types and types declared using types statement, where as LIKE is used to refer to the data objects.&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;TYPE means it is a predefined data type.&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/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&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;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;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;&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;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;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;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 May 2007 12:26:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-02T12:26:41Z</dc:date>
    <item>
      <title>Differance between Type &amp; Like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/differance-between-type-like/m-p/2175896#M462111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hye Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apart from the following differences what  are the other differences between these two statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 type is used for data type and like is used for ddic structures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What are the other differences??????????????&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Subodh G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2007 11:41:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/differance-between-type-like/m-p/2175896#M462111</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-02T11:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Differance between Type &amp; Like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/differance-between-type-like/m-p/2175897#M462112</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;1.&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;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;&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;Check this documentation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/frameset.htm&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;RK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2007 11:43:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/differance-between-type-like/m-p/2175897#M462112</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-02T11:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Differance between Type &amp; Like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/differance-between-type-like/m-p/2175898#M462113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;good,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer to following link:&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_47x200/helpdata/en/fc/eb3034358411d1829f0000e829fbfe/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3034358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Referring to Known Data Types&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. 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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Referring to Existing Technical Attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can create a variable that inherits exactly the same technical attributes as an existing data type or data object as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA &amp;lt;f&amp;gt; [TYPE &amp;lt;type&amp;gt;|LIKE &amp;lt;obj&amp;gt;]...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use the TYPE addition, &amp;lt;type&amp;gt; is any data type with fully-specified technical attributes. This can be a:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Non-generic predefined ABAP type (D, F, I, T, STRING, XSTRING) &lt;/P&gt;&lt;P&gt;Any existing local data type in the program. &lt;/P&gt;&lt;P&gt;Any ABAP Dictionary data type &lt;/P&gt;&lt;P&gt;If you use the LIKE addition, &amp;lt;obj&amp;gt; is a data object that has already been declared. This can also be a predefined data object. The variable &amp;lt;f&amp;gt; adopts the same technical attributes as the data object &amp;lt;obj&amp;gt;. You can also use LIKE to refer to a line of an internal table that has already been declared as a data object:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA &amp;lt;f&amp;gt; LIKE LINE OF &amp;lt;itab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To ensure compatibility with previous releases, &amp;lt;obj&amp;gt; can also be a database table, a view, a structure, or a component of a structure from the ABAP Dictionary. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jogdand M B&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jogdand M B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2007 11:47:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/differance-between-type-like/m-p/2175898#M462113</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-02T11:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Differance between Type &amp; Like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/differance-between-type-like/m-p/2175899#M462114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Subodh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this info.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Statements TYPES and DATA &lt;/P&gt;&lt;P&gt;Each ABAP program define its own data types using the statement.&lt;/P&gt;&lt;P&gt;TYPES dtype [TYPE type|LIKE dobj] ... &lt;/P&gt;&lt;P&gt;and declare its own variables or instance attributes of classes using the statement&lt;/P&gt;&lt;P&gt;DATA var [{TYPE type}|{LIKE dobj}] ...&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Within the program or a class, you can also define local data types and variables within procedures. Local variables in procedures obscure identically-named variables in the main program or class.&lt;/P&gt;&lt;P&gt;When creating data types and data objects, there are a number of naming convention that also apply for other local program definitions, such as procedures. These are described in detail in the keyword documentation.&lt;/P&gt;&lt;P&gt;The Additions TYPE and LIKE&lt;/P&gt;&lt;P&gt;The additions TYPE type and LIKE dobj are used in various ABAP statements. The additions can have various meanings, depending on the syntax and context.&lt;/P&gt;&lt;P&gt;&amp;#149;        Definition of local types in a program&lt;/P&gt;&lt;P&gt;&amp;#149;        Declaration of data objects&lt;/P&gt;&lt;P&gt;&amp;#149;        Dynamic creation of data objects&lt;/P&gt;&lt;P&gt;&amp;#149;        Specification of the type of formal parameters in subroutines&lt;/P&gt;&lt;P&gt;&amp;#149;        Specification of the type of formal parameters in methods&lt;/P&gt;&lt;P&gt;&amp;#149;        Specification of the type of field symbols&lt;/P&gt;&lt;P&gt;Constructing New Data Types&lt;/P&gt;&lt;P&gt;The TYPE addition allows you to construct new data types in the TYPES, DATA; CONSTANTS; and STATICSstatements. In the TYPES statement, these are local data types in the program. In the other statements, they are attributes of new data objects, meaning that the newly defined data types are not free-standing. Rather, they are linked to database objects.This means that you can refer to them using the LIKEaddition, but not using TYPE.&lt;/P&gt;&lt;P&gt;To construct new data types, the addition TYPE can be used with the following type constructors:&lt;/P&gt;&lt;P&gt;&amp;#149;        Construction of reference types&lt;/P&gt;&lt;P&gt;REF TO type|dobj&lt;/P&gt;&lt;P&gt;&amp;#149;        Construction of structured data types&lt;/P&gt;&lt;P&gt;BEGIN OF struc_type.&lt;/P&gt;&lt;P&gt;  ...&lt;/P&gt;&lt;P&gt;END OF struc_type.&lt;/P&gt;&lt;P&gt;&amp;#149;        Construction of table types&lt;/P&gt;&lt;P&gt;tabkind OF linetype [WITH key]&lt;/P&gt;&lt;P&gt;These data types only exist during the runtime of the ABAP program.&lt;/P&gt;&lt;P&gt;Referring to Known Data Types or Data Objects&lt;/P&gt;&lt;P&gt;Using the additions TYPE or LIKE in the TYPESstatement, local data types in a program can be referred to known data types or data objects. This is mainly the case with user-defined elementary data types. If you declare variables using the additions TYPE type or LIKE dobj with statement DATA, the data type of var is already fully defined before the declaration is made.&lt;/P&gt;&lt;P&gt;The known types or data that are referred to must be visible at the point where the data type or variable is declared. &lt;/P&gt;&lt;P&gt;A known data type can be any of the following:&lt;/P&gt;&lt;P&gt;&amp;#149;        A predefined ABAP type to which you refer using the TYPE addition&lt;/P&gt;&lt;P&gt;&amp;#149;        An existing local data type in the program to which you refer using the TYPE addition&lt;/P&gt;&lt;P&gt;&amp;#149;        The data type of a local data object in the program to which you refer using the LIKE addition&lt;/P&gt;&lt;P&gt;&amp;#149;        A data type in the ABAP Dictionary to which you refer using the TYPE addition. To ensure compatibility with earlier releases, it is still possible to use the LIKE addition to refer to database tables and flat structures in the ABAP Dictionary. However, you should use the TYPE addition in new programs.&lt;/P&gt;&lt;P&gt;The LIKE addition takes its technical attributes from a visible data object. As a rule, you can use LIKE to refer to any object that has been declared using DATA or a similar statement, and is visible in the current context.  The data object only has to have been declared. It is irrelevant whether the data object already exists in memory when you make the LIKE reference.&lt;/P&gt;&lt;P&gt;&amp;#149;        In principle, the local data objects in the same program are visible. As with local data types, there is a difference between local data objects in procedures and global data objects. Data objects defined in a procedure obscure other objects with the same name that are declared in the global declarations of the program.&lt;/P&gt;&lt;P&gt;&amp;#149;        You can also refer to the data objects of other visible ABAP programs. These might be, for example, the visible attributes of global classes in class pools. If a global class cl_lobal has a public instance attribute or static attribute attr, you can refer to it as follows in any ABAP program:&lt;/P&gt;&lt;P&gt;DATA dref TYPE REF TO cl_global.&lt;/P&gt;&lt;P&gt;DATA:  f1 LIKE cl_global=&amp;gt;attr,&lt;/P&gt;&lt;P&gt;       f2 LIKE dref-&amp;gt;attr.&lt;/P&gt;&lt;P&gt;You can access the technical properties of an instance attribute using the class name and a reference variable without first having to create an object. The properties of the attributes of a class are not instance-specific and belong to the static properties of the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF struct,&lt;/P&gt;&lt;P&gt;         number_1 TYPE i,&lt;/P&gt;&lt;P&gt;         number_2 TYPE p DECIMALS 2,&lt;/P&gt;&lt;P&gt;       END OF struct.&lt;/P&gt;&lt;P&gt;DATA:  wa_struct TYPE struct,&lt;/P&gt;&lt;P&gt;       number    LIKE wa_struct-number_2,&lt;/P&gt;&lt;P&gt;       date      LIKE sy-datum,&lt;/P&gt;&lt;P&gt;       time      TYPE t,&lt;/P&gt;&lt;P&gt;       text      TYPE string,&lt;/P&gt;&lt;P&gt;       company   TYPE s_carr_id.&lt;/P&gt;&lt;P&gt;This example declares variables with reference to the internal type STRUCT in the program, a component of an existing data object wa_struct, the predefined data object SY-DATUM, the predefined ABAP type t and STRING, and the data element S_CARR_ID from the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;Referring to Generic Data Types&lt;/P&gt;&lt;P&gt;If you refer to one of the generic predefined ABAP types of fixed length (c, n, p, x) in the TYPES or DATA statement, you must specify the undefined technical attributes.&lt;/P&gt;&lt;P&gt;TYPES|DATA var[(length)] TYPE type [DECIMALS dec]...&lt;/P&gt;&lt;P&gt;TYPES|DATA var TYPE type [LENGTH len] [DECIMALS dec]...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: text1,&lt;/P&gt;&lt;P&gt;      text2 LENGTH 2,&lt;/P&gt;&lt;P&gt;      text3 TYPE c LENGTH 3,&lt;/P&gt;&lt;P&gt;      pack TYPE p DECIMALS 2 VALUE '1.225'.&lt;/P&gt;&lt;P&gt;This example creates three character variables with field lengths of one, two, and three bytes respectively, and a packed number variable with field length 8 bytes and two decimal places. If the attribute Fixed point arithmetic is set, the value of pack is 1.23.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example shows how to declare elementary data objects with reference to predefined ABAP types.&lt;/P&gt;&lt;P&gt;PROGRAM demo_elementary_data_objects.&lt;/P&gt;&lt;P&gt;DATA text1  TYPE c LENGTH 20.&lt;/P&gt;&lt;P&gt;DATA text2  TYPE string.&lt;/P&gt;&lt;P&gt;DATA number TYPE i.&lt;/P&gt;&lt;P&gt;text1 = 'The number'.&lt;/P&gt;&lt;P&gt;number = 100.&lt;/P&gt;&lt;P&gt;text2 = 'is an integer.'.&lt;/P&gt;&lt;P&gt;WRITE: text1, number, text2.&lt;/P&gt;&lt;P&gt;This program produces the following output on the screen:&lt;/P&gt;&lt;P&gt;The number              100 is an integer.&lt;/P&gt;&lt;P&gt;In this example, the data objects text1, text2 and number are declared with the DATA statement. The technical attributes are determined by referring to the predefined ABAP types c, string, and I. Values from unnamed literals are assigned to the data objects. The contents of the named data objects are displayed on the list.&lt;/P&gt;&lt;P&gt;Specifying a Start Value&lt;/P&gt;&lt;P&gt;When you declare an elementary fixed-length variable, the DATAstatement automatically fills it with the type-specific initial value as listed in the table in the Predefined ABAP Types section.&lt;/P&gt;&lt;P&gt;However, you can also specify a starting value of a fixed-length elementary variable (also within a structure declaration) using the VALUE addition in the DATAstatement:&lt;/P&gt;&lt;P&gt;DATA var ... VALUE val|{IS INITIAL}.&lt;/P&gt;&lt;P&gt;Specifying start values:&lt;/P&gt;&lt;P&gt;DATA: counter TYPE p VALUE 1,&lt;/P&gt;&lt;P&gt;      date    TYPE d VALUE '19980601',&lt;/P&gt;&lt;P&gt;      flag    TYPE n VALUE IS INITIAL.&lt;/P&gt;&lt;P&gt;After this data declaration, the character string flag contains its type specific&lt;/P&gt;&lt;P&gt;Initial value &amp;#145;0&amp;#146;&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;Internal Tables &lt;/P&gt;&lt;P&gt;Internal tables are dynamic variable  data objects. Like all variables, you declare them using the DATA statement. &lt;/P&gt;&lt;P&gt;You can also declare static internal tables in procedures using the STATICSstatement, and static internal tables in classes using the CLASS-DATAstatement.&lt;/P&gt;&lt;P&gt; This description is restricted to the DATAstatement. However, it applies equally to the STATICS and CLASS-DATA statements.&lt;/P&gt;&lt;P&gt;Referring to Known Table Types&lt;/P&gt;&lt;P&gt;Like all other data objects, you can declare internal tables using the LIKE or TYPE addition of the DATA statement. &lt;/P&gt;&lt;P&gt;DATA itab TYPE type|LIKE obj [WITH HEADER LINE]. &lt;/P&gt;&lt;P&gt;Here, the LIKE addition refers to an existing table object in the same program. The TYPE addition can refer to an internal type in the program declared using the TYPES statement, or a table type in the ABAP Dictionary. &lt;/P&gt;&lt;P&gt;You must ensure that you only refer to tables that are fully typed. Referring to generic table types (ANY TABLE, INDEX TABLE) or not specifying the key fully is not allowed (for exceptions, refer to Special Features of Standard Tables).&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The WITH HEADER LINE addition is obsolete; you should no longer use it. Also see the keyword documentation.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;The optional addition WITH HEADER LINE declares an extra data object with the same name and line type as the internal table. This data object is known as the header line of the internal table. You use it as a work area when working with the internal table (see Using the Header Line as a Work Area). When you use internal tables with header lines, you must remember that the header line and the body of the table have the same name. If you have an internal table with header line and you want to address the body of the table, you must indicate this by placing brackets after the table name (itab[]). Otherwise, ABAP interprets the name as the name of the header line and not of the body of the table. You can avoid this potential confusion by using internal tables without header lines. In particular, internal tables nested in structures or other internal tables must not have a header line, since this can lead to ambiguous expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES vector TYPE SORTED TABLE OF i WITH UNIQUE KEY table_line.&lt;/P&gt;&lt;P&gt;DATA: itab TYPE vector,&lt;/P&gt;&lt;P&gt;      jtab LIKE itab WITH HEADER LINE.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MOVE itab TO jtab.   &amp;lt;-  Syntax error!&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;MOVE itab TO jtab[].&lt;/P&gt;&lt;P&gt;The table object itab is created with reference to the table type vector. The table object jtab has the same data type as itab. jtab also has a header line. In the first MOVE statement, jtab addresses the header line. Since this has the data type I, and the table type of itab cannot be converted into an elementary type, the MOVE statement causes a syntax error. The second MOVE statement is correct, since both operands are table objects.&lt;/P&gt;&lt;P&gt;Declaring New Internal Tables&lt;/P&gt;&lt;P&gt;You can use the DATA statement to construct new internal tables as well as using the LIKE or TYPEaddition to refer to existing types or objects. The table type that you construct does not exist in its own right; instead, it is only an attribute of the table object. You can refer to it using the LIKE addition, but not using TYPE. The syntax for constructing a table object in the DATA statement is similar to that for defining a table type in the TYPESstatement.&lt;/P&gt;&lt;P&gt;DATA itab TYPE|LIKE tabkind OF linetype WITH key&lt;/P&gt;&lt;P&gt;          [INITIAL SIZE n]&lt;/P&gt;&lt;P&gt;          [WITH HEADER LINE].&lt;/P&gt;&lt;P&gt;As illustrated when you define a table type yourself, the type constructor&lt;/P&gt;&lt;P&gt;tabkind OF linetype WITH key&lt;/P&gt;&lt;P&gt;defines the table type tabkind, the line type linetype, and the key key of the internal table itab. Since the technical attributes of data objects are always fully specified, the table must be fully specified in the DATAstatement. You cannot create generic table types (ANY TABLE, INDEX TABLE), only fully-typed tables (STANDARD TABLE and TABLE, SORTED TABLE, HASHED TABLE). You must also specify the key and whether it is to be unique (for exceptions, refer to Special Features of Standard Tables). &lt;/P&gt;&lt;P&gt;As in the TYPES statement, you can, if you wish, allocate an initial amount of memory to the internal table using the INITIAL SIZEaddition. You can create an internal table with a header line using the WITH HEADER LINE addition. The header line is created under the same conditions as apply when you refer to an existing table type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA itab TYPE HASHED TABLE OF spfli &lt;/P&gt;&lt;P&gt;          WITH UNIQUE KEY carrid connid.&lt;/P&gt;&lt;P&gt;The table object itab has the type hashed table, a line type corresponding to the flat structure SPFLI from the ABAP Dictionary, and a unique key with the key fields CARRID and CONNID. The internal table itab can be regarded as an internal template for the database table SPFLI. It is therefore particularly suitable for working with data from this database table as long as you only access it using the key.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this resolves your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward all the helpful answers.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2007 11:58:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/differance-between-type-like/m-p/2175899#M462114</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-02T11:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Differance between Type &amp; Like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/differance-between-type-like/m-p/2175900#M462115</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 while refering to the data types and types declared using types statement, where as LIKE is used to refer to the data objects.&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;TYPE means it is a predefined data type.&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/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/frameset.htm&lt;/A&gt;&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;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;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;&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;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;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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2007 12:26:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/differance-between-type-like/m-p/2175900#M462115</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-02T12:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Differance between Type &amp; Like</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/differance-between-type-like/m-p/2175901#M462116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi man&lt;/P&gt;&lt;P&gt;type is used for referencing the datatypes.&lt;/P&gt;&lt;P&gt;like is  used for referencing the data objects means variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if helpful rewards the points&lt;/P&gt;&lt;P&gt;thanks &lt;/P&gt;&lt;P&gt;kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 May 2007 12:34:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/differance-between-type-like/m-p/2175901#M462116</guid>
      <dc:creator>former_member223446</dc:creator>
      <dc:date>2007-05-02T12:34:54Z</dc:date>
    </item>
  </channel>
</rss>

