<?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: Is the select statement correct? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-the-select-statement-correct/m-p/3809015#M916199</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you probably want to include POSNR when joining VBUP and VBAP.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 May 2008 14:03:06 GMT</pubDate>
    <dc:creator>ThomasZloch</dc:creator>
    <dc:date>2008-05-23T14:03:06Z</dc:date>
    <item>
      <title>Is the select statement correct?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-the-select-statement-correct/m-p/3809014#M916198</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;Is the below select statement correct?&lt;/P&gt;&lt;P&gt;If not how to modify it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT * INTO CORRESPONDING FIELDS OF TABLE it_vbap&lt;/P&gt;&lt;P&gt;         FROM vbup AS k&lt;/P&gt;&lt;P&gt;        INNER JOIN vbap AS p ON p&lt;SUB&gt;vbeln = k&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;        WHERE k~gbsta &amp;lt;&amp;gt; 'C'&lt;/P&gt;&lt;P&gt;          AND p~vbeln IN p_vbeln&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      AND k~vbtyp NOT IN ('A','B','J','M','N','O','P','S')&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;          AND p~matnr IN p_matnr&lt;/P&gt;&lt;P&gt;          AND p~werks IN p_werks&lt;/P&gt;&lt;P&gt;          AND p~pstyv IN p_pstyv&lt;/P&gt;&lt;P&gt;          AND p~mvgr2 IN p_mvgr2&lt;/P&gt;&lt;P&gt;          AND p~abgru = ''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Balaji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2008 13:58:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-the-select-statement-correct/m-p/3809014#M916198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-23T13:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is the select statement correct?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-the-select-statement-correct/m-p/3809015#M916199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you probably want to include POSNR when joining VBUP and VBAP.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2008 14:03:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-the-select-statement-correct/m-p/3809015#M916199</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2008-05-23T14:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is the select statement correct?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-the-select-statement-correct/m-p/3809016#M916200</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;the following line will work fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND k~vbtyp NOT IN ('A','B','J','M','N','O','P','S') &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no need to change the query.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2008 14:07:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-the-select-statement-correct/m-p/3809016#M916200</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-23T14:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Is the select statement correct?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-the-select-statement-correct/m-p/3809017#M916201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT * &lt;/P&gt;&lt;P&gt;  INTO CORRESPONDING FIELDS OF TABLE it_vbap&lt;/P&gt;&lt;P&gt;  FROM vbup AS k&lt;/P&gt;&lt;P&gt; INNER JOIN vbap AS p &lt;/P&gt;&lt;P&gt;    ON p&lt;SUB&gt;vbeln = k&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;   AND p&lt;SUB&gt;posnr = k&lt;/SUB&gt;posnr&lt;/P&gt;&lt;P&gt;WHERE k~gbsta = 'C'&lt;/P&gt;&lt;P&gt;AND p~vbeln IN p_vbeln&lt;/P&gt;&lt;P&gt;AND k~vbtyp NOT IN ('A','B','J','M','N','O','P','S') &lt;/P&gt;&lt;P&gt;AND p~matnr IN p_matnr&lt;/P&gt;&lt;P&gt;AND p~werks IN p_werks&lt;/P&gt;&lt;P&gt;AND p~pstyv IN p_pstyv&lt;/P&gt;&lt;P&gt;AND p~mvgr2 IN p_mvgr2&lt;/P&gt;&lt;P&gt;AND p~abgru = ''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should use all the key fields to get the right data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adithya M.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2008 14:20:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-the-select-statement-correct/m-p/3809017#M916201</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-23T14:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is the select statement correct?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/is-the-select-statement-correct/m-p/3809018#M916202</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 for the reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VBUP table has 4220449 records.&lt;/P&gt;&lt;P&gt;VBAP table has 1730584 records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The select statement fetches around 3000000 records which takes around 15 mins.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to optmize the code.  Any inputs?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Balaji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2008 14:39:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/is-the-select-statement-correct/m-p/3809018#M916202</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-23T14:39:09Z</dc:date>
    </item>
  </channel>
</rss>

