<?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 ABAP Query Performance Issue . in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-performance-issue/m-p/1521398#M239399</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii&lt;/P&gt;&lt;P&gt;     I need to print a very simple list of materials &amp;amp; there corresponding latest movement date for a specified period of say '365 Days'.&lt;/P&gt;&lt;P&gt;          Now for this i have written a join on MSEG &amp;amp; MKPF tables .but the issue is,this join gives me a very large number of records as all the material documents for that material in that period are fetched ,then i sort this table descending on date &amp;amp; delete other records.&lt;/P&gt;&lt;P&gt;  I just need to get that record of latest date (material document with latest date).How could that be done without fetching the other records ?&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;Ajitabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 05 Aug 2006 07:35:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-05T07:35:17Z</dc:date>
    <item>
      <title>ABAP Query Performance Issue .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-performance-issue/m-p/1521398#M239399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hii&lt;/P&gt;&lt;P&gt;     I need to print a very simple list of materials &amp;amp; there corresponding latest movement date for a specified period of say '365 Days'.&lt;/P&gt;&lt;P&gt;          Now for this i have written a join on MSEG &amp;amp; MKPF tables .but the issue is,this join gives me a very large number of records as all the material documents for that material in that period are fetched ,then i sort this table descending on date &amp;amp; delete other records.&lt;/P&gt;&lt;P&gt;  I just need to get that record of latest date (material document with latest date).How could that be done without fetching the other records ?&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;Ajitabh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Aug 2006 07:35:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-performance-issue/m-p/1521398#M239399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-05T07:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Query Performance Issue .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-performance-issue/m-p/1521399#M239400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. try to create/ use secondary indexes on MSEG and MKPF.&lt;/P&gt;&lt;P&gt;2. Dont use For all Entries in this Join .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it should be like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if s_matnr[] is not initial.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select a~mblnr
         a~mjahr
         a~vgart
         a~budat
         a~xblnr
         b~zeile
         b~bwart
         b~matnr
         b~werks
         b~kunnr
         b~shkzg
         b~menge
         b~meins
   from  ( mkpf as a join mseg as b
   on    a~mblnr = b~mblnr  and
         a~mjahr = b~mjahr )
   into  table t_mseg
   where a~budat ge s_date-low     and
         a~vgart in ('WA' ,'WL')   and
         b~matnr in s_matnr        and
         b~werks in s_werks1       and
         b~sobkz eq 'V'            and
         b~kunnr eq w_cust         .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Aug 2006 07:40:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-performance-issue/m-p/1521399#M239400</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-05T07:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Query Performance Issue .</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-performance-issue/m-p/1521400#M239401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write the select statement like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use the CORRESPONDING FIELDS OF TABLE in select statement&lt;/P&gt;&lt;P&gt;while joining between two tables give some condition that ll make your join more close to the field value and it ll reduce the time period of accessing the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 05 Aug 2006 10:58:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-query-performance-issue/m-p/1521400#M239401</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-05T10:58:57Z</dc:date>
    </item>
  </channel>
</rss>

