<?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: Performance issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3761683#M904992</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of inner joins, you can use 'for all entries', that will increase the performance. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;If the addition FOR ALL ENTRIES is specified before the language element WHERE, then the components comp of the internal table itab can be used as operands when comparing with relational operators. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table itab must have a structured line type and the component comp must be compatible with the column col. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logical expression sql_cond of the WHERE condition can comprise various logical expressions by using AND and OR. However, if FOR ALL ENTRIES is specified, there must be at least one Comparison with a column of the internal table itab, which can be specified either statistically or dynamically (Release 6.40 and higher). In a statement with a SELECTstatement with FOR ALL ENTRIES, the addition ORDER BY can only be used with the addition PRIMARY KEY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The whole logical expression sql_cond is evaluated for each individual line of the internal table itab. The resulting set of the SELECT statement is the union of the resulting sets from the individual evaluations. Duplicate lines are automatically removed from the resulting set. If the internal table itab is empty, the whole WHERE statement is ignored and all lines in the database are put in the resulting set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;In Release 6.10 and higher, the same internal table can be specified after FOR ALL ENTRIES and after INTO. &lt;/P&gt;&lt;P&gt;The addition FOR ALL ENTRIES is only possible before WHERE conditions of the SELECT statement. &lt;/P&gt;&lt;P&gt;If the additions PACKAGE SIZE or UP TO n ROWS are specified together with FOR ALL ENTRIES, they are not passed to the database system but are applied instead to the resulting set once all selected rows on the application server have been imported. &lt;/P&gt;&lt;P&gt;With duplicated rows in the resulting set, the addition FOR ALL ENTRIES has the same effect as if addition DISTINCT were specified in the definition of the selection quantity. Unlike DISTINCT, the rows are not deleted from the database system but are deleted on the application server from the resulting set. &lt;/P&gt;&lt;P&gt;Addition FOR ALL ENTRIES is only possible for WHERE conditions of the SELECT statement. &lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Exporting all flight data for a specified departure city. The relevant airlines and flight numbers are first put in an internal table entry_tab, which is evaluated in the WHERE condition of the subsquent SELECT statement. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

PARAMETERS p_city TYPE spfli-cityfrom. 

TYPES: BEGIN OF entry_tab_type, 
         carrid TYPE spfli-carrid, 
         connid TYPE spfli-connid, 
       END OF entry_tab_type. 

DATA: entry_tab   TYPE TABLE OF entry_tab_type, 
      sflight_tab TYPE SORTED TABLE OF sflight 
                       WITH UNIQUE KEY carrid connid fldate. 

SELECT carrid connid 
       FROM spfli 
       INTO CORRESPONDING FIELDS OF TABLE entry_tab 
       WHERE cityfrom = p_city. 

