<?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: regarding execution time in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486977#M560985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Frank - I think this is is a problem for RANGES, not FOR ALL ENTRIES (at least in a DB2 or Oracle environment). I created a table with 500K entries and used it with FOR ALL ENTRIES and it didn't dump. I think the SAP kernel is better at translating FOR ALL ENTRIES for the database than it is for RANGES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Jul 2007 19:50:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-13T19:50:45Z</dc:date>
    <item>
      <title>regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486968#M560976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when i am executing this code, it takes a lot of time. even though i hav checked temp[] whether it is initial. But do i need to check ltap[] because the data has been collected from temp to ltap.Also temp has data and since no record matches the for all entries fetches all the data from ltak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT lt_temp[] IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LOOP AT lt_temp INTO ls_temp.&lt;/P&gt;&lt;P&gt;        COLLECT ls_temp INTO lt_ltap.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      FREE lt_temp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT lgnum                        "Warehouse Number&lt;/P&gt;&lt;P&gt;             tanum                        "Transfer order number&lt;/P&gt;&lt;P&gt;        FROM ltak&lt;/P&gt;&lt;P&gt;        INTO TABLE lt_ltak1&lt;/P&gt;&lt;P&gt;         FOR ALL ENTRIES IN lt_ltap&lt;/P&gt;&lt;P&gt;       WHERE lgnum EQ lt_ltap-lgnum&lt;/P&gt;&lt;P&gt;         AND tanum EQ lt_ltap-tanum&lt;/P&gt;&lt;P&gt;         AND trart EQ 'A'&lt;/P&gt;&lt;P&gt;          OR trart EQ 'X'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 13:01:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486968#M560976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T13:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486969#M560977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After the FREE statement, try:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SORT lt_ltap by lgnum tanum.
DELETE ADJACENT DUPLICATES FROM lt_ltap comparing lgnum tanum.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then do the SELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 13:17:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486969#M560977</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T13:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486970#M560978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it has been sorted afterwards.&lt;/P&gt;&lt;P&gt;do i need to check table ltap for initial since the select query doesnt match any condition and all the data from table ltak is being extracted which is taking a lot of time&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 13:30:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486970#M560978</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T13:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486971#M560979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to sort it before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is data in the original table, there will be data in the final table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 13:34:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486971#M560979</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T13:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486972#M560980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;but isnt it a rule that when u do for all entries for any table, that table has to be checked whether it is initial or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 13:49:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486972#M560980</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T13:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486973#M560981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have to know that there is data in the table. You checked the original table, so when you move data into the work table, there must be data there as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 14:08:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486973#M560981</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T14:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486974#M560982</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;From the look of your code it seems that your internal table is being built from LTAP (Transfer Order Item) , and then you are reading LTAK (TO Header), could you do a JOIN between LTAP and LTAK?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2007 14:20:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486974#M560982</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-10T14:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486975#M560983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;don'tdo like    looping   , collocting  , free ..etc .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just   write  2  select queries  using  FOR ALL ENTRIES   it will take  care of it   see.   i am using the sy-subrc  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*Select FOR ALL ENTRIES command
SELECT bukrs belnr gjahr bldat monat budat xblnr awtyp awkey
  UP TO 100 ROWS
  FROM bkpf
  INTO TABLE it_bkpf.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;IF sy-subrc EQ 0.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* The FOR ALL ENTRIES comand only retrieves data which matches
* entries within a particular internal table.
  SELECT bukrs belnr gjahr buzei mwskz umsks prctr hkont xauto koart
         dmbtr mwart hwbas aufnr projk shkzg kokrs
    FROM bseg
    INTO TABLE it_bseg
    FOR ALL ENTRIES IN it_bkpf
    WHERE bukrs EQ it_bkpf-bukrs AND
          belnr EQ it_bkpf-belnr AND
          gjahr EQ it_bkpf-gjahr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;lt;b&amp;gt;ENDIF.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward  points if it is usefull ...&lt;/P&gt;&lt;P&gt;Girish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2007 10:08:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486975#M560983</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-11T10:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486976#M560984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Besides all other points already mentioned here: Please keep in mind that the "FOR ALL ENTRIES IN" statement translates to the database as:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHERE TANUM = '111123454566' OR&lt;/P&gt;&lt;P&gt;             TANUM = '111123454567' OR&lt;/P&gt;&lt;P&gt;             TANUM = '111123454568' OR&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This makes only sense if your internal table lt_ltap contains just a handful of records. You can even get a runtime error as the length of the SQL statement created is limited (depending on the DB) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course I don't know what your program is supposed to do, but it might be smarter to check only against LGNUM (which are most likely just a few records) and do the checking for the TANUM in memory. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Frank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2007 14:55:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486976#M560984</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-12T14:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486977#M560985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Frank - I think this is is a problem for RANGES, not FOR ALL ENTRIES (at least in a DB2 or Oracle environment). I created a table with 500K entries and used it with FOR ALL ENTRIES and it didn't dump. I think the SAP kernel is better at translating FOR ALL ENTRIES for the database than it is for RANGES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2007 19:50:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486977#M560985</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-13T19:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486978#M560986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;that's quite amazing. I once created an itab with just 8K entries and the FOR ALL ENTRIES statement dumped on me - and this was a DB2 on a z390.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the max length of an SQL statement a system setting ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Frank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 08:52:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486978#M560986</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T08:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486979#M560987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As this is a code sample, make sure that your ENDIF is after the select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have all assumed that the problem is with the select, BUT the problem may be with the COLLECT. Have the definition of the LT_LTAP table consist only of the fields lgnum, tanum and an interger field. This way you eliminate your duplicates, quickly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MattG.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Jul 2007 12:16:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486979#M560987</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-16T12:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486980#M560988</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;Here collect statements takes very much time. So remove this and use any other technique to get your desired result instead of collect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful,&lt;/P&gt;&lt;P&gt;Aleem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2007 08:06:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486980#M560988</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-17T08:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486981#M560989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Frank - What was your error message?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 14:37:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486981#M560989</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T14:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: regarding execution time</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486982#M560990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First of all, please use the &amp;lt;b&amp;gt;Code&amp;lt;/b&amp;gt; button when you paste code. It makes it much easier to read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your problem is in your select statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT lgnum "Warehouse Number
       tanum "Transfer order number
FROM ltak
INTO TABLE lt_ltak1
FOR ALL ENTRIES IN lt_ltap
WHERE lgnum EQ lt_ltap-lgnum
AND tanum EQ lt_ltap-tanum
AND trart EQ 'A'
OR trart EQ 'X'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should be changed to&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT lgnum "Warehouse Number
       tanum "Transfer order number
FROM ltak
INTO TABLE lt_ltak1
FOR ALL ENTRIES IN lt_ltap
WHERE lgnum EQ lt_ltap-lgnum AND
      tanum EQ lt_ltap-tanum AND
      (    trart EQ 'A'
        OR trart EQ 'X' ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I always write ANDs at the right side and ORs at the left side of WHERE clauses to remind me that ORs start a new clause, while ANDs are a continuation of an existing clause - adding additional constraints.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by Kjetil Kilhavn:&lt;/P&gt;&lt;P&gt;But then again, I could of course be wrong. Perhaps you intend to select all entries where TRART = 'X' irrespective of the LGNUM and TANUM values. I don't think so, but if you do this on purpose you must expect poor performance since TRART is not an indexed field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2007 08:47:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-execution-time/m-p/2486982#M560990</guid>
      <dc:creator>KjetilKilhavn</dc:creator>
      <dc:date>2007-07-31T08:47:28Z</dc:date>
    </item>
  </channel>
</rss>

