<?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: Data declaration in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453597#M1249901</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First one is the best approach as we should always prefer TYPE declaration instead of LIKE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Mar 2009 05:24:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-26T05:24:11Z</dc:date>
    <item>
      <title>Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453588#M1249892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guru's,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please advice which is da best amoung the below said. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally I feel more comfortable using the second one is there any problem using the second one??&lt;/P&gt;&lt;P&gt;Please let me know.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF typ_item,
matnr TYPE matnr,
werks TYPE werks_d,
END OF typ_item.
DATA: gt_item TYPE TABLE OF typ_item,
gs_item TYPE typ_item,
gt_where TYPE TABLE OF string.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: begin of itab occurs 0,
             matnr like mara-matnr,
             werks like marc-werks,
          end of itab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES : BEGIN OF typ_mara,
                 matnr type mara-matnr,
                werks type marc-werks,
            end of typ_mara.
data: typ_mara type table of mara with header line.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 04:57:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453588#M1249892</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T04:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453589#M1249893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1st one is the best...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 04:58:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453589#M1249893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T04:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453590#M1249894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you look it from performance point of view First one is the better option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can check the same from SE30 - tips and tricks in application toolbar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 05:00:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453590#M1249894</guid>
      <dc:creator>GauthamV</dc:creator>
      <dc:date>2009-03-26T05:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453591#M1249895</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;Methods 2 and 3 are obsolete statements which make use of internal tables with header line concept and are only for demo purposes.&lt;/P&gt;&lt;P&gt;Method 1 is latest way and can be implemented.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Methods 2 and 3 usage will give u Extended program check error in obsolete statements.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 05:02:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453591#M1249895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T05:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453592#M1249896</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;First one is the best approach.&lt;/P&gt;&lt;P&gt;Declare a type first.&lt;/P&gt;&lt;P&gt;Create an internal table without header line.&lt;/P&gt;&lt;P&gt;Instead of header line create a work area.&lt;/P&gt;&lt;P&gt;And use loop from internal table into work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tarun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 05:03:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453592#M1249896</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-03-26T05:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453593#M1249897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first one will give better performance than the remaining ones.&lt;/P&gt;&lt;P&gt;It will be performance drain if we work with internal tables having header lines.It will be better if we create one work area for that internal table and use that.&lt;/P&gt;&lt;P&gt;Also occurs 0 and header line statements may become obsolete in the upcoming versions.&lt;/P&gt;&lt;P&gt;Hope it will be useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lakshman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 05:04:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453593#M1249897</guid>
      <dc:creator>former_member209217</dc:creator>
      <dc:date>2009-03-26T05:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453594#M1249898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The data decalration preferably should be like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

Types: Begin of t_tab,
             field1 type c,
             field2 type c,
            End of t_tab.

Data: It_tab type standard table of t_tab,
         wa_tab type t_tab.

Then for fetching the data you can do like:

Loop at it_tab into wa_tab.

Endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&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;Mansi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 05:06:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453594#M1249898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T05:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453595#M1249899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;1st is the best option, since this is the way to declare the internal table as a local object, which further effects the performanance.&lt;/P&gt;&lt;P&gt;So use 1st only.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shashi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 05:12:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453595#M1249899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T05:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453596#M1249900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;first one is the best one &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and also if u use the internal table with header line u vll face some problems and lots of confusion&lt;/P&gt;&lt;P&gt;table and work area are shud be different to make it clear an easy to understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;second and third are obsolete now and can be used gives no performance issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its like goto wich is obsolete hope u got it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 05:22:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453596#M1249900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T05:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453597#M1249901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First one is the best approach as we should always prefer TYPE declaration instead of LIKE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 05:24:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453597#M1249901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T05:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453598#M1249902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;The first one is the best approach.&lt;/P&gt;&lt;P&gt;The other two appraches should not be used as they have become obsolete.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 05:59:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453598#M1249902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T05:59:20Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453599#M1249903</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;Thank you for your advice !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But normally I use the  second one and I feel more comfortable in it but now I would like to&lt;/P&gt;&lt;P&gt;change to first one. When I use &lt;STRONG&gt;like&lt;/STRONG&gt;  I fetch the records by using &lt;STRONG&gt;ALL ENTRIES&lt;/STRONG&gt; ,&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;APPENDING SECOND ITAB TO FIRST ITAB&lt;/STRONG&gt; , &lt;STRONG&gt;SELECT SINGLE&lt;/STRONG&gt; etc ....&lt;/P&gt;&lt;P&gt;my question is if Iam changing to second one will there be change in logical flow ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also please advice purpose of &lt;STRONG&gt;gt_where TYPE TABLE OF string&lt;/STRONG&gt; in the below said.&lt;/P&gt;&lt;P&gt;also advice me where is da headerline and pupose of declaring it seperately..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF typ_item,
matnr TYPE matnr,
werks TYPE werks_d,
END OF typ_item.

DATA: gt_item TYPE TABLE OF typ_item,
gs_item TYPE typ_item,
gt_where TYPE TABLE OF string.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Raj rockss on Mar 26, 2009 7:58 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 06:57:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453599#M1249903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T06:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453600#M1249904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second method is not preferable in the new version 6.0,&lt;/P&gt;&lt;P&gt;In the second option it will create you an internal table with header line,&lt;/P&gt;&lt;P&gt;so you while looping it you are not required to write:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;loop at itab into wa&lt;/STRONG&gt;,&lt;/P&gt;&lt;P&gt;you can only write:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

Your select query into itab.
 loop at itab.

Append second itab from first itab on some condition.

Endloop

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And  &lt;STRONG&gt;gt_where type table of string&lt;/STRONG&gt; will make &lt;/P&gt;&lt;P&gt;you an internal table gt_where without header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&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;Mansi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 07:08:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453600#M1249904</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T07:08:04Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453601#M1249905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;U should not use 2 nd and 3 rd one it is old now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Types: Begin of ls_tab,&lt;/P&gt;&lt;P&gt;             matnr type mara-matnr,&lt;/P&gt;&lt;P&gt;             mtart type mara-mtart,&lt;/P&gt;&lt;P&gt;            End of ls_tab.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Data: It_tab type standard table of ls_tab,&lt;/P&gt;&lt;P&gt;         wa_tab type ls_tab.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;then for processing use like &lt;/P&gt;&lt;P&gt;Loop at lt_tab into wa_tab.&lt;/P&gt;&lt;P&gt; logic&lt;/P&gt;&lt;P&gt;Endloop.&lt;/P&gt;&lt;P&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>Thu, 26 Mar 2009 08:12:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453601#M1249905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T08:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453602#M1249906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot  !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;miles to go before u sleep***&lt;/P&gt;&lt;P&gt;Raj ***&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 09:52:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453602#M1249906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T09:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Data declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453603#M1249907</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;Thank you !!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Mar 2009 09:53:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-declaration/m-p/5453603#M1249907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-26T09:53:59Z</dc:date>
    </item>
  </channel>
</rss>

