<?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: Fetching data from MSEG table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427570#M1410343</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use GJAHR parameter also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remoove INTO CORRESPONDIG FIELDS OF  statement by defining structure for fields to get good performence&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and check if T_ekbe is initial by IF T_EKBE IS NOT INITIAL before  FOR ALL ENTRIES SELECT statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kalandar on Dec 16, 2009 11:16 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Dec 2009 10:14:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-12-16T10:14:00Z</dc:date>
    <item>
      <title>Fetching data from MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427569#M1410342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Abap Gurus ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to prepare a vendor Rating Report . There are particular 2 queries which have perfomance issues .The requirement is such that this report has to be executed for the whole financial year .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1st Query :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT BELNR GJAHR BLDAT BUDAT CPUDT FROM EKBE INTO CORRESPONDING FIELDS OF TABLE T_MKPF&lt;/P&gt;&lt;P&gt;      WHERE BUDAT IN S_SRDATE&lt;/P&gt;&lt;P&gt;            AND BEWTP = 'E'&lt;/P&gt;&lt;P&gt;            AND WERKS IN S_PLANT .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question 1: Is there any additional parameter which i can add in the where clause for getting data from ekbe for vendor rating .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above query gives 98,000 records .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After This , another below  query is taking 12 minutes to get executed which takes data from MSEG . T_EKBE has 98,000 records .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        SELECT MBLNR ZEILE CHARG ABLAD EBELN EBELP MATNR MENGE WERKS ABLAD LIFNR FROM MSEG INTO CORRESPONDING FIELDS OF TABLE T_MSEG&lt;/P&gt;&lt;P&gt;        FOR ALL ENTRIES IN T_ekbe&lt;/P&gt;&lt;P&gt;        WHERE  MBLNR = T_ekbe-BELNR&lt;/P&gt;&lt;P&gt;           AND MJAHR = T_ekbe-GJAHR&lt;/P&gt;&lt;P&gt;           AND MATNR IN S_MATNR&lt;/P&gt;&lt;P&gt;           AND WERKS IN  S_PLANT&lt;/P&gt;&lt;P&gt;           AND BWART = '101'&lt;/P&gt;&lt;P&gt;           AND LIFNR IN S_VENDCD .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question 2 : How to increase speed of this query for MSEG .&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;&lt;/P&gt;&lt;P&gt;Devendra Singh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 10:07:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427569#M1410342</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-16T10:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427570#M1410343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use GJAHR parameter also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remoove INTO CORRESPONDIG FIELDS OF  statement by defining structure for fields to get good performence&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and check if T_ekbe is initial by IF T_EKBE IS NOT INITIAL before  FOR ALL ENTRIES SELECT statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: kalandar on Dec 16, 2009 11:16 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 10:14:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427570#M1410343</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-16T10:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427571#M1410344</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;There are two points of performance improvement which i can see.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. One PO can have multiple GRN's&lt;/P&gt;&lt;P&gt;. Hence the internal table T_EKBE (98,000) records - can be reduced (in another itab).&lt;/P&gt;&lt;P&gt;  by comparing belnr and gjahr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
    sort T_EKBE by BELNR GJAHR.
     DELETE ADJACENT DUPLICATES FROM T_EKBE comparing BELNR GJAHR.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above can be done in another internal table also if you want T_EKBE for other uses also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   So when we use subsequently in FOR ALL ENTRIES, the database will have to search for LESS THAN 98,000 comparisons.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. In database table MSEG, &lt;/P&gt;&lt;P&gt;    secondary indexes already exist for MATNR, WERKS (and ofcourse the primary keys MBLNR and MJAHR already have indexes)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  These two fields BWART and LIFNR do not have any secondary indexes.&lt;/P&gt;&lt;P&gt;   If we create secondary indexes on these two fields, it will surely improve the performance. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 10:21:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427571#M1410344</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-16T10:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427572#M1410345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit Sir ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply . Using Delete Adjacent Statement has reduced the time by 4 min . I have been instructed not to use secondary index bec it will create unnecessary burden. But still the report takes 19 min to get report for the whole financial year . Is there any other way to reduce the time in the above 2 queries .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Devendra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 05:05:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427572#M1410345</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-17T05:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427573#M1410346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still Time Limit being 19 min&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 05:20:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427573#M1410346</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-17T05:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427574#M1410347</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;Try to create the index for the both table, EKBE and MSEG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secand this is tel to ur BASIS guy to run the  statictic  for the both table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regard&lt;/P&gt;&lt;P&gt;nawa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 05:47:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427574#M1410347</guid>
      <dc:creator>Nawanandana</dc:creator>
      <dc:date>2009-12-17T05:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427575#M1410348</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;Try to create the index for the both table, EKBE and MSEG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secand this is tel to ur BASIS guy to run the  statictic  for the both table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regard&lt;/P&gt;&lt;P&gt;nawa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 05:47:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427575#M1410348</guid>
      <dc:creator>Nawanandana</dc:creator>
      <dc:date>2009-12-17T05:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching data from MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427576#M1410349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi again,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my opinion and as per my experience, there is no further way (major way) to reduce the time limit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my programs, I have done like that only. I have created secondary index (as per the where conditions in select query)  and the performance has improved DRASTICALLY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some people say it creates burden/overhead. But this is not true as per my opinion. We have to create secondary index once only, and the rest is taken care by the database. Maintaining/updating an index (whenever a record is created / deleted in table is taken care by the database itself, and it really does not have any burden.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So as per my opinion, secondary index is justified. If these MSEG fields (where condition fields) are used in other programs, then they will also automatically get speeded up.  hope this helps.&lt;/P&gt;&lt;P&gt;&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;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Dec 2009 05:48:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-data-from-mseg-table/m-p/6427576#M1410349</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-12-17T05:48:40Z</dc:date>
    </item>
  </channel>
</rss>

