<?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 with MSEG table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869107#M929902</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi uday,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There could be various reasons for performance issue with MSEG. &lt;/P&gt;&lt;P&gt;1) database statistics of tables and indexes are not upto date.&lt;/P&gt;&lt;P&gt;because of this wrong index is choosen during the execution.&lt;/P&gt;&lt;P&gt;2) Improper indexes, because there is no indexes with the fields mentioned in the WHERE clause of the statement. Because of this reason, CBO would have choosen wrong index and did a range scan.&lt;/P&gt;&lt;P&gt;3) Optimizer bug in oracle.&lt;/P&gt;&lt;P&gt;4) Size of table is very huge, archive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Better switch on ST05 trace before you run this statements, so it will give more detailed information, where exactly time being spent during the execution. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if usful,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 May 2008 10:30:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-16T10:30:38Z</dc:date>
    <item>
      <title>performance issue with MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869105#M929900</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;    when I am fetching data from MSEG table it is taking lot of time. I created a secondary index with fields &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MANDT	Client&lt;/P&gt;&lt;P&gt;MBLNR	Number of Material Document&lt;/P&gt;&lt;P&gt;MATNR	Material Number&lt;/P&gt;&lt;P&gt;CHARG	Batch Number&lt;/P&gt;&lt;P&gt;AUFNR	Order Number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my program is like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.&lt;/P&gt;&lt;P&gt;*SELECT-OPTIONS : s_aufnr like afko-aufnr.&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS: s_date FOR afko-gltrp.  "finish date&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF i_prod OCCURS 0,&lt;/P&gt;&lt;P&gt;          aufnr LIKE afko-aufnr,&lt;/P&gt;&lt;P&gt;          gstrp LIKE afko-gstrp,&lt;/P&gt;&lt;P&gt;          gltrp LIKE afko-gltrp,&lt;/P&gt;&lt;P&gt;       END OF i_prod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF i_mseg OCCURS 0,&lt;/P&gt;&lt;P&gt;          mblnr LIKE mseg-mblnr,        "mat doc.no&lt;/P&gt;&lt;P&gt;          mjahr LIKE mseg-mjahr,&lt;/P&gt;&lt;P&gt;          zeile LIKE mseg-zeile,&lt;/P&gt;&lt;P&gt;          bwart LIKE mseg-bwart,        "movement type&lt;/P&gt;&lt;P&gt;          matnr LIKE mseg-matnr,&lt;/P&gt;&lt;P&gt;          werks LIKE mseg-werks,&lt;/P&gt;&lt;P&gt;          lgort LIKE mseg-lgort,&lt;/P&gt;&lt;P&gt;          charg LIKE mseg-charg,&lt;/P&gt;&lt;P&gt;          menge LIKE mseg-menge,&lt;/P&gt;&lt;P&gt;          meins LIKE mseg-meins,&lt;/P&gt;&lt;P&gt;          aufnr LIKE mseg-aufnr,&lt;/P&gt;&lt;P&gt;        END OF i_mseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF  i_final OCCURS 0,&lt;/P&gt;&lt;P&gt;          aufnr LIKE afko-aufnr,&lt;/P&gt;&lt;P&gt;          gstrp LIKE afko-gstrp,&lt;/P&gt;&lt;P&gt;          gltrp LIKE afko-gltrp,&lt;/P&gt;&lt;P&gt;          mblnr LIKE mseg-mblnr,        "mat doc.no&lt;/P&gt;&lt;P&gt;          bwart LIKE mseg-bwart,        "movement type&lt;/P&gt;&lt;P&gt;          matnr LIKE mseg-matnr,&lt;/P&gt;&lt;P&gt;          werks LIKE mseg-werks,&lt;/P&gt;&lt;P&gt;          lgort LIKE mseg-lgort,&lt;/P&gt;&lt;P&gt;          charg LIKE mseg-charg,&lt;/P&gt;&lt;P&gt;          menge LIKE mseg-menge,&lt;/P&gt;&lt;P&gt;          meins LIKE mseg-meins,&lt;/P&gt;&lt;P&gt;       END OF i_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT aufnr gstrp gltrp FROM afko INTO TABLE i_prod WHERE gltrp IN s_date.&lt;/P&gt;&lt;P&gt;  IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT  mblnr&lt;/P&gt;&lt;P&gt;            mjahr&lt;/P&gt;&lt;P&gt;            zeile&lt;/P&gt;&lt;P&gt;            bwart&lt;/P&gt;&lt;P&gt;            matnr&lt;/P&gt;&lt;P&gt;            werks&lt;/P&gt;&lt;P&gt;            lgort&lt;/P&gt;&lt;P&gt;            charg&lt;/P&gt;&lt;P&gt;            menge&lt;/P&gt;&lt;P&gt;            meins&lt;/P&gt;&lt;P&gt;            aufnr FROM mseg INTO TABLE i_mseg&lt;/P&gt;&lt;P&gt;                  FOR ALL ENTRIES IN i_prod WHERE aufnr = i_prod-aufnr.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                 %_HINTS ORACLE 'INDEX("MSEG" "ZPD")'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    WRITE : / 'No production orders found within the date'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*move data to i_final internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT i_prod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    i_final-aufnr = i_prod-aufnr.&lt;/P&gt;&lt;P&gt;    i_final-gstrp = i_prod-gstrp.&lt;/P&gt;&lt;P&gt;    i_final-gltrp = i_prod-gltrp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE i_mseg WITH KEY aufnr = i_prod-aufnr.&lt;/P&gt;&lt;P&gt;    IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;      i_final-mblnr = i_mseg-mblnr.&lt;/P&gt;&lt;P&gt;      i_final-bwart = i_mseg-bwart.&lt;/P&gt;&lt;P&gt;      i_final-matnr = i_mseg-matnr.&lt;/P&gt;&lt;P&gt;      i_final-werks = i_mseg-werks.&lt;/P&gt;&lt;P&gt;      i_final-lgort = i_mseg-lgort.&lt;/P&gt;&lt;P&gt;      i_final-charg = i_mseg-charg.&lt;/P&gt;&lt;P&gt;      i_final-menge = i_mseg-menge.&lt;/P&gt;&lt;P&gt;      i_final-meins = i_mseg-meins.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    APPEND i_final.&lt;/P&gt;&lt;P&gt;    CLEAR i_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;then I am displaying i_final with FM ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but how to increase the performance &amp;amp; reduce the fetching time from mseg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;watching&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 10:21:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869105#M929900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T10:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869106#M929901</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; Use the secondary index created only with MANDAT and AUFNR field ... there shouldn't be any other fields apart from these ... to increase the performance ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Santosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 10:28:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869106#M929901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T10:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869107#M929902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi uday,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There could be various reasons for performance issue with MSEG. &lt;/P&gt;&lt;P&gt;1) database statistics of tables and indexes are not upto date.&lt;/P&gt;&lt;P&gt;because of this wrong index is choosen during the execution.&lt;/P&gt;&lt;P&gt;2) Improper indexes, because there is no indexes with the fields mentioned in the WHERE clause of the statement. Because of this reason, CBO would have choosen wrong index and did a range scan.&lt;/P&gt;&lt;P&gt;3) Optimizer bug in oracle.&lt;/P&gt;&lt;P&gt;4) Size of table is very huge, archive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Better switch on ST05 trace before you run this statements, so it will give more detailed information, where exactly time being spent during the execution. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if usful,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 10:30:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869107#M929902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T10:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869108#M929903</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;den do one thing don't use any condition&lt;/P&gt;&lt;P&gt;and den use loop tp fetch data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT mblnr&lt;/P&gt;&lt;P&gt;mjahr&lt;/P&gt;&lt;P&gt;zeile&lt;/P&gt;&lt;P&gt;bwart&lt;/P&gt;&lt;P&gt;matnr&lt;/P&gt;&lt;P&gt;werks&lt;/P&gt;&lt;P&gt;lgort&lt;/P&gt;&lt;P&gt;charg&lt;/P&gt;&lt;P&gt;menge&lt;/P&gt;&lt;P&gt;meins&lt;/P&gt;&lt;P&gt;aufnr FROM mseg INTO TABLE i_mseg.&lt;/P&gt;&lt;P&gt;loop at ra.&lt;/P&gt;&lt;P&gt;loop at i_mseg ....&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 10:30:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869108#M929903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T10:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869109#M929904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;means in the secondary index , there should be only fields which we are using in the where clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here , the index should contain only MANDT &amp;amp; AUFNR..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;am i correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 10:32:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869109#M929904</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T10:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869110#M929905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if we are not using where condition in select statement will it increases the performance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 10:45:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869110#M929905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-16T10:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: performance issue with MSEG table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869111#M929906</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 assume basics like hardware DB and statistics are ok.&lt;/P&gt;&lt;P&gt;i)&lt;/P&gt;&lt;P&gt;Create an non-unique index with only two key fields mandt and aufnr. I think there is even a sap note in that way.&lt;/P&gt;&lt;P&gt;ii)&lt;/P&gt;&lt;P&gt;Think about archiving, perhaps with PBS. That is a third party product and allows short residence time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards &lt;/P&gt;&lt;P&gt;Walter Habich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 May 2008 11:33:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/performance-issue-with-mseg-table/m-p/3869111#M929906</guid>
      <dc:creator>former_member435013</dc:creator>
      <dc:date>2008-05-16T11:33:27Z</dc:date>
    </item>
  </channel>
</rss>

