<?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: Doubt in Basic ABAP. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-basic-abap/m-p/5455379#M1250197</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;All these below give you the same thing. IT basically a declaration for a structure type which can be used as type for internal table. However its better to use TYPE instead of LIKE according the latest conventions and also TYPE is acceptable in OO ABAP as against LIKE.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Types: Begin of ty_data,
matnr type mara-matnr,
end of ty_data.

Types: Begin of ty_data,
matnr type matnr,
end of ty_data.

Types: Begin of ty_data,
matnr like mara-matnr,
end of ty_data.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same is the case for the declaration as given below which declares varaibles of type matnr  i.e material number.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: matnr type mara-matnr.

data: matnr type matnr

data: matnr like mara-matnr

data: matnr like matnr.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mansi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Apr 2009 04:11:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-23T04:11:34Z</dc:date>
    <item>
      <title>Doubt in Basic ABAP.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-basic-abap/m-p/5455378#M1250196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a small doubt in basic ABAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the exact difference between the below statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Types: Begin of ty_data,&lt;/P&gt;&lt;P&gt;             matnr type mara-matnr,&lt;/P&gt;&lt;P&gt;          end of ty_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Types: Begin of ty_data,&lt;/P&gt;&lt;P&gt;             matnr type matnr,&lt;/P&gt;&lt;P&gt;          end of ty_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Types: Begin of ty_data,&lt;/P&gt;&lt;P&gt;             matnr like mara-matnr,&lt;/P&gt;&lt;P&gt;          end of ty_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Types: Begin of ty_data,&lt;/P&gt;&lt;P&gt;             matnr like matnr,&lt;/P&gt;&lt;P&gt;          end of ty_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: matnr type mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: matnr type matnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: matnr like mara-matnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: matnr like matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In those above statement which are correct. And the difference between those statements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Srihari.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 04:06:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-basic-abap/m-p/5455378#M1250196</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T04:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in Basic ABAP.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-basic-abap/m-p/5455379#M1250197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;All these below give you the same thing. IT basically a declaration for a structure type which can be used as type for internal table. However its better to use TYPE instead of LIKE according the latest conventions and also TYPE is acceptable in OO ABAP as against LIKE.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Types: Begin of ty_data,
matnr type mara-matnr,
end of ty_data.

Types: Begin of ty_data,
matnr type matnr,
end of ty_data.

Types: Begin of ty_data,
matnr like mara-matnr,
end of ty_data.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same is the case for the declaration as given below which declares varaibles of type matnr  i.e material number.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: matnr type mara-matnr.

data: matnr type matnr

data: matnr like mara-matnr

data: matnr like matnr.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mansi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 04:11:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-basic-abap/m-p/5455379#M1250197</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T04:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in Basic ABAP.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-basic-abap/m-p/5455380#M1250198</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 refers the existing data type &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like refers the existing data object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it will help u .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 04:47:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-basic-abap/m-p/5455380#M1250198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T04:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in Basic ABAP.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-basic-abap/m-p/5455381#M1250199</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;LIKE means the datatype of the variable is similar to the referenced variable.&lt;/P&gt;&lt;P&gt;&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;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;&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;P&gt;&lt;/P&gt;&lt;P&gt;Hope you understand and appreciate the flexibility that SAP provides to the programmers...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 05:06:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-basic-abap/m-p/5455381#M1250199</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T05:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt in Basic ABAP.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-basic-abap/m-p/5455382#M1250200</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;data: matnr type matnr.&lt;/P&gt;&lt;P&gt;Here you define matnr variable type matnr(data type) .&lt;/P&gt;&lt;P&gt;Matnr is a standard data element contains  Data Type  ' CHAR ' and   Length    ' 18 ' .   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: matnr like mara-matnr&lt;/P&gt;&lt;P&gt; here you are defining matnr variable which contain all the technical attributes of mara-matnr.&lt;/P&gt;&lt;P&gt;here you are giving data type to matnr w.r.t  mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Himanshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 06:22:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/doubt-in-basic-abap/m-p/5455382#M1250200</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T06:22:08Z</dc:date>
    </item>
  </channel>
</rss>

