<?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 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/background/m-p/2570974#M587002</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;There are some standard function modules which will allow you to schedule programs in bakground - programatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer the help documentation &lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/fa/097720543b11d1898e0000e8322d00/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/fa/097720543b11d1898e0000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the module BP_JOBVARIANT_SCHEDULE, which has limited control or JOB_OPEN, JOB_SUBMIT, and JOB_CLOSE for full fledged control. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may have to create a wrapper report to accomodate these function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jul 2007 10:33:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-27T10:33:28Z</dc:date>
    <item>
      <title>background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background/m-p/2570972#M587000</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;             . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;How to schedule a Report in background using se38 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt; Ashok kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 10:30:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background/m-p/2570972#M587000</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-27T10:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background/m-p/2570973#M587001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;from the selection screen&lt;/P&gt;&lt;P&gt;menu&lt;/P&gt;&lt;P&gt;Program-&amp;gt; execute in Background&lt;/P&gt;&lt;P&gt;give Output device as LP01(default local printer)&lt;/P&gt;&lt;P&gt;then by default it goes to the Sm36&lt;/P&gt;&lt;P&gt;then set the parameters&lt;/P&gt;&lt;P&gt;click on Start Condition&lt;/P&gt;&lt;P&gt;Click on DATE and TIME enter date scheduled Start and END times&lt;/P&gt;&lt;P&gt;click on Period Values&lt;/P&gt;&lt;P&gt;Click on HOURLY/WEEKLY etc&lt;/P&gt;&lt;P&gt;CLick on RESTRICTIONS also to use further criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so your job will be scheduled and run as per your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and in SM37 Transaction check the status of that JOB&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this link for scheduling jobs..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a7f87505211d189550000e829fbbd/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a7f87505211d189550000e829fbbd/content.htm&lt;/A&gt;&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>Fri, 27 Jul 2007 10:32:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background/m-p/2570973#M587001</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-27T10:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background/m-p/2570974#M587002</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;There are some standard function modules which will allow you to schedule programs in bakground - programatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer the help documentation &lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/fa/097720543b11d1898e0000e8322d00/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/fa/097720543b11d1898e0000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the module BP_JOBVARIANT_SCHEDULE, which has limited control or JOB_OPEN, JOB_SUBMIT, and JOB_CLOSE for full fledged control. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may have to create a wrapper report to accomodate these function modules.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 10:33:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background/m-p/2570974#M587002</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-27T10:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background/m-p/2570975#M587003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ashok,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Gotto se38, provide the program name. in the menu Program -&amp;gt; Execute -&amp;gt; Background. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create the variant before executing the program. Provide this variant while executing the program in background. and also provide the schedule details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Satish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 10:35:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background/m-p/2570975#M587003</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-27T10:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background/m-p/2570976#M587004</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;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;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;Regards&lt;/P&gt;&lt;P&gt;Reshma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 10:35:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background/m-p/2570976#M587004</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-27T10:35:58Z</dc:date>
    </item>
    <item>
      <title>Re: background</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background/m-p/2570977#M587005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: lv_job_name         LIKE tbtco-jobname,
lv_job_nr           LIKE tbtco-jobcount,
lv_job_released     TYPE c,
lv_job_start_sofort TYPE c,
lv_print_parameters TYPE pri_params.
lv_job_name = 'Z_BG_PROG_NAME'.


*part for background processing

  CALL FUNCTION 'JOB_OPEN'
    EXPORTING
      jobname          = lv_job_name
    IMPORTING
      jobcount         = lv_job_nr
    EXCEPTIONS
      cant_create_job  = 1
      invalid_job_data = 2
      jobname_missing  = 3
      OTHERS           = 4.
  IF syst-subrc = 0.
*submit job with all the selection screen params...
    SUBMIT (lv_job_name)
        WITH applfile = applfile
        WITH p_lines = p_lines
        WITH rfc_dest = rfcdest
        WITH p_selmtd = lv_selmtd
        WITH px_shsim = px_shsim
        WITH px_sherr = px_sherr
        USER syst-uname
       VIA JOB lv_job_name NUMBER lv_job_nr AND RETURN.
    IF sy-subrc = 0.
      CALL FUNCTION 'JOB_CLOSE'
        EXPORTING
          jobcount             = lv_job_nr
          jobname              = lv_job_name
          strtimmed            = 'X'
        IMPORTING
          job_was_released     = lv_job_released
        EXCEPTIONS
          cant_start_immediate = 1
          invalid_startdate    = 2
          jobname_missing      = 3
          job_close_failed     = 4
          job_nosteps          = 5
          job_notex            = 6
          lock_failed          = 7
          OTHERS               = 8.
      IF syst-subrc &amp;lt;&amp;gt; 0.
        MESSAGE i162(00) WITH
        'An error occured while closing the background job.'.
        STOP.
      ENDIF.
    ENDIF.
  ENDIF.
  SKIP 1.
  WRITE: / 'Background process', lv_job_name , 'called successfully' NO-GAP.
  WRITE: / 'You can check the job in transaction SM37'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2007 10:46:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background/m-p/2570977#M587005</guid>
      <dc:creator>former_member189059</dc:creator>
      <dc:date>2007-07-27T10:46:16Z</dc:date>
    </item>
  </channel>
</rss>

