<?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: type in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/type/m-p/3168212#M753789</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;type is refrence to directly data element....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like refers to the fields of the table means if the field defintion is chages then the variable refered with like is changed...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if useful....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Dec 2007 06:01:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-21T06:01:12Z</dc:date>
    <item>
      <title>type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type/m-p/3168211#M753788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what is difference between type and like?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2007 05:59:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type/m-p/3168211#M753788</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-21T05:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type/m-p/3168212#M753789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;type is refrence to directly data element....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like refers to the fields of the table means if the field defintion is chages then the variable refered with like is changed...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if useful....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2007 06:01:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type/m-p/3168212#M753789</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-21T06:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type/m-p/3168213#M753790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TYPE AND LIKE.....a very simple example....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: ch type string,&lt;/P&gt;&lt;P&gt;        ch1 like ch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e. like can be used refer the generic data objects (in the above example ch,ch1 are called data objects)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type is used for refer the predefined data types (in the above example string in the predefined data type) and abap dictionary objects.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2007 06:01:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type/m-p/3168213#M753790</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-21T06:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type/m-p/3168214#M753791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;TYPE&lt;/STRONG&gt; &amp;#150; When u want to create a data object of an existing data type E.g. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA gv_var1 TYPE i. &amp;#147;Create a data object of type integer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LIKE&lt;/STRONG&gt; - When u have a data object and u want to create a similar data object. E.g.&lt;/P&gt;&lt;P&gt;DATA gv_var2 LIKE gv_var1. &amp;#147;gv_var2 is an integer like gv_var1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;#147;LIKE&amp;#148; IS NOT RECOMMENDED FOR USE.&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES &amp;#150; When u want to create a data type and not an object.&lt;/P&gt;&lt;P&gt;TYPES ty_int TYPE i. &amp;#147; ty_int is an integer type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then u can use that as follows instead of INTEGER TYPE &amp;#145;I&amp;#146;.&lt;/P&gt;&lt;P&gt;DATA gv_var1 TYPE ty_int. &amp;#147;Create a data object of type integer.&lt;/P&gt;&lt;P&gt;By using &amp;#145;TYPES&amp;#146; we create a local data type in ABAP program; by using DATA we create a data object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose you want to have a variable of type integer &amp;#150; u can do this in 2 ways &amp;#150; &lt;/P&gt;&lt;P&gt;DATA gt_int TYPE i. &lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES ty_int TYPE i. &amp;#147; Creating a data type of type integer &lt;/P&gt;&lt;P&gt;DATA gt_int TYPE ty_int.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above example was just to make you understand what the TYPES statement do, it does not make sense to use TYPES for the above case though,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because you have an existing data type &amp;#145;I&amp;#146; for integer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use of TYPES&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using LIKE addition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA gt_itab LIKE &amp;lt;dbtab&amp;gt; WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But like addition is not recommended as a coding standard, and so is WITH HEADER LINE addition.&lt;/P&gt;&lt;P&gt;So what you should do is. &lt;/P&gt;&lt;P&gt;Define a data type using TYPES. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF ty_name,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Fields of database table &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Use this if u need only selected fields of database table in internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;which is the requirement in most cases&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name1 TYPE ad_name1,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name2 TYPE ad_name2,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;str_suppl1 TYPE ad_strspp1,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;str_suppl2 TYPE ad_strspp2,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;street TYPE ad_street,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;city1 TYPE ad_city1,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;post_code1 TYPE ad_pstcd1,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fax_number TYPE ad_fxnmbr1,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name_first TYPE ad_namefir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name_last TYPE ad_namelas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END OF ty_name.&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF ty_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Use this if you need all fields of a database table/structure&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;in your internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INCLUDE STRUCTURE &amp;lt;dbstruc&amp;gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES: END OF ty_name.&lt;/P&gt;&lt;P&gt;2. Declare an internal table object using the TYPE declared in step 1.&lt;/P&gt;&lt;P&gt;DATA: gt_itab TYPE TABLE OF ty_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Instead of header line in table, use a work area like a structure or a field symbol.&lt;/P&gt;&lt;P&gt;DATA: gs_wa TYPE ty_name. &amp;#147; Structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS : &amp;lt;fs_name&amp;gt; TYPE ty_name. &amp;#147; Field Symbol&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kanagaraja L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2007 06:15:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type/m-p/3168214#M753791</guid>
      <dc:creator>Kanagaraja_L</dc:creator>
      <dc:date>2007-12-21T06:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: type</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/type/m-p/3168215#M753792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;STRONG&gt;Srinath&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;  See this link.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="409783"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plzz Reward if useful,&lt;/P&gt;&lt;P&gt;Mahi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Dec 2007 06:45:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/type/m-p/3168215#M753792</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-21T06:45:13Z</dc:date>
    </item>
  </channel>
</rss>

