Job event and chain

Hello,
i have job "MAIN_JOB" which raise event JOB_SUCCEEDED, second job "LITTLE_JOB" consume this event.
But i have one problem. MAIN_JOB starts chain "MAIN_CHAIN", and always when each step of this chain completed succesfull,
job "MAIN_JOB" raise event "JOB_SUCCEEDED".
How to do so "MAIN_JOB" raise event only once, not for each step?
DBMS_SCHEDULER.CREATE_JOB
job_name => 'MAIN_JOB'
,schedule_name => 'ANY_SCHEDULE'
,job_class => 'DEFAULT_JOB_CLASS'
,job_type => 'CHAIN'
,job_action => 'MAIN_CHAIN'
DBMS_SCHEDULER.SET_ATTRIBUTE
( name => 'MAIN_JOB'
,attribute => 'RAISE_EVENTS'
,value => DBMS_SCHEDULER.JOB_SUCCEEDED);
DBMS_SCHEDULER.CREATE_EVENT_SCHEDULE
schedule_name => 'EVENT_SCHED'
,start_date => to_date('01.01.2012 00:00:00','dd.mm.yyyy hh24:mi:ss')
,event_condition => 'tab.user_data.object_name = ''MAIN_JOB'' and tab.user_data.event_type = ''JOB_SUCCEEDED'''
,queue_spec => 'SYS.SCHEDULER$_EVENT_QUEUE, REPORT'
,end_date => NULL
DBMS_SCHEDULER.CREATE_JOB
job_name => 'LITTLE_JOB'
,schedule_name => 'EVENT_SCHED'
,program_name => 'SOME_PROGRAMM'
,auto_drop => false
,enabled => true
Thx.
Edited by: dbms_alec on 13.05.2012 23:44

This is because for each step of chain a job is run. For your request don't set job attribute to raise event but create a step for chain job that raise this event from code. Put this step as last step in chain job.

