<?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: Query Error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365174#M807518</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;I usally look for index in that table.If index exist i will &lt;STRONG&gt;give the where option in the index order&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg: if the index is BUADT WERKS AUFNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i will give the where option like BUDAT = '   ' and WERKS '  ' and aufnr = '  '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     The other way is give the &lt;STRONG&gt;where condition in the order of the table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your query you can try in this order &lt;/P&gt;&lt;P&gt;                                     ..................where BUDAT IN ZDAT AND&lt;/P&gt;&lt;P&gt;                                                                WERKS IN ZPL  AND&lt;/P&gt;&lt;P&gt;                                                                GRUND IN ZLINE AND&lt;/P&gt;&lt;P&gt;                                                                SDD IN ZEDAT   AND&lt;/P&gt;&lt;P&gt;                                                               ufnr EQ i_afpo-aufnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;better create a index ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Jan 2008 05:01:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-31T05:01:48Z</dc:date>
    <item>
      <title>Query Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365169#M807513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      I have used the following query, but its performance is very bad, what could be the reason, pls advise me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF i_afpo[] IS not INITIAL.&lt;/P&gt;&lt;P&gt;sort i_afpo by aufnr.&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from i_afpo comparing aufnr.&lt;/P&gt;&lt;P&gt;SELECT AUFNR&lt;/P&gt;&lt;P&gt;       BUDAT&lt;/P&gt;&lt;P&gt;       ISDD&lt;/P&gt;&lt;P&gt;       WERKS&lt;/P&gt;&lt;P&gt;       SMENG&lt;/P&gt;&lt;P&gt;       ARBID&lt;/P&gt;&lt;P&gt;       RUECK&lt;/P&gt;&lt;P&gt;       RMZHL&lt;/P&gt;&lt;P&gt;       VORNR&lt;/P&gt;&lt;P&gt;       LTXA1&lt;/P&gt;&lt;P&gt;       GRUND&lt;/P&gt;&lt;P&gt;       STOKZ&lt;/P&gt;&lt;P&gt;       STZHL&lt;/P&gt;&lt;P&gt;       AENAM&lt;/P&gt;&lt;P&gt;       AUERU&lt;/P&gt;&lt;P&gt;       EXNAM&lt;/P&gt;&lt;P&gt;       AUFPL&lt;/P&gt;&lt;P&gt;       APLZL&lt;/P&gt;&lt;P&gt;       ISM01&lt;/P&gt;&lt;P&gt;       ILE01&lt;/P&gt;&lt;P&gt;       ANZMA&lt;/P&gt;&lt;P&gt;       RMNGA&lt;/P&gt;&lt;P&gt;       XMNGA&lt;/P&gt;&lt;P&gt;       extid&lt;/P&gt;&lt;P&gt;       stzhl&lt;/P&gt;&lt;P&gt;       GMEIN&lt;/P&gt;&lt;P&gt;       LMNGA FROM AFRU&lt;/P&gt;&lt;P&gt;  INTO TABLE i_AFRU&lt;/P&gt;&lt;P&gt;  FOR ALL ENTRIES IN i_afpo&lt;/P&gt;&lt;P&gt;  WHERE aufnr EQ i_afpo-aufnr AND&lt;/P&gt;&lt;P&gt;  BUDAT IN ZDAT AND&lt;/P&gt;&lt;P&gt;  ISDD IN ZEDAT AND&lt;/P&gt;&lt;P&gt;  GRUND IN ZLINE AND&lt;/P&gt;&lt;P&gt;  WERKS IN ZPL.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rajaram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2008 03:39:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365169#M807513</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-31T03:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: Query Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365170#M807514</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;place this code before if statement and try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort i_afpo by aufnr.&lt;/P&gt;&lt;P&gt;delete adjacent duplicates from i_afpo comparing aufnr.&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, 31 Jan 2008 03:42:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365170#M807514</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-31T03:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Query Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365171#M807515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;still its not working fine yar.,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2008 04:12:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365171#M807515</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-31T04:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Query Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365172#M807516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajaram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sort i_afpo by aufnr.
delete adjacent duplicates from i_afpo comparing aufnr.

IF i_afpo[] IS not INITIAL.

SELECT AUFNR BUDAT ISDD WERKS SMENG ARBID RUECK
RMZHL VORNR LTXA1 GRUND STOKZ STZHL AENAM AUERU
EXNAM AUFPL APLZL ISM01 ILE01 ANZMA RMNGA XMNGA
extid  stzhl GMEIN LMNGA 
FROM AFRU
INTO TABLE i_AFRU
FOR ALL ENTRIES IN i_afpo
WHERE aufnr EQ i_afpo-aufnr AND
BUDAT IN ZDAT AND
ISDD IN ZEDAT AND
GRUND IN ZLINE AND
WERKS IN ZPL.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in i_afpo try to get RUECK RMZHL and the change the condition as &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;....
...
..
LMNGA FROM AFRU
INTO TABLE i_AFRU
FOR ALL ENTRIES IN i_afpo
WHERE aufnr EQ i_afpo-aufnr AND
RUECK  EQ i_afpo-RUECK and 
RMZHL  EQ i_afpo-RMZHL and  
BUDAT IN ZDAT AND
ISDD IN ZEDAT AND
GRUND IN ZLINE AND
WERKS IN ZPL.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if its not possible its okay for ur query to take long time.. becoz ur not using any of the key fields from the table.... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when ever you pick and option to use a table.. u need to make sure you have some key field with u....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2008 04:18:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365172#M807516</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2008-01-31T04:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Query Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365173#M807517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If poosible, try to use inner join istead of for all entries. Inner Join should improve your perfomance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2008 04:55:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365173#M807517</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-31T04:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: Query Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365174#M807518</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;I usally look for index in that table.If index exist i will &lt;STRONG&gt;give the where option in the index order&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg: if the index is BUADT WERKS AUFNR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i will give the where option like BUDAT = '   ' and WERKS '  ' and aufnr = '  '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     The other way is give the &lt;STRONG&gt;where condition in the order of the table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in your query you can try in this order &lt;/P&gt;&lt;P&gt;                                     ..................where BUDAT IN ZDAT AND&lt;/P&gt;&lt;P&gt;                                                                WERKS IN ZPL  AND&lt;/P&gt;&lt;P&gt;                                                                GRUND IN ZLINE AND&lt;/P&gt;&lt;P&gt;                                                                SDD IN ZEDAT   AND&lt;/P&gt;&lt;P&gt;                                                               ufnr EQ i_afpo-aufnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;better create a index ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2008 05:01:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365174#M807518</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-31T05:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Query Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365175#M807519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are correct, i tied like u said, but RUECK,RMZHL fields in Not available in AFPO table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       Its available in AFKO Table, But value is not available in that table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       What can i do, pls advice me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2008 05:13:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365175#M807519</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-31T05:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Query Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365176#M807520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Functional consultants are there to help us when we are stuck with such sort of issues.. if you have one, get him..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RUECK  data element CO_RUECK&lt;/P&gt;&lt;P&gt;RMZHL  data element CO_RMZHL&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hit a where used list with the data element and see what other tables have this .. and find out if anything you can use of those list... you will get a very big list.. all the best..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Award points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2008 05:20:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/query-error/m-p/3365176#M807520</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2008-01-31T05:20:18Z</dc:date>
    </item>
  </channel>
</rss>

