<?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 Help with TYPE and LIKE statements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927617#M940616</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI guys,&lt;/P&gt;&lt;P&gt;I know this is really novice stuff, but I am a little confused.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please explain the exact difference between TYPE and like with the help of a program, to understand it.&lt;/P&gt;&lt;P&gt;What situation would demand the use of each of the LIKE statement, since I can do all these things using the TYPE ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 May 2008 17:46:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-28T17:46:36Z</dc:date>
    <item>
      <title>Help with TYPE and LIKE statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927617#M940616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI guys,&lt;/P&gt;&lt;P&gt;I know this is really novice stuff, but I am a little confused.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone please explain the exact difference between TYPE and like with the help of a program, to understand it.&lt;/P&gt;&lt;P&gt;What situation would demand the use of each of the LIKE statement, since I can do all these things using the TYPE ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 17:46:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927617#M940616</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T17:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with TYPE and LIKE statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927618#M940617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer these Threads&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=12284497&amp;amp;messageID=5170193" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=12284497&amp;amp;messageID=5170193&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=12284497&amp;amp;messageID=5107643" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=12284497&amp;amp;messageID=5107643&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.sdn.sap.com/click.jspa?searchID=12284497&amp;amp;messageID=5315402" target="test_blank"&gt;https://forums.sdn.sap.com/click.jspa?searchID=12284497&amp;amp;messageID=5315402&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 17:50:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927618#M940617</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T17:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help with TYPE and LIKE statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927619#M940618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Akhil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type refers the existing data type &lt;/P&gt;&lt;P&gt;like refers the existing data object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type is a keyword used to refer to a data type whereas Like is a keyword used to copy the existing properties of already existing data object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check this thread.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5170193"&gt;&lt;/A&gt;&lt;/STRONG&gt;&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;Cheers,&lt;/P&gt;&lt;P&gt;Swamy Kunche&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 17:53:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927619#M940618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T17:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help with TYPE and LIKE statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927620#M940619</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;See this: [http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm] and &lt;SPAN __jive_macro_name="thread" id="409304"&gt;&lt;/SPAN&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, 28 May 2008 17:55:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927620#M940619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T17:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with TYPE and LIKE statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927621#M940620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Akhil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I summarized the info in SDN posts and SAP Help, to make it easier for you to understand. I also included some code snippets. Hope these prove to be helpful to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The following is from SAP Help:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;The Additions TYPE and LIKE&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&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;&lt;/P&gt;&lt;P&gt;·        Definition of local types in a program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        Declaration of data objects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        Dynamic creation of data objects&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        Specification of the type of formal parameters in subroutines&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        Specification of the type of formal parameters in methods&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        Specification of the type of field symbols&lt;/P&gt;&lt;P&gt;***************************************************************&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A known data type can be any of the following:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        A predefined ABAP type to which you refer using the TYPE addition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        An existing local data type in the program to which you refer using the TYPE addition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;·        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;&lt;/P&gt;&lt;P&gt;·        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;&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;&lt;/P&gt;&lt;P&gt;·        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;&lt;/P&gt;&lt;P&gt;·        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;&lt;/P&gt;&lt;P&gt;DATA dref TYPE REF TO cl_global.&lt;/P&gt;&lt;P&gt;&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;&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;Example&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;&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;&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;***********************&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The following info is from various posts:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; Type: It is used when userdefined object link with SAP system data type.&lt;/P&gt;&lt;P&gt;Local types mask global types that have the same names. When typing the interface parameters or field symbols, a reference is also possible to generic types ANY, ANY TABLE,INDEX TABLE, TABLE or STANDARD TABLE, SORTED TABLE and HASHED TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; Like: It is when data object link with the other data object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; TYPE, you assign datatype directly to the data object while declaring.&lt;/P&gt;&lt;P&gt;--&amp;gt; LIKE,you assign the datatype of another object to the declaring data object. The datatype is referenced indirectly.&lt;/P&gt;&lt;P&gt; you can refer to all visible data objects at the ABAP program's positon in question. Only the declaration of the data object must be known. In this case it is totally irrelevant whether the data object already exists physically in&lt;/P&gt;&lt;P&gt;memory during the LIKE reference. Local data objects mask global data objects that have the same name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; Type is a keyword used to refer to a data type whereas Like is a keyword used to copy the existing properties of already existing data object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Types: var1(20) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: var2 type var1. ( type is used bcoz var1 is defined with TYPES and it&lt;/P&gt;&lt;P&gt;does not occupy any memory spce.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: var3 like var2. ( like is used here bcoz var2 is defined with DATA&lt;/P&gt;&lt;P&gt;so it does occupy space in memory ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: material like mara-matnr. ( like is used here bcoz mara-matnr is stored in memory)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--&amp;gt; Type refers the existing data type&lt;/P&gt;&lt;P&gt;--&amp;gt; Like refers the existing data object&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;Please Reward Points if any of the above points are helpful to you.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kalyan Chakravarthy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 18:09:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927621#M940620</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T18:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help with TYPE and LIKE statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927622#M940621</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;This is an explanation of differences between TYPE and LIKE additions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type: It is used when userdefined object link with SAP&lt;/P&gt;&lt;P&gt;system data type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like: It is when data object link with the other data&lt;/P&gt;&lt;P&gt;object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE, you assign datatype directly to the data object while declaring.&lt;/P&gt;&lt;P&gt;LIKE,you assign the datatype of another object to the declaring data object. The datatype is referenced indirectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Type is a keyword used to refer to a data type whereas Like is a keyword used to copy the existing properties of already existing data object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional key words&lt;/P&gt;&lt;P&gt;Data types, data objects, ABAP type concept, Dictionary reference&lt;/P&gt;&lt;P&gt;Cause and prerequisites&lt;/P&gt;&lt;P&gt;The ABAP type concept distinguishes between data types and data objects.&lt;/P&gt;&lt;P&gt;o Data types are either defined locally in an ABAP program with TYPES&lt;/P&gt;&lt;P&gt;or globally in the ABAP Dictionary.&lt;/P&gt;&lt;P&gt;o Data objects reside in the internal mode of an ABAP program and are&lt;/P&gt;&lt;P&gt;declared prototypical with the statement DATA.&lt;/P&gt;&lt;P&gt;When you declare local program data types with TYPES or data objects with&lt;/P&gt;&lt;P&gt;DATA, the data type must be defined. To do this you can refer to already&lt;/P&gt;&lt;P&gt;existing types in addition to using type constructors, for example, TYPE&lt;/P&gt;&lt;P&gt;TABLE OF or TYPE REF TO. It is possible to refer to data types using the&lt;/P&gt;&lt;P&gt;TYPE addition and the data object using the LIKE addition. Furthermore,&lt;/P&gt;&lt;P&gt;type references are possible using TYPE and LIKE also during typing&lt;/P&gt;&lt;P&gt;interface parameters or field symbols.&lt;/P&gt;&lt;P&gt;o TYPE addition&lt;/P&gt;&lt;P&gt;With TYPE addition, you can refer either to local data types of the&lt;/P&gt;&lt;P&gt;same ABAP program or on global data types of the Dictionaries.&lt;/P&gt;&lt;P&gt;Local types mask global types that have the same names. When typing&lt;/P&gt;&lt;P&gt;the interface parameters or field symbols, a reference is also&lt;/P&gt;&lt;P&gt;possible to generic types ANY, ANY TABLE,INDEX TABLE, TABLE or&lt;/P&gt;&lt;P&gt;STANDARD TABLE, SORTED TABLE and HASHED TABLE.&lt;/P&gt;&lt;P&gt;o The LIKE addition&lt;/P&gt;&lt;P&gt;With the LIKE addition, you can refer to all visible data objects&lt;/P&gt;&lt;P&gt;at the ABAP program's positon in question. Only the declaration of&lt;/P&gt;&lt;P&gt;the data object must be known. In this case it is totally&lt;/P&gt;&lt;P&gt;irrelevant whether the data object already exists physically in&lt;/P&gt;&lt;P&gt;memory during the LIKE reference. Local data objects mask global&lt;/P&gt;&lt;P&gt;data objects that have the same name.&lt;/P&gt;&lt;P&gt;The semantic separation between data types and data objects is reflected by&lt;/P&gt;&lt;P&gt;the syntactic separation in ABAP between TYPE and LIKE. This separation&lt;/P&gt;&lt;P&gt;allows for separate namespaces for data types and data objects. Only for&lt;/P&gt;&lt;P&gt;reasons of compatibility with preceding releases, can you refer to flat&lt;/P&gt;&lt;P&gt;structures (see note 176336) in the ABAP Dictionary with the LIKE addition,&lt;/P&gt;&lt;P&gt;so to database tables and independent flat structures. The LIKE addition&lt;/P&gt;&lt;P&gt;first finds a data object on the local program and then in the ABAP&lt;/P&gt;&lt;P&gt;Dictionary it finds a database table or flat structure that has the same&lt;/P&gt;&lt;P&gt;name. The type reference on the ABAP Dictionary is no longer possible with&lt;/P&gt;&lt;P&gt;LIKE in the class of ABAP objects. In all ABAP programs, the LIKE reference&lt;/P&gt;&lt;P&gt;25.06.2007 Page 2 of 2&lt;/P&gt;&lt;P&gt;Note 176337 - On the difference between TYPE and LIKE&lt;/P&gt;&lt;P&gt;is forbidden on data elements, internal tables and deep structures of the&lt;/P&gt;&lt;P&gt;ABAP Dictionary.&lt;/P&gt;&lt;P&gt;The TYPE reference to global data types of the ABAP Dictionary is possible&lt;/P&gt;&lt;P&gt;as of Release 4.5. At the same time all types of the ABAP type concept can&lt;/P&gt;&lt;P&gt;be defined in the ABAP Dictionary as of Release 4.5. Previously there was&lt;/P&gt;&lt;P&gt;only an actual equivalent for flat structures between the ABAP data types&lt;/P&gt;&lt;P&gt;and the dictionary data types. The structure of database tables and&lt;/P&gt;&lt;P&gt;independent structures corresponded to the ABAP data type structure in the&lt;/P&gt;&lt;P&gt;dictionary Only with the LIKE addition could database tables and structures&lt;/P&gt;&lt;P&gt;be referred to from ABAP programs. In the meantime the LIKE addition should&lt;/P&gt;&lt;P&gt;be used in all ABAP programs only for referring to data objects while the&lt;/P&gt;&lt;P&gt;TYPE addition is used of the reference to the data type.&lt;/P&gt;&lt;P&gt;Caution should be taken if a flat structure is changed in the dictionary by&lt;/P&gt;&lt;P&gt;adding or changing a component into a deep structure. Then a reference with&lt;/P&gt;&lt;P&gt;the LIKE reference is syntactically no longer possible and the ABAP&lt;/P&gt;&lt;P&gt;programs must be changed appropriately. As outlined in Note 176336, such a&lt;/P&gt;&lt;P&gt;structure change means more than replacing the LIKE with the TYPE addition.&lt;/P&gt;&lt;P&gt;Moreover the use of the structure must also be checked at other positions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please check the links :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://219.153.41.162/down4/20070625/25135751683.pdf" target="test_blank"&gt;http://219.153.41.162/down4/20070625/25135751683.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://techpreparation.com/computer-interview-questions/sap-abap-interview-questions-" target="test_blank"&gt;http://techpreparation.com/computer-interview-questions/sap-abap-interview-questions-&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb2ff3358411d1829f0000e829fbfe/content.htm&lt;/A&gt; -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if found useful,,,,,,,,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sandeep Reddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 May 2008 19:02:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927622#M940621</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-28T19:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help with TYPE and LIKE statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927623#M940622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Akhil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand that u are new to SAP and trying to explain it in bit simpler manner.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We use TYPE when we are refering to any object TYPE. (May be standard ones like C,P,I,N,F or user defiended TYPES using the TYPES clause)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We use LIKE, when we declare a variable or data object refering to an existing data object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declaring user defined TYPE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES:BEGIN OF ty_mara,&lt;/P&gt;&lt;P&gt;                matnr TYPE mara-matnr,&lt;/P&gt;&lt;P&gt;            END OF ty_mara.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Declaring Data Object using TYPE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: wa_mara TYPE ty_mara.     "via User defined TYPE&lt;/P&gt;&lt;P&gt;          w_matnr  TYPE C.               "via standard TYPE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declaring Data Object using TYPE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: wa_mara2 LIKE wa_mara.  "via existing data object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2008 02:51:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927623#M940622</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-29T02:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help with TYPE and LIKE statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927624#M940623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TYPE: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For referring to the data types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA var1 TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LIKE:&lt;/P&gt;&lt;P&gt;For referring to the exisiting data objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA var2 LIKE var1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hakim&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2008 03:22:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927624#M940623</guid>
      <dc:creator>abdul_hakim</dc:creator>
      <dc:date>2008-05-29T03:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help with TYPE and LIKE statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927625#M940624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;Thanks for your prompt responses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess i needed to be more complete in my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand the basic difference between these that declaration using &lt;/P&gt;&lt;P&gt;DATA corresponds to LIKE&lt;/P&gt;&lt;P&gt;and TYPES corresponds to TYPE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My confusion is that, I have seen real time people use LIKE statements even if its possible to use TYPES, for example, while declaring structures at the start of a report..&lt;/P&gt;&lt;P&gt;I need to know if there are any specific situations (except PARAMETERS) whre only LIKE would to be used and not TYPE.&lt;/P&gt;&lt;P&gt;Is it just to improve the program readability?&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;Akhil&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: akhil patel on May 29, 2008 7:42 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 May 2008 17:42:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-with-type-and-like-statements/m-p/3927625#M940624</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-29T17:42:11Z</dc:date>
    </item>
  </channel>
</rss>

