<?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: start new task for select statements in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714290#M312267</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : write this program into separate include.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to divide 4 tasks here is the logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Create 4 rangeas and fill dates i mean each range contains 1 week dates. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do 4 times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) *job open&lt;/P&gt;&lt;P&gt;  call function 'JOB_OPEN'&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      jobname  = p_job&lt;/P&gt;&lt;P&gt;    importing&lt;/P&gt;&lt;P&gt;      jobcount = l_jobcount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) submit &amp;lt;b&amp;gt;zprogram_name&amp;lt;/b&amp;gt; with s_date in  r_datum&lt;/P&gt;&lt;P&gt;                               with s_kunnr in r_kunnr&lt;/P&gt;&lt;P&gt;                            via job p_job&lt;/P&gt;&lt;P&gt;                            number l_jobcount&lt;/P&gt;&lt;P&gt;                            and return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) *job close&lt;/P&gt;&lt;P&gt;  call function 'JOB_CLOSE'&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      jobcount  = l_jobcount&lt;/P&gt;&lt;P&gt;      jobname   = p_job&lt;/P&gt;&lt;P&gt;      strtimmed = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just execute new include in background it will create 4 back ground jobs (for 4 weeks) with in 5secs. Each job execute paralally offcourse depends on processes availablity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********&lt;STRONG&gt;Poorna&lt;/STRONG&gt;********&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Oct 2006 08:32:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-25T08:32:31Z</dc:date>
    <item>
      <title>start new task for select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714284#M312261</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 have question,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to select documents from BKPF depending on selection screen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen:&lt;/P&gt;&lt;P&gt;s_bukrs ____&lt;/P&gt;&lt;P&gt;s_budat ____      ____&lt;/P&gt;&lt;P&gt;s_monat ____      ____&lt;/P&gt;&lt;P&gt;s_gjahr ____      ____&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for a particular CC for one month there are huge no or records, because of that its taking hrs and hrs to run. I am following the Indices and fields order , no into corresponding fields ...everything...its just because of no of records its taking time.. for those no of records I need to select item data from BSEG table which is more time consuming.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my question is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to divide the 1 mon period into 4 weeks and select 4 times at a time in background task so that 4 work processers are used instead of 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg: if I give for 1 mon 01/01/2006 - 01/31/2006&lt;/P&gt;&lt;P&gt;I want to split it into&lt;/P&gt;&lt;P&gt;01/01/2006  01/08/2006&lt;/P&gt;&lt;P&gt;01/09/2006  01/16/2006&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.           01/31/2006.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select individually for these dates at a time into 4 Internal tables, I hope any one understood what I mean. Is that Possible ?&lt;/P&gt;&lt;P&gt;Am I asking too much ?&lt;/P&gt;&lt;P&gt;please let me know the solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2006 21:09:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714284#M312261</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-24T21:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: start new task for select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714285#M312262</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;Do you want to split the tasks for the BKPF select or the BSEG select??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naren&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2006 21:15:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714285#M312262</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-24T21:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: start new task for select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714286#M312263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi narendran,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I can split for BKPF select then I want to split for BSEG select also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;KP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2006 21:42:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714286#M312263</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-24T21:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: start new task for select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714287#M312264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before doing anything major, make sure that your select is using an index. If your first select looks something like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  SELECT  *
    FROM bkpf
    INTO TABLE bkpf_int
    WHERE bukrs EQ p_bukrs
    AND budat = pst_dt
    AND monat = ?
    AND gjahr EQ p_gjahr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Change it to:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  SELECT  *
    FROM bkpf
    INTO TABLE bkpf_int
    WHERE bukrs EQ p_bukrs
    AND bstat IN (' ', 'A', 'B', 'D', 'M', 'S', 'V', 'W', 'Z')
    AND budat = pst_dt
    AND monat = ?
    AND gjahr EQ p_gjahr.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Adding all of the possible values of BSTAT will not change the result, but it will cause the SELECT to use a secondary index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you do this properly, you won't have to worry about the BSEG select timing out. (But you may have to worry about memory.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rob Burbank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2006 21:43:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714287#M312264</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-24T21:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: start new task for select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714288#M312265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My select is similar to your select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT  *&lt;/P&gt;&lt;P&gt;    FROM bkpf&lt;/P&gt;&lt;P&gt;    INTO TABLE bkpf_int&lt;/P&gt;&lt;P&gt;    WHERE bukrs EQ p_bukrs&lt;/P&gt;&lt;P&gt;    AND bstat IN (' ', 'A', 'B', 'D', 'M', 'S', 'V', 'W', 'Z')&lt;/P&gt;&lt;P&gt;    AND budat = pst_dt&lt;/P&gt;&lt;P&gt;    AND monat = ?&lt;/P&gt;&lt;P&gt;    AND gjahr EQ p_gjahr.&lt;/P&gt;&lt;P&gt;My select&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT  *&lt;/P&gt;&lt;P&gt;    FROM bkpf&lt;/P&gt;&lt;P&gt;    INTO TABLE bkpf_int&lt;/P&gt;&lt;P&gt;    WHERE bukrs EQ s_bukrs&lt;/P&gt;&lt;P&gt;    AND bstat &amp;lt;= 'B'&lt;/P&gt;&lt;P&gt;    AND budat in s_budat&lt;/P&gt;&lt;P&gt;    AND monat in s_monat&lt;/P&gt;&lt;P&gt;    AND gjahr EQ s_gjahr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not selecting all fields only 7 fields which I have declared in the Internal table in order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know the best solution.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;KP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Oct 2006 21:50:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714288#M312265</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-24T21:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: start new task for select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714289#M312266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indexes work best when testing for equality. See if this works any better:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT * FROM bkpf
  INTO TABLE bkpf_int
  WHERE bukrs EQ s_bukrs
    AND bstat IN (' ', 'A', 'D', 'M', 'S', 'V', 'W', 'Z')
    AND budat in s_budat
    AND monat in s_monat
    AND gjahr EQ s_gjahr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;(IE - remove 'B'.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did some testing of this. The method I described gives a substantial performance boost.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rob Burbank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems to me that this should have helped. Can you tell me if it did?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 02:39:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714289#M312266</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-25T02:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: start new task for select statements</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714290#M312267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : write this program into separate include.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to divide 4 tasks here is the logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Create 4 rangeas and fill dates i mean each range contains 1 week dates. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do 4 times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) *job open&lt;/P&gt;&lt;P&gt;  call function 'JOB_OPEN'&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      jobname  = p_job&lt;/P&gt;&lt;P&gt;    importing&lt;/P&gt;&lt;P&gt;      jobcount = l_jobcount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) submit &amp;lt;b&amp;gt;zprogram_name&amp;lt;/b&amp;gt; with s_date in  r_datum&lt;/P&gt;&lt;P&gt;                               with s_kunnr in r_kunnr&lt;/P&gt;&lt;P&gt;                            via job p_job&lt;/P&gt;&lt;P&gt;                            number l_jobcount&lt;/P&gt;&lt;P&gt;                            and return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) *job close&lt;/P&gt;&lt;P&gt;  call function 'JOB_CLOSE'&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      jobcount  = l_jobcount&lt;/P&gt;&lt;P&gt;      jobname   = p_job&lt;/P&gt;&lt;P&gt;      strtimmed = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just execute new include in background it will create 4 back ground jobs (for 4 weeks) with in 5secs. Each job execute paralally offcourse depends on processes availablity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;********&lt;STRONG&gt;Poorna&lt;/STRONG&gt;********&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Oct 2006 08:32:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/start-new-task-for-select-statements/m-p/1714290#M312267</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-25T08:32:31Z</dc:date>
    </item>
  </channel>
</rss>