SELECT carrid connid fldate 
       FROM sflight 
       INTO CORRESPONDING FIELDS OF TABLE sflight_tab 
       FOR ALL ENTRIES IN entry_tab 
       WHERE carrid = entry_tab-carrid AND 
             connid = entry_tab-connid. 


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 May 2008 09:46:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-02T09:46:00Z</dc:date>
    <item>
      <title>Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3761682#M904991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I improve the performance of below select statement?&lt;/P&gt;&lt;P&gt;Please help...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT a&lt;SUB&gt;aufnr a&lt;/SUB&gt;objnr a&lt;SUB&gt;auart a&lt;/SUB&gt;txjcd a~pspel&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;gstrp a&lt;/SUB&gt;werks c&lt;SUB&gt;arbpl c&lt;/SUB&gt;werks &lt;/P&gt;&lt;P&gt;INTO TABLE t_caufv&lt;/P&gt;&lt;P&gt;FROM caufv AS a&lt;/P&gt;&lt;P&gt;INNER JOIN afih AS b&lt;/P&gt;&lt;P&gt;ON a&lt;SUB&gt;aufnr = b&lt;/SUB&gt;aufnr&lt;/P&gt;&lt;P&gt;INNER JOIN crhd AS c&lt;/P&gt;&lt;P&gt;ON b&lt;SUB&gt;gewrk = c&lt;/SUB&gt;objid&lt;/P&gt;&lt;P&gt;AND c~objty = 'D'&lt;/P&gt;&lt;P&gt;WHERE ( a~pspel = space&lt;/P&gt;&lt;P&gt;OR a~txjcd = space&lt;/P&gt;&lt;P&gt;OR NOT a~objnr IN&lt;/P&gt;&lt;P&gt;( select OBJNR from COBRB AS e&lt;/P&gt;&lt;P&gt;WHERE objnr = a~objnr ) )&lt;/P&gt;&lt;P&gt;AND a~werks IN s_plant&lt;/P&gt;&lt;P&gt;AND a~auart IN s_wtype&lt;/P&gt;&lt;P&gt;AND NOT a~objnr IN&lt;/P&gt;&lt;P&gt;( select OBJNR from JEST AS d&lt;/P&gt;&lt;P&gt;WHERE objnr = a~objnr&lt;/P&gt;&lt;P&gt;AND ( d&lt;SUB&gt;stat = 'A0081'OR d&lt;/SUB&gt;stat = 'A0018' ) &lt;/P&gt;&lt;P&gt;AND d~inact 'X' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Amminesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 09:43:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3761682#M904991</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T09:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3761683#M904992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of inner joins, you can use 'for all entries', that will increase the performance. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;If the addition FOR ALL ENTRIES is specified before the language element WHERE, then the components comp of the internal table itab can be used as operands when comparing with relational operators. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The internal table itab must have a structured line type and the component comp must be compatible with the column col. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logical expression sql_cond of the WHERE condition can comprise various logical expressions by using AND and OR. However, if FOR ALL ENTRIES is specified, there must be at least one Comparison with a column of the internal table itab, which can be specified either statistically or dynamically (Release 6.40 and higher). In a statement with a SELECTstatement with FOR ALL ENTRIES, the addition ORDER BY can only be used with the addition PRIMARY KEY. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The whole logical expression sql_cond is evaluated for each individual line of the internal table itab. The resulting set of the SELECT statement is the union of the resulting sets from the individual evaluations. Duplicate lines are automatically removed from the resulting set. If the internal table itab is empty, the whole WHERE statement is ignored and all lines in the database are put in the resulting set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;In Release 6.10 and higher, the same internal table can be specified after FOR ALL ENTRIES and after INTO. &lt;/P&gt;&lt;P&gt;The addition FOR ALL ENTRIES is only possible before WHERE conditions of the SELECT statement. &lt;/P&gt;&lt;P&gt;If the additions PACKAGE SIZE or UP TO n ROWS are specified together with FOR ALL ENTRIES, they are not passed to the database system but are applied instead to the resulting set once all selected rows on the application server have been imported. &lt;/P&gt;&lt;P&gt;With duplicated rows in the resulting set, the addition FOR ALL ENTRIES has the same effect as if addition DISTINCT were specified in the definition of the selection quantity. Unlike DISTINCT, the rows are not deleted from the database system but are deleted on the application server from the resulting set. &lt;/P&gt;&lt;P&gt;Addition FOR ALL ENTRIES is only possible for WHERE conditions of the SELECT statement. &lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Exporting all flight data for a specified departure city. The relevant airlines and flight numbers are first put in an internal table entry_tab, which is evaluated in the WHERE condition of the subsquent SELECT statement. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

PARAMETERS p_city TYPE spfli-cityfrom. 

TYPES: BEGIN OF entry_tab_type, 
         carrid TYPE spfli-carrid, 
         connid TYPE spfli-connid, 
       END OF entry_tab_type. 

DATA: entry_tab   TYPE TABLE OF entry_tab_type, 
      sflight_tab TYPE SORTED TABLE OF sflight 
                       WITH UNIQUE KEY carrid connid fldate. 

SELECT carrid connid 
       FROM spfli 
       INTO CORRESPONDING FIELDS OF TABLE entry_tab 
       WHERE cityfrom = p_city. 

SELECT carrid connid fldate 
       FROM sflight 
       INTO CORRESPONDING FIELDS OF TABLE sflight_tab 
       FOR ALL ENTRIES IN entry_tab 
       WHERE carrid = entry_tab-carrid AND 
             connid = entry_tab-connid. 


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 09:46:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3761683#M904992</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T09:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3761684#M904993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhisek &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you explain how can I use  "for all entries " in my case?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance &lt;/P&gt;&lt;P&gt;Amminesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2008 09:57:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3761684#M904993</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-02T09:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Performance issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3761685#M904994</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;I am trying to create scheduling agreement with reference to purchase requisition. I would like to use BAPI_SAG_CREATE. Can I do this. If possible can you please let me know how to give the reference document. Please also provide code if available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Amminesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jul 2009 12:29:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue/m-p/3761685#M904994</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-29T12:29:22Z</dc:date>
    </item>
  </channel>
</rss>

