<?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: mkpf table performance in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805339#M1124996</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Moha..&lt;/P&gt;&lt;P&gt;B~MJAHR  = P_MJAHR&lt;/P&gt;&lt;P&gt;this i did not get??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Dec 2008 09:35:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-02T09:35:46Z</dc:date>
    <item>
      <title>mkpf table performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805335#M1124992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is my code . its taking 12 hours to complete for one plant which is having 14000 material for 300 days.&lt;/P&gt;&lt;P&gt;when i see in sm51 it is showing error in MKPF table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any body can give any idea?? i shall be thankful.&lt;/P&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;&lt;P&gt;SELECT MATNR WERKS FROM MARC INTO TABLE IT_MARC&lt;/P&gt;&lt;P&gt;                             WHERE MATNR IN S_MATNR&lt;/P&gt;&lt;P&gt;                               AND WERKS = P_WERKS.&lt;/P&gt;&lt;P&gt;IF IT_MARC[] IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT MATNR MTART MATKL FROM MARA INTO TABLE IT_MARA&lt;/P&gt;&lt;P&gt; for all entries in IT_MARC&lt;/P&gt;&lt;P&gt;                                                  WHERE matnr = it_marc-matnr&lt;/P&gt;&lt;P&gt;                                                  and MTART  in s_MTART&lt;/P&gt;&lt;P&gt;                                                  AND MATKL IN S_MATKL.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_MARA.&lt;/P&gt;&lt;P&gt;IT_STOCK-MATNR = IT_MARA-MATNR.&lt;/P&gt;&lt;P&gt;IT_STOCK-WERKS = P_WERKS.&lt;/P&gt;&lt;P&gt;IT_STOCK-MTART = IT_MARA-MTART.&lt;/P&gt;&lt;P&gt;IT_STOCK-MATKL = IT_MARA-MATKL.&lt;/P&gt;&lt;P&gt;APPEND IT_STOCK.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT A&lt;SUB&gt;MBLNR A&lt;/SUB&gt;MJAHR A&lt;SUB&gt;BUDAT B&lt;/SUB&gt;ZEILE B&lt;SUB&gt;MATNR B&lt;/SUB&gt;MENGE B&lt;SUB&gt;DMBTR B&lt;/SUB&gt;SHKZG B&lt;SUB&gt;WERKS  B&lt;/SUB&gt;BWART B&lt;SUB&gt;XAUTO B&lt;/SUB&gt;BUSTW B&lt;SUB&gt;SJAHR B&lt;/SUB&gt;SMBLN B~MEINS&lt;/P&gt;&lt;P&gt;         INTO TABLE I_STK_GRGI&lt;/P&gt;&lt;P&gt;         FROM MKPF AS A INNER JOIN MSEG AS B ON  A&lt;SUB&gt;MBLNR = B&lt;/SUB&gt;MBLNR&lt;/P&gt;&lt;P&gt;                                             AND A&lt;SUB&gt;MJAHR = B&lt;/SUB&gt;MJAHR&lt;/P&gt;&lt;P&gt;            FOR ALL ENTRIES IN IT_STOCK&lt;/P&gt;&lt;P&gt;              WHERE A~MBLNR BETWEEN '0000000001' AND '9999999999'&lt;/P&gt;&lt;P&gt;                  AND A~BUDAT BETWEEN L1_STDATE AND L_DATE&lt;/P&gt;&lt;P&gt;                  AND B~MATNR = IT_STOCK-MATNR&lt;/P&gt;&lt;P&gt;                  AND b~bwart NOT IN (311, 312)&lt;/P&gt;&lt;P&gt;                  AND B~WERKS = IT_STOCK-WERKS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2008 09:05:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805335#M1124992</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-02T09:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: mkpf table performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805336#M1124993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't make use of a good index for MKPF.&lt;/P&gt;&lt;P&gt;Why check on MBLN between 000..1 and 999.999 ? Leave it out !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create an index on matnr and plant if it does not exist yest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Hans&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2008 09:15:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805336#M1124993</guid>
      <dc:creator>h_senden2</dc:creator>
      <dc:date>2008-12-02T09:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: mkpf table performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805337#M1124994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;First and Second Query :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reverse the order of your query, first query on MARA and than on MARC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Collect all materials in IT_MARA first and use it in FOR ALL ENTRIES for query on MARC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Third Query:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try left table as MSEG and right as MKPF. If you are having secondary index on MATNR , WERKS etc...that will be helpful. (Generally that is standard sec index provided by SAP).&lt;/P&gt;&lt;P&gt;If you can have P_MJAHR as parameter on screen (obligatory parameter) that will also be very helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change your query as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT A~MBLNR A~MJAHR A~BUDAT B~ZEILE B~MATNR B~MENGE B~DMBTR B~SHKZG B~WERKS B~BWART B~XAUTO B~BUSTW B~SJAHR B~SMBLN B~MEINS
