Problem in scheduling a Job after a Job is completed

Hi All,
      My requirement is to run a job say <b>JOB1</b> on a per minute basis and after finishing it I need to start another job say <b>JOB2</b> automatically.
      I have configured JOB1 to start and run on every minute (i.e)in start condition <b>'periodic values'</b> is marked as one minute and configured JOB2 in such a way that it starts after JOB1 is successfully executed (i.e) in start condition of JOB2 <b>'After Job'</b> is marked as JOB1 and <b>'start status-dependant'</b> checkbox as 'X'.
      JOB1 is running successfully for every minute.
The problem is JOB2 runs only for the first time when the JOB1 is successfully executed and doesn't start for the next minute after JOB1 is successfully executed.
Ex :
for Time 6:0:00 JOB1 Successful & JOB2 status Successful
for Time 6:1:00 JOB2 successful & JOB2 doesn't start
for Time 6:2:00 JOB2 successful & JOB2 doesn't start
          And goes on.
Thanks in advance for your help.
Thanks and Regards,
Siva

Hi Siva
  Just tested in my syste with <b>AFTER JOB</b>, and it works fine for me.
  Please check that naming conventions are same when you define the first job and use in second. Also please make sure that you have removed the values from other tabs.
  General mistake that we do is, when we define two jobs immediately i.e one after other we overlook values from the previous one. Please check the same as well.
Kind Regards
Eswar

