<?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: regarding select statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-select-statement/m-p/2604428#M596785</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can use Material Document year to restrict the entries in the select query or still if it is timing out you can try to run the report in back ground and then retrive the result from the spool once a year report are moslty run in back ground as they have huge amount of data and simple select query may take a lot of time to work causing a time out .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Himanshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 04 Aug 2007 05:03:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-04T05:03:43Z</dc:date>
    <item>
      <title>regarding select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-select-statement/m-p/2604426#M596783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;                here in the given select statement the last select statement is giving runtime error i.e '' Time limit exceeded".kindly help me to solve this problem sud i use indexes for this but how........&lt;/P&gt;&lt;P&gt;&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;       blart&lt;/P&gt;&lt;P&gt;       budat&lt;/P&gt;&lt;P&gt;        from mkpf into&lt;/P&gt;&lt;P&gt;       table itab_mkpf_rcvdate where&lt;/P&gt;&lt;P&gt;       budat between itab_mkpf-p_date1 and itab_mkpf_rcvdate-p_date2&lt;/P&gt;&lt;P&gt;       and blart in&lt;/P&gt;&lt;P&gt;       ('WA','WE','WL').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select matnr&lt;/P&gt;&lt;P&gt;       erfmg&lt;/P&gt;&lt;P&gt;       mblnr&lt;/P&gt;&lt;P&gt;       ebeln&lt;/P&gt;&lt;P&gt;       werks&lt;/P&gt;&lt;P&gt;       lgort&lt;/P&gt;&lt;P&gt;       bwart&lt;/P&gt;&lt;P&gt;       lfbnr&lt;/P&gt;&lt;P&gt;       smbln from mseg into table itab_101&lt;/P&gt;&lt;P&gt;       for&lt;/P&gt;&lt;P&gt;       all entries in itab_mkpf_rcvdate&lt;/P&gt;&lt;P&gt;       where mblnr = itab_mkpf_rcvdate-mblnr and&lt;/P&gt;&lt;P&gt;       bwart in ('101','531') and werks = s_werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;select&lt;/P&gt;&lt;P&gt;       bwart&lt;/P&gt;&lt;P&gt;       matnr&lt;/P&gt;&lt;P&gt;       ebeln&lt;/P&gt;&lt;P&gt;       lfbnr&lt;/P&gt;&lt;P&gt;       smbln from mseg&lt;/P&gt;&lt;P&gt;       into corresponding fields of  table itab3 for&lt;/P&gt;&lt;P&gt;       all entries in itab_101 where  ebeln =&lt;/P&gt;&lt;P&gt;       itab_101-ebeln  and   bwart in ('102','532')&lt;/P&gt;&lt;P&gt;           .&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Aug 2007 04:15:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-select-statement/m-p/2604426#M596783</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-04T04:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: regarding select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-select-statement/m-p/2604427#M596784</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;Find out if you can pass any primary key while selecting the data from mseg.Keeping performance issues in mind it is always advisable, not to hit the same database table twice and you are hitting it twice.Check out if possible for you to retrieve all the data from MSEG once into a internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also Select * from dtab into correspondind field is not recommened from performance point of view.So while retrieving the data try to use an internal table with the same structure for the fields you are selecting from the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For how to improve the performance by keeping the same code, for all the Indexes already present in the table find out whether you can pass one more field from the index or not.If not than you can go with creation of indexes.But generally as far as possible try not to create a new index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mohit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Aug 2007 04:37:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-select-statement/m-p/2604427#M596784</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-04T04:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: regarding select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-select-statement/m-p/2604428#M596785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can use Material Document year to restrict the entries in the select query or still if it is timing out you can try to run the report in back ground and then retrive the result from the spool once a year report are moslty run in back ground as they have huge amount of data and simple select query may take a lot of time to work causing a time out .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Himanshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Aug 2007 05:03:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-select-statement/m-p/2604428#M596785</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-04T05:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: regarding select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-select-statement/m-p/2604429#M596786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;MSEG table contains  lot of data and you are fetching it based on just ebe;ln field&lt;/P&gt;&lt;P&gt;why can't you write a single select statment by joining MKPF and MSEG and then seggragate the data into different internal tables based on your conditions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select &lt;/P&gt;&lt;P&gt;a~mblnr&lt;/P&gt;&lt;P&gt;a~mjahr&lt;/P&gt;&lt;P&gt;a~blart&lt;/P&gt;&lt;P&gt;a~budat&lt;/P&gt;&lt;P&gt;b~bwart&lt;/P&gt;&lt;P&gt;b~matnr&lt;/P&gt;&lt;P&gt;b~erfmg&lt;/P&gt;&lt;P&gt;b~ebeln&lt;/P&gt;&lt;P&gt;b~werks&lt;/P&gt;&lt;P&gt;b~lgort&lt;/P&gt;&lt;P&gt;b~lfbnr&lt;/P&gt;&lt;P&gt;b~smbln&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from mkpf as a join mseg as b on a&lt;SUB&gt;mblnr = b&lt;/SUB&gt;mblnr  and&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;mjahr = b&lt;/SUB&gt;mjahr &lt;/P&gt;&lt;P&gt; into table itab&lt;/P&gt;&lt;P&gt;a~budat ( between date1 and date2 )&lt;/P&gt;&lt;P&gt;and a~mjahr = s_year &lt;/P&gt;&lt;P&gt;and a~blart in ('WA','WE','WL')&lt;/P&gt;&lt;P&gt;and b&lt;SUB&gt;bwart in ( '101','531' ,'102','532' ) and b&lt;/SUB&gt;werks = s_werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points for useful Answers&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Aug 2007 05:24:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-select-statement/m-p/2604429#M596786</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-04T05:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: regarding select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-select-statement/m-p/2604430#M596787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;some problem is there in your select statement i have made some modifications try like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT A~MBLNR A~MJAHR A~BLART A~BUDAT B~BWART B~MATNR B~ERFMG B~EBELN B~WERKS B~LGORT B~LFBNR B~SMBLN
              FROM MKPF AS A JOIN MSEG AS B ON A~MBLNR = B~MBLNR AND
                                                               A~MJAHR = B~MJAHR INTO TABLE ITAB A~BUDAT ( BETWEEN DATE1 AND DATE2 )
AND A~MJAHR = S_YEAR 
AND A~BLART IN ('WA','WE','WL')
AND B~BWART IN ( '101','531' ,'102','532' ) AND B~WERKS = S_WERKS.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward all helpfull answers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 04 Aug 2007 05:36:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-select-statement/m-p/2604430#M596787</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-04T05:36:36Z</dc:date>
    </item>
  </channel>
</rss>

