<?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 job in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254402#M1528079</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;If I have understand the requirement properly then, in the initialization u can populate the start date and end date depending on the system date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amitava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Sep 2010 10:53:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-09-27T10:53:19Z</dc:date>
    <item>
      <title>background job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254397#M1528074</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;I have developed program with selection screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;parameter: plant&lt;/P&gt;&lt;P&gt;                   start_date&lt;/P&gt;&lt;P&gt;                   end_date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here start date current date 24.10.2010&lt;/P&gt;&lt;P&gt;        end_date background start  25.10.2010&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;once uploaded  next upload  should start 26.06.2010 like very next day .&lt;/P&gt;&lt;P&gt;how can i achieve this through background  scheduling .&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;K.Satyanarayana&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moderator message: please use more descriptive subject lines from now on.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Thomas Zloch on Sep 27, 2010 2:51 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Sep 2010 17:15:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254397#M1528074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-24T17:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: background job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254398#M1528075</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First estimate how long your program will execute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ex : exection time : 12 hours &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you could schedule your program for every 12 + 24 hours = 36 hours&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Sep 2010 17:39:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254398#M1528075</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-24T17:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: background job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254399#M1528076</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;Save a variant with selection variables for your date fields - you can use +/- number of days.  Then reference this variant in your batch job.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,   Andy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Sep 2010 21:30:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254399#M1528076</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-24T21:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: background job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254400#M1528077</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;create a dynamic variant and schedule your report as background job using that variant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ivan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Sep 2010 21:39:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254400#M1528077</guid>
      <dc:creator>_IvanFemia_</dc:creator>
      <dc:date>2010-09-24T21:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: background job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254401#M1528078</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 need to handle this with some coding..in ur program &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can schedule the job on daily basis but if user tries to run the job in foreground then the user msut be stopped from doing that .. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the below code to do that ..&lt;/P&gt;&lt;P&gt;perform run_in_background..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
form run_in_background.
  data:seltab  type rsparams occurs 0 with header line,
       jobnumber type tbtcjob-jobcount,
       jobname   type tbtcjob-jobname value sy-repid,
       print_parameters type pri_params.
  check sy-batch is initial.
  call function 'RS_REFRESH_FROM_SELECTOPTIONS'
    exporting
      curr_report     = sy-repid
    tables
      selection_table = seltab
    exceptions
      not_found       = 1
      no_report       = 2
      others          = 3.
  "it shouldn't be possible to have an exception here!
  call function 'JOB_OPEN'
    exporting
      jobname          = jobname
    importing
      jobcount         = jobnumber
    exceptions
      cant_create_job  = 1
      invalid_job_data = 2
      jobname_missing  = 3
      others           = 4.
  if sy-subrc &amp;lt;&amp;gt; 0.
    message 'Can''t create a new job' type 'E'.
  else.
    submit (sy-repid) with selection-table seltab
           via job jobname number jobnumber and return.
    if sy-subrc &amp;lt;&amp;gt; 0.
      message 'Error adding a step for background execution' type 'E'.
    else.
      call function 'JOB_CLOSE'
        exporting
          jobcount             = jobnumber
          jobname              = jobname
          strtimmed            = 'X'
        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 sy-subrc &amp;lt;&amp;gt; 0.
        message 'Can''t close the new job' type 'E'.
      else.
        message 'Background processing successfully scheduled' type 'S'.
      endif.
    endif.
  endif.
  leave program.
endform.         
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;br, &lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Sep 2010 02:15:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254401#M1528078</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-25T02:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: background job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254402#M1528079</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;If I have understand the requirement properly then, in the initialization u can populate the start date and end date depending on the system date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amitava&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Sep 2010 10:53:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254402#M1528079</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-09-27T10:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: background job</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254403#M1528080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;go to Tcode SM36 - Define Background Job, click on the "start condition" button on the application toolbar and there you will options to define the background job as your wish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Sep 2010 12:49:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/background-job/m-p/7254403#M1528080</guid>
      <dc:creator>former_member300258</dc:creator>
      <dc:date>2010-09-27T12:49:13Z</dc:date>
    </item>
  </channel>
</rss>