Similar Messages

  • Periodic Background Jobs after another Job finishes

    Hi
    I have to schedule a job 'B' to run after job 'A' finishes.
    When i schedule job 'B' to run after job A , it runs only once , while i need the job B to run periodically after job A finishes.
    1) I cannt make job B as step 2 of job A , because job A is not scheduled by me and i cannt change that.
    Can anyone tell me how to i trigger the job B periodicaly after job A finishes .
    Any solution or hint would be appreciated.
    Looking forward to some helpful replies from the gurus of SAP.
    Regards
    Purva

    Dear Team,
    Job ES_RPTMC_CREATE_CHANGEPOINT_AUTH  ran only once where as SEC:INDX_UPDATE_FOR_STRUCT_AUTHS ran daily.
    CAUSE:
    “The start condition "Start after job" is internally mapped by means of "Start after event SAP_END_OF_JOB with the parameter <Jobname><Jobcount> of the predecessor". The pair <Jobname><Jobcount> is the unique key for a job.
    If a job is executed periodically, the SAP_END_OF_JOB event is always triggered with different parameters.
    The successor in turn waits for SAP_END_OF_JOB with just one particular parameter (this is the parameter with <Jobname><Jobcount> from the first predecessor). When the successor is rescheduled, the key fields from the next predecessor must therefore always be known in advance, something which is not always technically possible.”
    SOLUTION:
    This task can be completed with the new ABAP program Program  BTC_EVENT_RAISE.
    The program is delivered by Support Package for Basis Releases 640 and 700, and is included in the standard system in all subsequent releases.
    The program is used to trigger a batch event. Existing programs do not therefore have to be changed. The BTC_EVENT_RAISE program has several parameters in the selection screen, including the event (and parameters) that is to be triggered.
    PROCESS:
     Go To SM64
     Click on Create
     Create two events.
    Our Case:
    We created Z_ES_CP_AUTH and Z_SEC_AUTHS
     Go to SE38
     Give the event name as BTC_EVENT_RAISE
     Select Variants and click on Display
     Give the variant name as the one you created.
    Our Case:
    Z_ES_CP_AUTH
     Click on Create
     Give in the details for variants
     Click on attributes and give the details for attributes
     Go to the job which needs to be run first
    • Select the job in released status
    • Job->Change
    • Step
    • Add BTC_EVENT_RAISE as the last step of the job with the parameter as the variant created
    Our Case:
    Step: BTC_EVENT_RAISE, Parameter: Z_ES_CP_AUTH
     Go to the job which needs to be run next
    • Select the job in released status
    • Job->Change
    • Start Condition -> After Event.
    • Give the BTC_EVENT_RAISE parameter of the first job as the event of the second job.
    Our Case:
    After Event: Z_ES_CP_AUTH
     Save the changes.
     The jobs will start running one after the other with the given frequency.
    Thanks
    Joginadham U

  • How define background job, after a job,  daily

    Hi Gurus!
    i need to create several Jobs, one after another. i'm working with R/3 enterprise.
    I can create a Job after another, but I can't put it daily.
    anyone knows how I can define job, after a specific job, daily???
    THANKS!!!!

    Hi Oscar,
    If you want to execute the Background jobs one by one(sequence order),
    Goto <b>SM36</b> and create a Background job, then create another job then press <b>Start condition</b>, in this one there is  a tab after JOB, here give the job name, os the will be run after this job complets
    another way is there, if you want to run the jobs in a sequence, there is a <b>TAB called STEP</b>, create a Job name then press the tab STEP, here give the first job name then press the create button then create the second job name.. like this you can give N number of background Programs one by one
    hope you got the answer
    Thanks
    Sudheer

  • Trigger a job after all jobs have completed

    Hi All.
    I have a program which schedules several jobs based on some complex criteria maintained in a config table. Some of the jobs scheduled can be  in a chain, some can be independent.
    At the end of all these jobs which my program spurned off, I want to run another program which will collect their spools and send it in one shot to a recipient.
    How can I know when all my jobs have completed? I know I can look at TBTCO table - but can I trigger the spool sending program automatically based on completion of all jobs?
    The point is I do not know which job can complete at the end - otherwise I could have triggered an event from that last job.
    Any clues please?
    Thanks in adv.

    Hi Aishi,
    There's a simple trick you can apply..There's no need for the third party tools for this.
    Create a custom table with the fields for p_Date(Primary Key) and the fields for each program of the background jobs.
    Update the custom table with the value 'X' after each program is succesfully completed and check for all the fields in the table if they are all updated and if they are all updated then trigger the final batch job with the Event using
    FM "BP_EVENT_RAISE'.
    Hope you understood the logic.

  • How to schedule perioding BG job after job

    My requirement is i need to schedule periodic job on daily basis, suppose i have 2 jobs A and B...then i need to start job B only and only if job A is finished..
    Can you please guide me..

    You cannot specify a job as "periodic" if it is scheduled to start after a job. Refer [http://help.sap.com/saphelp_nw04/helpdata/en/20/2d513897110872e10000009b38f889/content.htm]
    You can achieve in 2 ways:
    1. Create a single job & define 2 steps.
    2. Use SAP Event to trigger the second job. At the end of the first job raise an event which will trigger the first job.
    BR,
    Suhas

  • Backup of background jobs after system refresh

    Hi All,
    I want to know that during the system refresh how can we take the backup of the background jobs which are in "Released" state so that we can schedule them the same way after the refresh is done. Presently we are taking the screen shot of "start condition" and "step" of each and every job and then using those screenshots we are scheduling them again after the refresh is completed. It would be really helpful and time saving for us if we come to know the tables where this information is stored and also if there is any other easier way for this.
    Regards,
    Lovneesh

    Hello,
    Check the below thread. It mentions all the tables that contain batch job information.
    https://scn.sap.com/thread/1709175
    " Check below mentioned tables
    BTCCTL,
    BTCDELAY
    BTCEVTJOB
    BTCH1000
    BTCH1010
    TBTCO
    TBTCP
    These have all the information you need regarding background jobs, you may export these tables at the source and import them "
    Check and provide feedback.
    Regards,
    Mudasir

  • Insert step after data transfer is complete within TDMS package

    Hello,
    we want to start some jobs after data transfer is complete within TDMS package. For example we want to start the function DELETE_DATA_FOR_ALL_MI_DEVICES. Is this possible or is it possible to start any ABAP report or batchjob?
    Kind regards,
    Karlheinz

    Dear Karlheinz,
    It is possible starting DMIS SP07 where you will find an option on the process tree in the work center that says 'Customize Monitor'. This option will you guide through creation of new activities, deletion of existing activities. You have to however create a Z report that pertains to the new activity and maintain some activity definitions.
    Regards,
    Amit Sharma

  • Problem while Scheduling Archive Jobs from SXMB_ADM

    Dear all,
    I am using this blog to delete and archive messages.
    /people/deepak.shah/blog/2010/04/22/archiving-deletion-of-messages-in-pi--part-2
    I have configured Retention periods from SXMB_ADM and there by scheduled Archive Jobs through SXMB_ADM itself.
    Now when i check in SM37, after Archive jobs scheduled , i am not able to see 2 jobs as described in this Blog.
    i am able to see only one Job with name "SAP_BC_XMB_ARCHIVE200"
    Please assist me what might be the problem
    Regards

    Hi Ganesh,
    Thank you for replying. Once this SAP_BC_XMB_ARCHIVE200 is finished, one more job has been generated
    ARV_BC_XMB_WRP20100602112115. But this is not for deletion . it is doing archiving
    When i check the log, SAP_BC_XMB_ARCHIVE200 contains the program as RSXMB_ARCHIVE_PLAN
    and ARV_BC_XMB_WRP20100602112115 job contains the program as RSXMB_ARCHIVE_MESSAGES
    There is no job generated for deletion of Archived ones.
    >>Deletion job starts automatically if in archiving setting u have selected START AUTOMATICALLY option for deletion .
    Could you please let me know where this should be done while doing Archiving jobs??
    Regards

  • Scheduled Background jobs after Client Copy

    Hello,
    I've been doing some searching online and I don't seem to be able to find a definitive answer to this question:
    Are background jobs client specific?
    I've seen some discussions on here say some are and some are not.  I've also seen a discussion that says ALL background jobs are client specific.
    It's really related to non-SAP background jobs after a client copy.
    If I have a client 100 in QA with half a dozen non-SAP standard jobs configured, and I create client 110 in QA and perform a remote client copy from PROD into client 110 on QA, will my non-SAP standard backgrounds run in Client 110, or do I need to set them all up again?
    Thanks

    Hello All
    If I have a client 100 in QA with half a dozen non-SAP standard jobs configured, and I create client 110 in QA and perform a remote client copy from PROD into client 110 on QA, will my non-SAP standard backgrounds run in Client 110, or do I need to set them all up again?
    Yes. You will need to set those non standard jobs in the new client. When you schedule a job there will be a reference to the client where the job will be executed is stored under AUTHCKMAN in the table TBTCO. If the job is scheduled periodically then the job is executed only on the client where it is scheduled.
    I used SAP_ALL profile when performing the client copy.  So my scheduled jobs WILL have been copied along with everything else? Is that correct?
    In SAP_ALL profile the background jobs will be coming from source client not from QA client 100.
    No. Background jobs are not transportable and will not be copied during a client copy. Job definitions are client independent.
    Read these SAP notes.
    31503 - FAQ: Background jobs
    51135 - Why are bkgd processing jobs not generally transportable?
    If you want to schedule those jobs in the new client the follow the suggestion in the SAP note 3150 point 6.
    Regards
    RB

  • Scheduling job after event

    Hi experts,
    I need to schedule a job after user has changed material data through MM42; how to do this ?
    Thanks a lot in advance !
    Marco Cerdelli

    <unrelated SM36 how-to removed by moderator>
    regds,
    rasmi ranjan mishra
    Moderator message: please read question and replies properly before posting.
    Edited by: Thomas Zloch on Nov 8, 2010 11:25 AM

  • SAP Scheduler. Multiple jobs for one job definition issue.

    Hi.
    I am facing one problem concerning scheduling jobs. I've created a job definition and deployed it on server. In onJob(...) method system queries to DB for a single result, when this result matches some conditions job is finished, otherwise it waits for a minute and then queries again. Then I tried to create several tasks for this job definition and set similar execution time for all tasks to check their simultaneous behavior. I was surprised to find out that only one job status is 'RUNNING' and for others status is 'STARTING'. But I expected to see all my jobs in status 'RUNNING'. At first I thought the problem was in MDB pool stuff(e.g. InitialSize of beans or something like that), supposing that there is only one working bean and huge queue  of messages. But nothing changed after setting different values for pool params.
    So, can anyone help me to make at least 2 simultaneous working  jobs for one job definition, if it possible, off cause. Or may be I am wrong somewhere. (By the way, I used Threads in MDB for waiting).
    Thanks in advance.

    May be I described my problem rather messy. The main question is it possible to create several jobs for one job definition and see them running at the same time (simultaneously)?
    Thanks.

  • Problems creating background job for program (job open, submit and close)

    Hi gurus,
    im trying to start a background job using the FM BP_START_DATE_EDITOR to show the start date to the job or if it's imediate. this FM it's working fine, after call it im opening a job, submiting it and call the job close FM and the job close FM creates me the job.
    The problem it's when i go to the sm37 to see the job status the job has been canceled, and the job log says that i have to give a start date to the job.
    What i dont understand it's either the job is imediate or i choose a date to start the job always gives me this error...
    Below goes my code,
    any ideas will be rewarded
      CLEAR: stdt_modify_type, stdt_output.
      CALL FUNCTION 'BP_START_DATE_EDITOR'
           EXPORTING
                stdt_dialog                    = 'Y'
                stdt_input                     = stdt_input
                stdt_opcode                    = 14
           IMPORTING
                stdt_modify_type               = stdt_modify_type
                stdt_output                    = stdt_output
           EXCEPTIONS
                fcal_id_not_defined            = 1
                incomplete_last_startdate      = 2
                incomplete_startdate           = 3
                invalid_dialog_type            = 4
                invalid_eventid                = 5
                invalid_opcode                 = 6
                invalid_opmode_name            = 7
                invalid_periodbehaviour        = 8
                invalid_predecessor_jobname    = 9
                last_startdate_in_the_past     = 10
                no_period_data_given           = 11
                no_startdate_given             = 12
                period_and_predjob_no_way      = 13
                period_too_small_for_limit     = 14
                predecessor_jobname_not_unique = 15
                startdate_interval_too_large   = 16
                startdate_in_the_past          = 17
                startdate_is_a_holiday         = 18
                startdate_out_of_fcal_range    = 19
                stdt_before_holiday_in_past    = 20
                unknown_fcal_error_occured     = 21
                no_workday_nr_given            = 22
                invalid_workday_countdir       = 23
                invalid_workday_nr             = 24
                notbefore_stdt_missing         = 25
                workday_starttime_missing      = 26
                no_eventid_given               = 27
                OTHERS                         = 28.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        MOVE 'X' TO gv_flag.
      ENDIF.
      DATA jobname LIKE tbtcjob-jobname.
      DATA jobcount LIKE tbtcjob-jobcount.
      DATA job_release LIKE  btch0000-char1.
      DATA job_imediate TYPE c.
      CLEAR: jobname, jobcount, job_release.
      CONCATENATE 'MAPAEXEC' sy-uname sy-datum
                   INTO jobname SEPARATED BY space.
      CALL FUNCTION 'JOB_OPEN'
           EXPORTING
                jobname          = jobname
           IMPORTING
                jobcount         = jobcount
           EXCEPTIONS
                cant_create_job  = 1
                invalid_job_data = 2
                jobname_missing  = 3
                OTHERS           = 4.
      IF sy-subrc <> 0.
        MESSAGE i003(zmapas).
        EXIT.
      ENDIF.
      SUBMIT z_mapa_execucao_orcamental
             VIA JOB jobname NUMBER jobcount
             WITH ano EQ ano
             WITH so_perio IN so_perio
             WITH so_date IN so_date
             WITH so_org EQ so_org
             WITH so_num IN so_num
             AND RETURN.
      IF stdt_output-startdttyp EQ 'I'.
        CLEAR job_imediate.
        job_imediate = 'X'.
      ENDIF.
      CALL FUNCTION 'JOB_CLOSE'
           EXPORTING
                calendar_id                 = stdt_output-calendarid
                event_id                    = stdt_output-eventid
                event_param                 = stdt_output-eventparm
                event_periodic              = stdt_output-periodic  "?
                jobcount                    = jobcount
                jobname                     = jobname
                laststrtdt                  = stdt_output-laststrtdt
                laststrttm                  = stdt_output-laststrttm
                prddays                     = stdt_output-prddays  "??
                prdhours                    = stdt_output-prdhours  "?
                prdmins                     = stdt_output-prdmins  "??
                prdmonths                   = stdt_output-prdmonths
                prdweeks                    = stdt_output-prdweeks  "?
                predjob_checkstat           = stdt_output-checkstat
                pred_jobcount               = stdt_output-predjobcnt
                pred_jobname                = stdt_output-predjob
                sdlstrtdt                   = stdt_output-sdlstrtdt
                sdlstrttm                   = stdt_output-sdlstrttm
                strtimmed                   = job_imediate
                targetsystem                = stdt_output-instname
                start_on_workday_not_before = stdt_output-notbefore
                start_on_workday_nr         = stdt_output-wdayno
                workday_count_direction     = stdt_output-wdaycdir
           IMPORTING
                job_was_released            = job_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
                OTHERS                      = 8.
      IF sy-subrc <> 0.
        MESSAGE i003(zmapas).
        EXIT.
      ELSE.
        MESSAGE i004(zmapas) WITH jobname.
      ENDIF.
    Thanks in advance,
    Best Regards
    João Martins

    Hello João.
    In debug mode, check the value of variables you passed to parameters sdlstrtdt and sdlstrttm.
    As aditional info, I usually achieve your goal without FM BP_START_DATE_EDITOR.
    Check this code:
    CALL FUNCTION 'JOB_OPEN'
          EXPORTING
               jobname          = w_jobname
          IMPORTING
               jobcount         = w_jobcount
          EXCEPTIONS
               cant_create_job  = 1
               invalid_job_data = 2
               jobname_missing  = 3
               OTHERS           = 4.
    CHECK sy-subrc = 0.
    CLEAR seltab_wa.
    MOVE: t_jobs-param TO seltab_wa-selname,
    t_processar-line+34 TO seltab_wa-low.
    APPEND seltab_wa TO seltab.
    seltab_wa-selname = 'P_LOJA'.
    seltab_wa-low = t_processar-ficheiro+7(4).
    APPEND seltab_wa TO seltab.
    *** Submete o programa para o JOB
    SUBMIT (t_jobs-repid)
      WITH  SELECTION-TABLE seltab
      USER sy-uname
       VIA JOB w_jobname NUMBER w_jobcount
       AND RETURN.
    *** Encerra o JOB
      l_hora = sy-uzeit.
      ADD 60 TO l_hora.
    CALL FUNCTION 'JOB_CLOSE'
       EXPORTING
          jobcount           = w_jobcount
          jobname           = w_jobname
          sdlstrtdt            = sy-datum
          sdlstrttm           = l_hora
          targetserver       = w_servidor
       IMPORTING
          job_was_released     = l_liberado
       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.
    Regards.
    Valter Oliveira.

  • How to stop jobs after a system copy

    Hi All,
    After doing a system copy from the Production system to some test system, all the jobs that are supposed to be triggered in the production server will also trigger in the test system which is not good.
    For example, If we have a payroll running every month. After i do a system copy the same payroll will also be triggered in the test server which is un acceptable.
    How do we go about it and what are all the steps that we need to follow after a system copy?
    Points will be rewarded.
    Thanks
    Vijay

    Hello Vijay,
    you surely need background processes in a running system.
    But you can start a SAP system without any background processes.
    When the system is up you go to sm37 and delete (or de-release) all the jobs you don't need in the target system. Then set the number of batch processes to the amount you want and restart the system.
    Alternatively you can prepare your source system accordingly with the SAP System Copy Guide - Section 3.2 Technical Preparations:
    "Set all released jobs from Released to Scheduled:
    Tools -> CCMS -> Background Processing -> Jobs - Overview and Administration (transaction SM37)
    You also need to do this for jobs that must run periodically (see SAP Note 16083).
    Select all jobs (include start after event) as follows:
    Job -> Released -> Scheduled"
    I think the best way for you is to read this guide!
    Everything is explained very well there.
    Goto:
    https://service.sap.com/systemcopy
    In the left tree select:
    -> SAP Netweaver
    -> SAP Netweaver in Detail
    -> Software Life-Cycle Management
    -> System Copy & Migration
    -> Media Library
    There are all the Guides for the current releases.
    Regards, Michael
    Message was edited by:
            Michael Teubner

  • Back ground jobs after upgradation

    Hi Experts
    Can you please clarify whether the back ground jobs and the time schedules of the back ground jobs will be copied after upgrade from 4.6b system to ECC.60 or do we need to configure and schedule the back ground jobs through sm37 after upgrade?
    Please post as soon as possible.
    Thanks & Regards
    Roja

    I think it depends on the server that is copied in the Upgraded Box. If you copy the data from Production, the jobs should be intact.
    If you copied Production data, then compare the scheduled jobs in both environments.
    If helps, pl do reward
    Thanks
    Narasimha

  • How stop the automatic statistics collection job after the maintenance wind

    Hi,
    we are for a solution to stop the automatic statistics collection job after the maintenance window finished.
    we disable all jobs except the automatic statistics collection, because this is the only one we want to run. Then we define specific values for the interval and duration parameters of the maintenance window to customize this task.
    But for their systems it is very important that this job/task will immediately stop when the window is closed!!!
    So, how could we ensure this behavior.
    For Oracle 10g it is easy because the statistic job always exists and it is possible to set its duration and create an addtional event based job which kills all jobs that are running over duration.
    In Oracle 11g the statistic job is created by the system during the maintenance window is open.
    We are not able to modify parameters of this system job. After the maintenance window closed the job is already running - only with another resource priority - but it is running.
    Please help me in this scenario
    Thanks&Regards
    Prem

    ?So basically you are saying is if none of the tables are changed then GATHER_STATS_JOB will not run, but i see tables are updated still the job is not running. I did >query dba_scheduler_jobs and the state of the job is true and scheduled. Please see my previous post on the output
    Am i missing anything here, do i look for some parameters settings
    So basically you are saying is if none of the tables are changed then GATHER_STATS_JOB will not run,GATHER_STATS_JOB will run and if there are any table in which there's a 10 percent change in data, it will gather statistics on that table. If no table data have changes less than 10 percent, it will not gather statistics.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/stats.htm#i41282
    Hope this helps.
    -Anantha

Maybe you are looking for

  • How do I copy and paste vector art from one layer to another, keeping all of its attributes?

    When I copy a vector shape from one layer to another, the shape picks up the color attributes of an existing shape in the second layer (or sometimes only the outline of the shape appears). What to I do to avoid this from happening (I just just want t

  • How to run a server program in the background on Linux or Windows?

    I just finished writing a Java network application with multiple clients and one server. However, I am not sure how I can run the server (SomeServer.class) in the background on Windows. Also when I am running it on Linux, I don't want it to terminate

  • Cannot Join a WPA2-Encrypted Network

    Hello all, I have the iPad Wi-Fi+3G. At work we have 2 wireless networks served by Cisco WAP4410N access points. One is encrypted with 128-bit WEP and the other is WPA2-Personal Mixed. Both are set to 802.11b/g/n, and they have different SSID's. The

  • Keeps asking for my password sometimes takes it sometimes doesn't

    I very much appreciate your help and expertise --- Thunderbird keeps asking for my password. I use it for both a non gmail account and a gmail account. Both accounts have repeatedly asked for the password... however the gmail account seems to work be

  • Iterate

    Hi, I have a jsp file which contains a table(tr and td's). I want to access a field from a database table, for instance i want to fetch all names from name field which should be displayed inside a table structure. How to iterate this inside a table s