Similar Messages

  • Export scheduler job but chain step and chain rule failed with ORA-24150 ORA-06512 during executed sql script.

    Hi Folks,
    I used expdp utility to export all Oracle scheduler jobs and chains with below method, after that generate sql script by impdp, later on executing sql script encountered some errors.
    Only chain step and chain rule for executing script. Does anyone bright me some light? Thanks!
    My env: Oracle 11g + Oracle Linux 5.5
    My steps as below:
    1. export(expdp) oracle scheduler job(chain)
    2. generate sql script by impdp.
    3. remove orginal scheduler job(chain)
    4. execute sql script
    5. job with no chain well but job with chain failed
    [oracle@linux1 ~]$ expdp scott/tiger directory=db_dump_dir dumpfile=scott_job.dmp include=procobj:\" in \(select \
    > name from sys.obj$ where type\# in \(46,59,66,67,68,69,72,74,79\)\)\"  schemas=scott
    Export: Release 11.2.0.1.0 - Production on Tue Dec 3 17:42:31 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    Starting "SCOTT"."SYS_EXPORT_SCHEMA_01":  scott/******** directory=db_dump_dir dumpfile=scott_job.dmp include=procobj:" in (select name from sys.obj$ where type# in (46,59,66,67,68,69,72,74,79))" schemas=scott
    Estimate in progress using BLOCKS method...
    Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
    Total estimation using BLOCKS method: 0 KB
    Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    Master table "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
    Dump file set for SCOTT.SYS_EXPORT_SCHEMA_01 is:
      /u03/database/usbo/BNR/dump/scott_job.dmp
    Job "SCOTT"."SYS_EXPORT_SCHEMA_01" successfully completed at 17:42:54
    [oracle@linux1 ~]$ impdp scott/tiger sqlfile=scott_job.sql directory=db_dump_dir dumpfile=scott_job.dmp logfile=imp_scott_job.log
    Import: Release 11.2.0.1.0 - Production on Tue Dec 3 17:43:04 2013
    Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
    Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    Master table "SCOTT"."SYS_SQL_FILE_FULL_01" successfully loaded/unloaded
    Starting "SCOTT"."SYS_SQL_FILE_FULL_01":  scott/******** sqlfile=scott_job.sql directory=db_dump_dir dumpfile=scott_job.dmp logfile=imp_scott_job.log
    Processing object type SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    Job "SCOTT"."SYS_SQL_FILE_FULL_01" successfully completed at 17:43:07
    [oracle@linux1 ~]$ more /u03/database/usbo/BNR/dump/scott_job.
    scott_job.dmp  scott_job.sql 
    [oracle@linux1 ~]$ more /u03/database/usbo/BNR/dump/scott_job.sql
    -- CONNECT SCOTT
    ALTER SESSION SET EVENTS '10150 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10904 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '25475 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10407 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '10851 TRACE NAME CONTEXT FOREVER, LEVEL 1';
    ALTER SESSION SET EVENTS '22830 TRACE NAME CONTEXT FOREVER, LEVEL 192 ';
    -- new object type path: SCHEMA_EXPORT/POST_SCHEMA/PROCOBJ
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_1"','1=1',NULL, 'First link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_2"',':"CHAIN_STEP_1".COMPLETED = ''TRUE''',NULL, 'Second link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_3"',':"CHAIN_STEP_2".COMPLETED = ''TRUE''',NULL, 'Third link in the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule('"SCOTT"','"CHAIN_RULE_4"',':"CHAIN_STEP_3".COMPLETED = ''TRUE''',NULL, 'End of the chain.',0,NULL);
    END;
    COMMIT;
    END;
    BEGIN
    BEGIN
    dbms_rule_imp_obj.import_rule_set('"SCHED_RULESET$1"','"SCHED_EV_CTX$1"',NULL, 0);
    END;
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_1"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_1'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for first link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_3"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_3'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for last link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_program('"TEST_PROC_2"','PLSQL_BLOCK',
    'BEGIN
                             INSERT INTO tb_schduler (id, descr, cr_date)
                             VALUES (tb_schduler_seq.NEXTVAL, ''test_proc_2'', SYSDATE);
                             COMMIT;
                           END;'
    ,0, TRUE,
    'Program for second link in the chain.'
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
    , rule_set_name=>'"SCHED_RULESET$1"   '
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
    dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
    COMMIT;
    END;
    BEGIN
    dbms_scheduler.create_job('"TEST_CHAIN_1_JOB"',
    job_type=>'CHAIN', job_action=>
    'test_chain_1'
    , number_of_arguments=>0,
    start_date=>TO_TIMESTAMP_TZ('03-DEC-2013 05.38.56.718161000 PM +08:00','DD-MON-RRRR HH.MI.SSXFF AM TZR','NLS_DATE_LANGUAGE=english'), repeat_interval=>
    'freq=minutely; interval=2'
    , end_date=>TO_TIMESTAMP_TZ('03-DEC-2013 06.08.56.000000000 PM +08:00','DD-MON-RRRR HH.MI.SSXFF AM TZR','NLS_DATE_LANGUAGE=english'),
    job_class=>'"DEFAULT_JOB_CLASS"', enabled=>FALSE, auto_drop=>TRUE,comments=>
    NULL
    COMMIT;
    END;
    [oracle@linux1 ~]$ export ORACLE_SID=usbo
    [oracle@linux1 ~]$ sqlplus / as sysdba
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 3 17:44:43 2013
    Copyright (c) 1982, 2009, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    With the Partitioning, Real Application Clusters, OLAP, Data Mining
    and Real Application Testing options
    sys@USBO> show parameter db_name
    NAME                                 TYPE                              VALUE
    db_name                              string                            usbo
    sys@USBO> conn scott/tiger;
    Connected.
    --remove job and chain.
    scott@USBO> EXEC DBMS_SCHEDULER.drop_job(job_name => 'test_chain_1_job');
    EXEC DBMS_SCHEDULER.drop_chain (chain_name  => 'test_chain_1');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_1');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_2');
    EXEC DBMS_SCHEDULER.drop_program (program_name  => 'test_proc_3');
    PL/SQL procedure successfully completed.
    scott@USBO> @/u03/database/usbo/BNR/dump/scott_job.sql
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    Session altered.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    BEGIN
    ERROR at line 1:
    ORA-24150: evaluation context SCOTT.SCHED_EV_CTX$1 does not exist
    ORA-06512: at "SYS.DBMS_RULEADM_INTERNAL", line 28
    ORA-06512: at "SYS.DBMS_RULE_IMP_OBJ", line 40
    ORA-06512: at line 3
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    PL/SQL procedure successfully completed.
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    PL/SQL procedure successfully completed.

    Thanks all of you!
    Hi DK2010,
    I took some test that the data dict(dba_rule_sets/dba_evaluation_contexts) no any data returned after I had removed the job.
    So I tried to create evaluation context and re-executed script(only exception setion.) the first error has gone. For the second still have some issue.
    ---->no any returned
    scott@USBO> select * from dba_rule_sets where rule_set_owner='SCOTT';       
    no rows selected
    scott@USBO> select * from dba_evaluation_contexts WHERE evaluation_context_owner='SCOTT';
    no rows selected
    -->add new EVALUATION CONTEXT
    scott@USBO> exec DBMS_RULE_ADM.CREATE_EVALUATION_CONTEXT('SCOTT.SCHED_EV_CTX$1');
    PL/SQL procedure successfully completed.
    --->now it looks fine
    scott@USBO> BEGIN
      2  BEGIN
      3  dbms_rule_imp_obj.import_rule_set('"SCHED_RULESET$1"','"SCHED_EV_CTX$1"',NULL, 0);
      4  END;
      5 
      6  COMMIT;
      7  END;
      8  /
    PL/SQL procedure successfully completed.
    --->add new rule set, it prompt aleady exists
    scott@USBO> exec DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1') 
    BEGIN DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1'); END;
    ERROR at line 1:
    ORA-24153: rule set SCOTT.SCHED_RULESET$1 already exists
    ORA-06512: at "SYS.DBMS_RULEADM_INTERNAL", line 28
    ORA-06512: at "SYS.DBMS_RULE_ADM", line 138
    ORA-06512: at line 1
    -->chain rule still could not find.
    scott@USBO> @job_chain_rules.sql
    no rows selected
    -->rerun
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-27477: "SCOTT.TEST_CHAIN_1" already exists 
    ORA-06512: at "SYS.DBMS_ISCHED", line 1148
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1598
    ORA-06512: at line 2
    -->drop chain
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1');
    BEGIN dbms_scheduler.drop_chain('TEST_CHAIN_1'); END;
    ERROR at line 1:
    ORA-27479: Cannot drop "SCOTT.TEST_CHAIN_1" because other objects depend on it
    ORA-06512: at "SYS.DBMS_ISCHED", line 1319
    ORA-06512: at "SYS.DBMS_ISCHED", line 1222
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1854
    ORA-06512: at line 1
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1',force=>TRUE);
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist   --->still returned no rule set
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    scott@USBO> exec DBMS_RULE_ADM.CREATE_RULE_SET('SCOTT.SCHED_RULESET$1')
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-27477: "SCOTT.TEST_CHAIN_1" already exists
    ORA-06512: at "SYS.DBMS_ISCHED", line 1148
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1598
    ORA-06512: at line 2
    scott@USBO> exec dbms_scheduler.drop_chain('TEST_CHAIN_1',force=>TRUE);
    PL/SQL procedure successfully completed.
    scott@USBO> BEGIN
      2  dbms_scheduler.create_chain('"TEST_CHAIN_1"', evaluation_interval=>NULL, comments=>'A test chain.'
      3  , rule_set_name=>'"SCHED_RULESET$1"   '
      4  );
      5  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_1"', program_name=>'"TEST_PROC_1"');
      6  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_2"', program_name=>'"TEST_PROC_2"');
      7  dbms_scheduler.define_chain_step('"TEST_CHAIN_1"', step_name=>'"CHAIN_STEP_3"', program_name=>'"TEST_PROC_3"');
      8  COMMIT;
      9  END;
    10  /
    BEGIN
    ERROR at line 1:
    ORA-24141: rule set SCOTT.SCHED_RULESET$1 does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
    ORA-06512: at "SYS.DBMS_ISCHED", line 1694
    ORA-01403: no data found
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 1638
    ORA-06512: at line 5
    Would you like to give me more clue?
    Thanks again.

  • Job Request - read Z* Jobs and Chains from CPS

    Dear Ladies and Gentlemen,
    We are establishing Job Scheduling Management, using Job Requests and Job Documentation. In addition CPS (oem) is to be used.
    If we place a Detailed Job Request, or create a Job Documentation, then we can only select the pre-defined global jobs. None of the self-created jobs or job chains is visible.
    For Job Request the steps are:
    - create detailed job request -> enter system, client -> tab "scheduling" -> value list in field "Job Definition" at the bottom
    For Job Documentation the steps are:
    - create job documentation -> tab "systems" -> add a logical component -> mark the system (bottom) -> press button "schedule" -> new IE window pops up -> Change -> button "Select Scheduler" and choose "SAP CPS" -> value list in field "Job Definition" at the bottom
    Please also have a look at
    /people/martin.lauer/blog/2009/05/28/monitoring-job-chains-with-sap-cps-by-redwood-and-sap-solution-manager how it may look like, this bug makes it impossible to follow this example.
    Q: what has to be done to make this work?
    Q: what is the reason of this misbehavior?
    Best regards,
    Peter Müller

    Hi Giovanni,
    For  details on how to configure service desk please check the
    Knowledge kits on service.sap.com/rkt-solman
    Also check:
    Service Desk Functionality in Solution Manager:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0c804fb-45ed-2c10-f7ba-d6ca6c2f6d08
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0c804fb-45ed-2c10-f7ba-d6ca6c2f6d08?QuickLink=index&overridelayout=true
    Thansk
    Regards,
    Vikram

  • Starting a job with 2 conditions (User Event and end of job)

    Hello ,
    I'd like to make a process SAP which start a job depending
    on 2 conditions :
    Condition 1 : raise an event
    and
    Condition 2 : end of another job
    I know that it 's possible for each conditions but is it possible for both conditions ?
    Thank you

    hi again,
    Ok, i'm sorry, my english is not yet fluent.
    I'm searching a solution for an SAP administrator.
    Here is his problem :
    He must launch an Abap program with a job1.
    The abap programm  :
    1>generates a spool in which you can find status code like OK or NOK and
    2>raises an event (EVT_CONTINUE) only if the spool contains OK code.
    Afterwards, The administrator wants to launch job2 if
    2 conditions are OK :
    Condition 1 : EVT_CONTINUE is raised
    Condition 2 : job 1 is terminated
    My question is : is-it possible with a transaction like sm36 or another to do that. (my objective is to avoid
    writing an abap program)
    thanks

  • Batch job scheduling based on Event AND for the job to complete

    I am trying to schedule a background job based on an event AND based on the job finishing itself.
    Example:
    Job name: Send_Message
    After Event: SAP_NEW_PROCESS Message
    Program:  Program xxxx
    I want that the Send_Message job only runs when the Event SAP_NEW_PROCESS message happens AND the Send_Message job is not running.
    Right now, I could only schedule it based on the event SAP_NEW_PROCESS Message which means that everytime this event happens the job runs and I end up having the job "Send_Message" in multilple intances where the others will immediately cancel since the first job is still running and so I end up with a lot of Cancelled job when it is not necessary to run them all when there is already 1 instance of the Job running.
    How do I set it up in SAP?

    Thanks but I am new to SAP having to set up a batch job.
    The Event "SAP_NEW_PROCESS_MESSAGES" is a standard SAP Event.  We used that such that when a new transaction comes in, the batch job will run but we don't want to run the batch job if the same batch job is already running.
    YOu mentioned that I should set up Job_0.  Do I need to create an ABAP prorgram to check if JOB_1 is running?  How do I set up Job_0?  What is the trigger for my Job_0 to run?
    You also said that I set up Job_1 and trigger that based on the outcome of Job_0 AND at the same time be triggered by the event "SAP_NEW_PROCESS_MESSAGES".  How do I set up  this Job_1 so that it can be triggered by both Job_0 and a new transaction coming in(SAP_NEW_PROCESS_MESSAGES).
    if you can provide me the step by step guide as I am new to this and I only know basic.
    The current set up I have is
    Job_1
    Job Start:
          After Event
                Event: SAP_NEW_PROCESS_MESSAGES
          Step 1: program to run RCOCB002
    I was thinking following your suggestion is this:
    Job_0
    Job Start
          After Event
                Event: SAP_NEW_PROCESS_MESSAGES
          Step 1: program to run - What will be my program to run?
    Job_1
    Job_Start
          After Event
                Event: What will be my trigger for Job_1 and how do I set it up?
          Step 1: program to run RCOCB002
    Edited by: Shirley Te on Mar 10, 2010 3:25 PM

  • How to find Process chain for event and parameter

    Hi,
    I have Event and parameter for the process, I wanted to know the which process chain does that process belons to.
    Is there any table where I can see those.

    Hi,
    Try these tables.
    RSEVENTCHAIN    Event Chain Processing Event Table 
    RSEVENTHEAD     Header for the event chain 
    RSEVENTHEADT   Header for the event chain 
    RSPCCHAIN  Process chain details
    RSPCCHAINATTR   Attributes for a Process Chain 
    RSPCCHAINEVENTS   Multiple Events with Process Chains 
    RSPCCHAINT   Texts for Chain 
    RSPCCOMMANDLOG  System Command Execution Logs (Process Chains) 
    RSPCLOGCHAIN   Cross-Table Log ID / Chain ID 
    RSPCLOGS  Application Logs for the Process Chains 
    RSPCPROCESSLOG  Logs for the Chain Runs
    RSPCRUNVARIABLES   Variables for Process Chains for Runtime 
    RSPC_MONITOR  Monitor individual process chains 
    Hope this helps.
    Thanks,
    JituK

  • Retrieve event and event parameter in event based background job

    Hi,
    I think it must be possible but I cannot find documentation of it:
    When a batchjob is triggered via an event (defined in SM62) how can I retrieve the event and event parameter from within the triggered job itself. We want to use the event parameter to trigger other batchjobs, but first we must be able to retrieve them...
    Thanks
    Tom

    Standard SAP triggers can be found in TCODE SM64, Background Processing events.

  • SAP event and job linkage

    Hi ,
    Can anyone please let me know the SAP job-event linkage.
    I mean how do you determine which job is triggered by
    a particular event.
    Thanks,
    Sandip.

    Try table BTCEVTJOB.
    You already have the answer...  
    Message was edited by: Cyril Alex

  • Event Based Chain Step?

    For a couple days now I've been trying to come up with a working example of a Job Chain w/ an Inline Event for a Chain Step.
    Would anyone happen to have a fairly simple example of this, or be able to point me in the right direction?
    Thanks,
    James

    Hi James,
    An inline event in a chain allows the chain to wait until an event is received before continuing with one or more branches of the chain. The way this works is that one of the chain steps is an event step which does nothing but wait for an event and completes successfully as soon as that event is received.
    In a database events are represented by AQ messages to the chain event step waits until a message is received into a certain queue. Here is a simple complete example with comments. First step1 runs, then step 2 waits for an event . After the message is received, the final step3 runs and the chain completes. If you have any more questions, please reply.
    Hope this helps,
    Ravi.
    -- ================= simple complete chain with event step example ==============
    -- grant necessary privileges to scott
    grant create job to scott ;
    grant execute on dbms_aq to scott;
    grant execute on dbms_aqadm to scott;
    begin
    dbms_rule_adm.grant_system_privilege
    (dbms_rule_adm.CREATE_EVALUATION_CONTEXT_OBJ, 'scott', FALSE);
    dbms_rule_adm.grant_system_privilege
    (dbms_rule_adm.CREATE_RULE_SET_OBJ, 'scott', FALSE);
    dbms_rule_adm.grant_system_privilege
    (dbms_rule_adm.CREATE_RULE_OBJ, 'scott', FALSE);
    end ;
    connect scott/tiger
    -- setup a multiple consumers queue for event messages
    create or replace type msg_type as object ( col1 varchar2(20) ) ;
    begin
    dbms_aqadm.create_queue_table('qt1','msg_type',multiple_consumers => TRUE);
    dbms_aqadm.create_queue ( queue_name => 'Q1', queue_table => 'QT1');
    dbms_aqadm.start_queue ( queue_name => 'Q1' ) ;
    end ;
    -- create a scheduler program and chain
    exec dbms_scheduler.create_program('prog1','plsql_block','null;',0,true);
    begin
    dbms_scheduler.create_chain('chain1');
    dbms_scheduler.define_chain_step('chain1','step1','prog1');
    dbms_scheduler.define_chain_event_step('chain1','step2',
    'tab.user_data.col1 is not null', 'Q1');
    dbms_scheduler.define_chain_step('chain1','step3','prog1');
    dbms_scheduler.define_chain_rule('chain1','true','START step1');
    dbms_scheduler.define_chain_rule('chain1','step1 completed', 'start step2');
    dbms_scheduler.define_chain_rule('chain1','step2 completed','start step3');
    dbms_scheduler.define_chain_rule('chain1','step3 completed','end');
    dbms_scheduler.enable('chain1');
    end;
    -- now create the master chain job, and enable it so it runs immediately
    exec dbms_scheduler.create_job('job1','chain','chain1',0,enabled=>true);
    -- wait a second or two to let first step complete
    select * from all_scheduler_job_log where job_name='JOB1' order by log_id;
    -- observe that only first step has completed
    -- now enqueue message to complete second step
    declare
    msg msg_type;
    my_msgid RAW(16);
    props dbms_aq.message_properties_t;
    enqopts dbms_aq.enqueue_options_t;
    begin
    msg := msg_type('test');
    dbms_aq.enqueue('q1', enqopts, props, msg, my_msgid);
    end;
    commit;
    -- now check that chain has completed successfully
    select * from all_scheduler_job_log where job_name='JOB1' order by log_id;
    -- ======= end of complete inline event step example

  • PC scheduling - after event and in certain time together

    Hi Experts,
    I have question concerning scheduling of the process chains. Our transactional data process chain needs to wait for certain job in R/3 to finish and only then we can run the PC. How do you set such event? Please be as detailed as possible.
    Currently we have one metachain running master data loads and then transactional data loads. My other question is if we can combine 2 events and start the TD only after both events (when MD loads and R/3 job finish as well). Or start TD loads only after certain time and after job in R/3 finishes.
    Can you please let me know your suggestions how to do that?
    Thank you,
    Michal

    Hi,
    Creat a process chain for master data load and one meta chain for Transaction data load and include it after master data load. Trigger the master load with even raise from R/3.
    You can raise a event in BW once the job get completed in R/3. This you can do by executing the BP_EVENT_RAISE function module with destination. The destination you can mention the target system and trigger a event. You can achieve this with ABAP program.
    After the master data load, the transaction data load will start in meta chain.
    Hope this helps.

  • How to find triggering job for Process chain

    Hi,
    I have a process chain and its triggering by some other system using an event.
    I want to know how to find which ystem is triggering this job means process chain and on what basis it is starting?
    I have an event for this process chain and also FM : BP_EVENT_RAISE. So how to find the with those details?
    Thanks,
    Phani

    HI,
    some other system means either dev, qas, prd?
    for every process in a process chain there is a chain id which is same as the name of your chain,
    for every chain id there exist some log ids , this both information you can find from the standard table RSPCLOGCHAIN
    From this log id you can find the status of the process from  table RSPCPROCESSLOG.
    here u will find the status of your process whether is has been completed successfully or ended with errors.
    Thanks,
    Phani.

  • Hot to add a Background Job to process Chain

    Hi Guys,
    I have created a background job via Sm36, but I wanted to include all this jobs to Process Chain, is it possible?
    thanks.

    Hi,
    Welcome to SDN.
    Please try this ( a quick and dirty solution)
    1.Create a batch event in SM62 (e.g. Z_EVENT1D)
    2.Allocate this event as start event of batch job in SE36
    3.Create a report to trigger this event
    REPORT  Z_RAISE_EVENT.
    Call Function 'BP_EVENT_RAISE'
             EXPORTING
             EVENTID = 'Z_EVENT1D'
    4.Add a process type abap program calling this report to PC
    Of course, you can add a parameter to report and save different variants to make it more flexible, if required.
    Regards
    Joe

  • Background job - Event tiggering not happening

    Hi All,
    Background job X will run on daily basis and which in turn triggers two jobs say A and B.
    The job X got finished successfully but jobs A and B havn't been triggered and so not running.
    Please help me on this.
    Thanks & Regards,
    Gopi L.

    HI,
    Gopi check the start condition of job A & B, what event is triggering these jobs.
    Also check SAP note 395170.
    Regards,
    Sachin Rane.

  • Detect and save an event and the previous 60s data in a R32 file

    Hello
    I am a new user of Diadem.
    I perform long reliability test, and so the R32 file reach often 1 Giga byte (with a measure frequency of 500hz) when I stop manually the measure after the event . And after I only use the last 60s.
    I acquire a Voltage signal using a measurement instument connected to the Serial port, I save this signal in a document by using the document icon in the DAC (Circuit with packaged data)
    I have read the manuals but I don't know how to do the following thing:
    How to save only the last 60s in a buffer and write it into a file if they are followed by an event.
    The signal has normaly each 10s a 10v spike (During 7ms) but some time it remain constant near 4V during at least 5s and that is the event.
    How to do that in the DAC? Should I use a trigger with a timer condition, but I don't know how to do it with packaged data.
    Could you give me an example
    Thanks for your help
    Alfons

    Hello,
    I have
    created two Examples how to do this.
    The basic idea is to build packets with 60 seconds of data, find the event and
    save the last minute. One way to create the packet with 60 Seconds is the
    Offset Register. This block is also able to shift the signal by smaller steps.
    The signal
    is created with two generators and a manual switch to create the stop event. The
    blocks are running free, so you don’t have to wait a minute or more to test the
    behaviour. It is possible to simulate real timing in the generators if you like
    to see the real speed.
    In the
    simple example the Offset Register “1 Minute” is producing a packet with the
    last 30.000 values 10 times per second. This is shown in a scope. After this, a
    formula is looking for values between 2 and 6. All values in the packet are
    counted and if the number is above 2.500 (5 seconds) the block Relay gives
    this packet into the store and stop block. (Store is simulated with a scope to
    make testing easier.
    This
    example should do the job.
    I have also
    included an advanced example.
    In this
    example a formula is creating a second signal with trigger information. This
    signal has the same amount of values and can be used for more complex ways of
    triggering. In this example the formula is measuring the time when the signal
    is between 2 and 6. When the signal is not in this range the time is set to zero.
    The Multiplexer Block is used to build a loop to put the result of the formula
    back in to the formula. This allows the formula to ad 0.1 seconds to its own result
    from the loop before.
    The trigger
    signal is later used to store and stop the test. It is possible to create very
    flexible triggers, events and decisions during a process if this is needed.
    Of course,
    it is possible, that you have to change some of the blocks or add additional functions
    if the simple formulas are not able to separate the event from other changes in
    the signal.Ulrich Bierwisch
    Attachments:
    simple.DAC ‏37 KB
    advanced.DAC ‏46 KB

  • Infoview Issues Missing Events and Parameters

    Very strange problem.  I am on BO 3.1... the CMC shows all events and parameters.  When I open up Infoview under the same login (administrator), I am not able to see any events when I go to schedule.  In its place, under job history, the report would show NO parameters even though it has parameters and it is showing in CMC.  Also, when trying to schedule it based on an events, there are no available events.  Instead, I get a message of "This is a formatting string" in all of the boxes. 
    At first I thought maybe it is a setting for the Infoview application on CMC but it does not make sense since administrators have FULL CONTROL.
    Help.
    Thanks!

    Hi,
    Does this happen for all reports?  If so, then its probably an interface issue more than anything else.  You'll want to redeploy the web applications, or at least the InfoView releated ones (InfoViewApp, InfoViewAppActions, PlatformServices)
    You can use WDeploy to do this. 
    [Web Application Deployment Guide - Windows|http://service.sap.com/~sapidb/011000358700001647122008E/xi3-1_deployconfig_win_en.pdf]
    [Web Application Deployment Guide Unix|http://service.sap.com/~sapidb/011000358700001647132008E/xi3-1_deployconfig_unix_en.pdf]
    Or, an easy way in Tomcat is to go to the WebApps directory and just rename the folders of the apps you want to redeploy.  Then restart tomcat and wait about 20 minutes for the apps to re-deploy.
    Other than that, have you modified the out of the box security at all?  Locked down permissions to the InfoView application or anything along those lines?
    Thanks
    Jonathan
    Edited by: Jonathan Brown on Jul 13, 2010 6:47 PM

Maybe you are looking for