<?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: Background Scheduling in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-scheduling/m-p/2174944#M461801</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are two ways for you to handle, &lt;/P&gt;&lt;P&gt;one manually setting up the job through SM36 which is better and convinient, &lt;/P&gt;&lt;P&gt;secondly through program using FM's JOB_OPEN, SUBMIT, JOB_CLOSE.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  Find below steps in doing both:&lt;/P&gt;&lt;P&gt;Procedure 1:&lt;/P&gt;&lt;P&gt;  1. Goto Trans -&amp;gt; SM36&lt;/P&gt;&lt;P&gt;  2. Define a job with the program and variant if any&lt;/P&gt;&lt;P&gt;  3. Click on start condition in application tool bar&lt;/P&gt;&lt;P&gt;  4. In the pop-up window, click on Date/Time&lt;/P&gt;&lt;P&gt;  5. Below you can see a check box "Periodic Job"&lt;/P&gt;&lt;P&gt;  6. Next click on Period Values&lt;/P&gt;&lt;P&gt;  7. Select "Other Period"&lt;/P&gt;&lt;P&gt;  8. Now give '15' for Minutes&lt;/P&gt;&lt;P&gt;  9. Save the job&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SM37 u can check the status of the jobs that u have assigned to background...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here u mention the job name or the report name to check the status of the job...&lt;/P&gt;&lt;P&gt;After mentioning the job name or program name u just execute it.. ( without any name also u can execute then it gives u all the jobs set by your user name..&lt;/P&gt;&lt;P&gt;the status colud be released,active,finished etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Procedure 2 via Program:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Below is a sample code for the same. Note the ZTEMP2 is the program i am scheduling with 15mins frequency.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: P_JOBCNT LIKE TBTCJOB-JOBCOUNT,
      L_RELEASE(1) TYPE c.
 
   CALL FUNCTION 'JOB_OPEN'
     EXPORTING
       JOBNAME                = 'ZTEMP2' 
    IMPORTING
      JOBCOUNT               = P_JOBCNT
    EXCEPTIONS
      CANT_CREATE_JOB        = 1
      INVALID_JOB_DATA       = 2
      JOBNAME_MISSING        = 3
      OTHERS                 = 4.
   IF SY-SUBRC &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.
 
   SUBMIT ZTEMP2 VIA JOB 'ZTEMP2' NUMBER P_JOBCNT
          TO SAP-SPOOL WITHOUT SPOOL DYNPRO 
          WITH DESTINATION = 'HPMISPRT'
          WITH IMMEDIATELY = SPACE
          WITH KEEP_IN_SPOOL = 'X' AND RETURN.
 
   CALL FUNCTION 'JOB_CLOSE'
     EXPORTING
       JOBCOUNT                          = P_JOBCNT
       JOBNAME                           = 'ZTEMP2' 
       STRTIMMED                         = 'X'
       PRDMINS                          = 15
    IMPORTING
      JOB_WAS_RELEASED                  = L_RELEASE
    EXCEPTIONS
      CANT_START_IMMEDIATE              = 1
      INVALID_STARTDATE                 = 2
      JOBNAME_MISSING                   = 3
      JOB_CLOSE_FAILED                  = 4
      JOB_NOSTEPS                       = 5
      JOB_NOTEX                         = 6
      LOCK_FAILED                       = 7
      INVALID_TARGET                    = 8
      OTHERS                            = 9.
   IF SY-SUBRC &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Hope the above helps you.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Reshma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 May 2007 05:41:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-04T05:41:19Z</dc:date>
    <item>
      <title>Background Scheduling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-scheduling/m-p/2174943#M461800</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;I  created one table  .But i have to fill this table from other existing standard table like BSIS,BSRG ,BSEC etc. I know somthing like backgrond scheduling is in SAP that can do this job.But exactly i don't know ,how to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please let me know the steps to do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My objective is " to fill the table from other existing table"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 05:37:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-scheduling/m-p/2174943#M461800</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T05:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Background Scheduling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-scheduling/m-p/2174944#M461801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are two ways for you to handle, &lt;/P&gt;&lt;P&gt;one manually setting up the job through SM36 which is better and convinient, &lt;/P&gt;&lt;P&gt;secondly through program using FM's JOB_OPEN, SUBMIT, JOB_CLOSE.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  Find below steps in doing both:&lt;/P&gt;&lt;P&gt;Procedure 1:&lt;/P&gt;&lt;P&gt;  1. Goto Trans -&amp;gt; SM36&lt;/P&gt;&lt;P&gt;  2. Define a job with the program and variant if any&lt;/P&gt;&lt;P&gt;  3. Click on start condition in application tool bar&lt;/P&gt;&lt;P&gt;  4. In the pop-up window, click on Date/Time&lt;/P&gt;&lt;P&gt;  5. Below you can see a check box "Periodic Job"&lt;/P&gt;&lt;P&gt;  6. Next click on Period Values&lt;/P&gt;&lt;P&gt;  7. Select "Other Period"&lt;/P&gt;&lt;P&gt;  8. Now give '15' for Minutes&lt;/P&gt;&lt;P&gt;  9. Save the job&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In SM37 u can check the status of the jobs that u have assigned to background...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here u mention the job name or the report name to check the status of the job...&lt;/P&gt;&lt;P&gt;After mentioning the job name or program name u just execute it.. ( without any name also u can execute then it gives u all the jobs set by your user name..&lt;/P&gt;&lt;P&gt;the status colud be released,active,finished etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Procedure 2 via Program:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Below is a sample code for the same. Note the ZTEMP2 is the program i am scheduling with 15mins frequency.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: P_JOBCNT LIKE TBTCJOB-JOBCOUNT,
      L_RELEASE(1) TYPE c.
 
   CALL FUNCTION 'JOB_OPEN'
     EXPORTING
       JOBNAME                = 'ZTEMP2' 
    IMPORTING
      JOBCOUNT               = P_JOBCNT
    EXCEPTIONS
      CANT_CREATE_JOB        = 1
      INVALID_JOB_DATA       = 2
      JOBNAME_MISSING        = 3
      OTHERS                 = 4.
   IF SY-SUBRC &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.
 
   SUBMIT ZTEMP2 VIA JOB 'ZTEMP2' NUMBER P_JOBCNT
          TO SAP-SPOOL WITHOUT SPOOL DYNPRO 
          WITH DESTINATION = 'HPMISPRT'
          WITH IMMEDIATELY = SPACE
          WITH KEEP_IN_SPOOL = 'X' AND RETURN.
 
   CALL FUNCTION 'JOB_CLOSE'
     EXPORTING
       JOBCOUNT                          = P_JOBCNT
       JOBNAME                           = 'ZTEMP2' 
       STRTIMMED                         = 'X'
       PRDMINS                          = 15
    IMPORTING
      JOB_WAS_RELEASED                  = L_RELEASE
    EXCEPTIONS
      CANT_START_IMMEDIATE              = 1
      INVALID_STARTDATE                 = 2
      JOBNAME_MISSING                   = 3
      JOB_CLOSE_FAILED                  = 4
      JOB_NOSTEPS                       = 5
      JOB_NOTEX                         = 6
      LOCK_FAILED                       = 7
      INVALID_TARGET                    = 8
      OTHERS                            = 9.
   IF SY-SUBRC &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Hope the above helps you.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Reshma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 05:41:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-scheduling/m-p/2174944#M461801</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T05:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: Background Scheduling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-scheduling/m-p/2174945#M461802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;First create a program&lt;/P&gt;&lt;P&gt;such that it fetches the data from other table into an internal table.&lt;/P&gt;&lt;P&gt;and with that internal table you can insert that data into your Z table.&lt;/P&gt;&lt;P&gt;So write the code first and you can assign this program in Background (if needed)&lt;/P&gt;&lt;P&gt;by scheduling a job in SM36 Tcode.&lt;/P&gt;&lt;P&gt;Create a variant for the program, Create a job in SM36 and schedule immediately&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful&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>Fri, 04 May 2007 05:42:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-scheduling/m-p/2174945#M461802</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T05:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Background Scheduling</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-scheduling/m-p/2174946#M461803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Reshma&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying..will get it...&lt;/P&gt;&lt;P&gt;thnx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 05:47:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-scheduling/m-p/2174946#M461803</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T05:47:41Z</dc:date>
    </item>
  </channel>
</rss>