INTO TABLE I_STK_GRGI
FROM MSEG AS B INNER JOIN  MKPF AS A  ON B~MBLNR = A~MBLNR
AND B~MJAHR = A~MJAHR
FOR ALL ENTRIES IN IT_STOCK
WHERE B~MATNR = IT_STOCK-MATNR
AND B~WERKS = IT_STOCK-WERKS
AND B~MJAHR  = P_MJAHR
AND b~bwart NOT IN (311, 312) 
AND A~BUDAT BETWEEN L1_STDATE AND L_DATE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can use LGORT that will be very useful, it will be able to use more keys on index M. (Check if you have secondary index with this name which has key field as MATNR, WERKS, LGORT, BWART, SOBKZ) on MSEG...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mohaiyuddin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2008 09:30:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805337#M1124994</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-02T09:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: mkpf table performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805338#M1124995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't make use of a good index for MKPF.&lt;/P&gt;&lt;P&gt;how to use good index of MKPF.please let me know.&lt;/P&gt;&lt;P&gt;Why check on MBLN between 000..1 and 999.999 ? Leave it out !&lt;/P&gt;&lt;P&gt;this i am removing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create an index on matnr and plant if it does not exist yest.&lt;/P&gt;&lt;P&gt;i guess you are talking abt MSEG table.&lt;/P&gt;&lt;P&gt;i have some index for MSEG.&lt;/P&gt;&lt;P&gt;but no index is containing MATNR and WERKS only.&lt;/P&gt;&lt;P&gt;some indices having this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please elaborate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Chandramani&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2008 09:32:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805338#M1124995</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-02T09:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: mkpf table performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805339#M1124996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Moha..&lt;/P&gt;&lt;P&gt;B~MJAHR  = P_MJAHR&lt;/P&gt;&lt;P&gt;this i did not get??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2008 09:35:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805339#M1124996</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-02T09:35:46Z</dc:date>
    </item>
    <item>
      <title>Re: mkpf table performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805340#M1124997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will need to define one more parameter for YEAR - let's say P_MJAHR on your selection screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As MJAHR is one of the key field, this should be helpful.. Anyway if you can define LGORT as input parameter / select-option you should be able to use index on MSEG. (Provided index i had mentioned earlier is active on your table MSEG), in that case defining year as input parameter will be helpful but to limited extend&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mohaiyuddin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2008 10:26:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805340#M1124997</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-02T10:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: mkpf table performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805341#M1124998</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;Did you try the view V_MKPF to get the respective data from MKPF and MSEG?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are the fields of this view:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MBLNR&lt;/P&gt;&lt;P&gt;MJAHR&lt;/P&gt;&lt;P&gt;ZEILE&lt;/P&gt;&lt;P&gt;WERKS&lt;/P&gt;&lt;P&gt;VGART&lt;/P&gt;&lt;P&gt;BUDAT&lt;/P&gt;&lt;P&gt;BKTXT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Dec 2008 20:56:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805341#M1124998</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-08T20:56:09Z</dc:date>
    </item>
    <item>
      <title>Re: mkpf table performance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805342#M1124999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks to all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Dec 2008 06:36:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mkpf-table-performance/m-p/4805342#M1124999</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-10T06:36:16Z</dc:date>
    </item>
  </channel>
</rss>

