Code to make second job dependent at first

Hello experts, how can I write an ABAP code to kick of an event after the first step, and make the second job dependent on the event. thanks a lot...

Hi christopher,
1. Simple
  use like below when writing code FOR SECOND JOB
  where ;
  jobname = 1st jobname
  jobcount  =1st job count
2.
Data Declaration
  DATA : eventparm LIKE tbtcjob-eventparm.
  eventparm = jobname.
  eventparm+32 = jobcount.
  CALL FUNCTION 'JOB_CLOSE'
    EXPORTING
      jobcount                          = jobcount_sen
      jobname                           = jobname_sen
      predjob_checkstat                 = ''
      event_id                          = 'SAP_END_OF_JOB'
      event_param                       = eventparm
regards,
amit .

Similar Messages

  • How to make two jobs periodic,second job starting after first get finished

    Hi all,
        My requirement is that I have two jobs . They both need to be periodic
    After job 1 get finished another job must start that is also need to be periodic.
    I tried event event "SAP_END_OF_JOB" and parmeter as first job but only first job get executed
    Please help me to resolve this,   Thank You

    Hi,
    Use the following code.
      DO.
        CALL FUNCTION 'SHOW_JOBSTATE'
          EXPORTING
            jobcount         = l_jobnumber
            jobname          = l_jobname
          IMPORTING
            aborted          = l_aborted
            finished         = l_finished
          EXCEPTIONS
            jobcount_missing = 1
            jobname_missing  = 2
            job_notex        = 3
            OTHERS           = 4.
        IF l_aborted = 'X'(106) OR l_finished = 'X'(106).
          EXIT.
        ELSE.
          WAIT UP TO 5 SECONDS.
        ENDIF.
      ENDDO.
    Thanks.
    Ramya.

  • How to make two jobs periodic,second job starting after first get fini

    Hi  ,
          I had posted this question previously also. I can't understand Why the Moderator Locked it. 
          I searched the SDN and found that  hardly any one has given a correct  answer.
           Every one gives an ans create  a job with  two steps.
           NO i don't require that. I have to  update joblogs of the first job in  a Z table.  So i have to create two periodic jobs.
        If you have tried and succeeded plaease answer.
        I will  request Thomas if he has got some valid links please do share.

    Ok Thomas let expalin my problem in detail.
    I have one report A which updates some Z tables. Now the user is going to schedule a monthly job for this report.
    He wants to  see the log details of the Job to be stored in a Ztable. Fields will like 'Job name,Id, Start date,  Start time,End Date,End Time, User ,Status of Job (Canceled/Finished) , Tables Updated, Tables Failed '.
    What my  second report does it picks up the lates Job finished/Cancelled for the Report A. Then  Passes it to  'BP_JOBLOG_READ'
    fetches the Log messages of JobA.  From where I can get which Table is updated and which one failed.
    So  my second report Report B should be excuted every time Job A Finishes. 
    What i Felt it will easier to  create a job ffor report B , and Let this Job B fired every time Job A finishe/Cancelled.
    Any hope  i can resolve this.
    thanks in advace.

  • Second list depending on first on when-list-changed

    Hello!
    I'm having some trouble with 2 poplists. First poplist (:bloc_portar.lista) is generated ok. Second poplist (:bloc_portar.cnp) depends on the values of the first like this:
    DECLARE
         nume_lista1 varchar2(60) := replace(:bloc_portar.lista, ' ', NULL);
         nume_lista2 varchar2(60);
         rg_query_cnp varchar2(1000) := 'SELECT b.id, b.id FROM vizitatori2 b
         WHERE b.nume=nume_lista2';
         rg_id_cnp recordgroup;
         rg_id2 recordgroup;
         err_cnp NUMBER:= 0;
    BEGIN
    nume_lista2 := substr(nume_lista1, 1, 7);
    message('---' || nume_lista2 || '---');
         rg_id2 := Find_Group ('rg2');
         if not ID_NULL(rg_id2) then
         delete_group(rg_id2);
         end if;
         rg_id_cnp := create_group_from_query('rg2',rg_query_cnp);
         err_cnp := populate_group(rg_id_cnp);
         clear_list('bloc_portar.cnp');
         populate_list('bloc_portar.cnp',rg_id_cnp);
    END;
    nume_lista1 fetches the data selected from the first poplist and nume_lista2 takes the first 7 letters of that string to pass it in the query which should make the group/populate the second list. This code is more of a test and not a final code thats why i used those string functions (and also because the values in first list are concatenated (name+surname).
    I used a message to make sure the value in nume_lista2 is the one that i want for the query to work.
    The problem : its in here 'SELECT b.id, b.id FROM vizitatori2 b WHERE b.nume=nume_lista2';
    I've found out that when i pass the WHERE condition "manually" like this 'SELECT b.id, b.id FROM vizitatori2 b WHERE b.nume=''James'' ';
    the second poplist is populated just fine with the right values. But when i try to make it use the variable nume_lista2 in the condition it says that rg2 (aka the group for the second poplist) "Cannot create Group rg2".
    Hope you can help me,
    Iulian

    But can u enlighten me on a couple of issues pls?Sure :)
    >
    1. How come it doesn't recognise the variable in the query when i make the definition in DECLARE? Shouldn't it be analyzed only later in the main program when i actually use the query ? How does this work?You can do that in declare part too :). I am usually convenient to have a query built just before using it.
    2. Why tripple quotes and concatenate operators ? Is this how variables are passed to queries? I believe i used them before without any extra bording or anything.varchar2 variables are not passed with quotes by default. So, if you do not use the quotes, the resultant query would be something like
    SELECT b.id, b.id FROM vizitatori2 b WHERE b.nume=Jameswhich is not what we expect. So, surround the variable with the quote, which would turn the query to
    SELECT b.id, b.id FROM vizitatori2 b WHERE b.nume='James'HTH.
    -Arun

  • Cannot pick up calls on wait, Cannot make a second call holding the first call

    I have a really weird problem with my iPhone 5S. (iOS 7.1)
    1. When I am on a call, I am not able to pick up a second call that is on wait. I can see the second call, I can hear the beep sounds but as soon as I pick up, the call freezes in 00.00 time, and My first caller is still active, not on hold.
    2. When I am on a call, I am not able to make a second call placing the first call on hold. The second call disconnects immediately with 3 beeps.
    3. I am able to see the incoming calls on wait, when I am already on a call. I am able to hear the beeps coming in. SO it means the call waiting is on (Tried turning it on/off/on too.) But when I pick up the call, the above problem comes in.
    What have I tried to solve this: (None of them helped)
    1. I tried a hard reset of my iPhone (Holding Power and Home button)
    2. I tried toggling the Call waiting button
    3. I tried resetting network settings.
    4. I called my Operator for assistance. I am using Airtel, India. They told me to dial this code - *43# . I tried it and it gave me this screen. But the problem is not solved yet.
    Is there anybody here who is facing the same issue with your iPhone? I never had this problem with my iPhone 4.

    Make sure you do not have "Do Not Disturb" turned on. This feature will block the first call, but is someone calls right back it will be put through.
    On the iPhone, go to Settings/Do Not Disturb
    Make sure you do not have Do Not Disturb turned on manual or scheduled.

  • I signed up for sync on one computer and got a pairing code on the second computer but now I can't bring up the pairing screen on the first computer. Why not?

    I set up sync on the first computer, then got a sync code on the second computer. Now I can't bring up the sync screen on the first computer to sync them together.

    Hi shopper104, <br>
    # Click the Home button (or type about:home in the location bar) to bring up the default Firefox home page.
    # At the bottom of the home page, click the Sync link to open the Sync settings window.
    # Then click the Pair a device link and the Firefox Sync Setup window will open.
    # Enter the twelve character code generated on your other device and click Next.
    # When the code is accepted you will see a Device Connected message and your device will immediately begin syncing. Click Finish to close the setup window.
    <br><br>
    More information can be found in these articles:
    * [[Firefox Sync - Take your bookmarks, tabs and personal information with you]]
    * [[How do I set up Firefox Sync?]]
    * [[How do I add a device to Firefox Sync?]]
    Hope that helped you! Please report back.

  • How to make sub programs dependent on the parent program for ESS job in Fusion Applications.

    Hi Experts,
    We have a requirment to define the ESS jobs dependent on the parent program.
    Example:
    ESS_JOB_PARENT   -- Main ESS jobs which will trigger below mentioned jobs using "ess_runtime.submit_subrequest" through PL/SQL Package.
    ESS_JOB1                 -- Parent program has to wait will ESS_JOB1 is completed. If ESS_JOB1 is errored then parent program should also be errored.
    ESS_JOB2                 -- If ESS_JOB1 is successfull then Parent program should trigger ESS_JOB2 and it has to wait till ESS_JOB2 is completed. If ESS_JOB2 is error parent program should be errored.
    ESS_JOB3                 -- If ESS_JOB2 is completed successfully then parent program should trigger ESS_JOB3 and it has to wait till ESS_JOB3 is completed. If ESS_JOB3 is error then parent program should be errored.
    Any reference (document or sample code) are highly appericiated.
    Thanks,
    Praveen

    Is there a reason why "Job Set Steps" cannot be used, that is is there a reason you need to do this programmatically ?
    Jani Rautiainen
    Fusion Applications Developer Relations
    https://blogs.oracle.com/fadevrel/

  • Agent Unavailable after second job run

    We're having an issue with the Tidal_Agent_1 service stopping after running a job a second time.  The first time the job completes normally.  When I perform a rerun the tidal service gets shut down and the job outputs "Agent Unavailable".
    I have tested this with a few different simple jobs, reinstalled a stable tidal version (3.0.1.14), and still the same behavior.
    We are using TES 5.2.2 and the agent uses Windows Server 2008 R2 Enterprise for OS.
    Any ideas?  Working with tidal for years and first time seeing this.
    Thanks

    Hi,
    Check the agent logs and look for "out of memory" errors. You may want to tweak the config file and set the basic heap sizes to 2x or 4x basic depending on your system physical resources.
    Cheers

  • SQL SERVER AGENT job dependent on another job

    Hi
    I have 2 Sql Server Agent jobs that run on a daily basis.
    One which is run first but is dependant on another job completing.
    The secone runs every 30 mins between 9:00am to 7:00pm.
    If my first Job hasn't run but the 2nd job does start running the 2nd job will fail.
    Is there away with SQL servent agent where if my first Job hasn't run  then don't run the 2nd job?
    Regards

    Hi aivoryuk,
    According to your description, if you set one job is dependent on another job, when the first job does not run or execute failed, then the second job will not run. I recommend you use two steps to instead of this two jobs. In step Advanced page, we can set
    that the first job execute successfully then go to the next step. Or else, it will quit the job and report a failure.
    The other way is that we create new job with the same schedule as the second job , in this job , we can check the first job status with the sp_help_job stored procedure, then you can use sp_start_job to Start
     the second job. For more information, you can review the following post.
    http://social.technet.microsoft.com/Forums/en-US/d5cb4004-02fb-4b41-a321-5197f8105941/sql-server-agent-making-1-job-dependent-on-another?forum=sqltools
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Playing a second swf when the first one's finished

    I have 2 swf files (the FLA's too) and want one to play then
    the second. - I'd add the second to the timeline of the first, but
    the second is a complete site and contains many referenced
    "gotoandplay" links which would all need changing. So....I really
    just need a way for the second swf to play after the first one's
    finished. I tried using the load external movie clip behaviour, but
    couldn't make it work. Can I use the first swf as a preloader
    without affecting the timeline on the main swf? I canspare a couple
    of frames at the start of the second movie for that, but don't know
    how to set it up - can anyone help?
    I also want the custom cursor to remain only in the first
    swf, and go back to default on the second.
    main (second) movie:
    http://mysticalbillyo.com
    first movie:
    http://mysticalbillyo.com/intro.swf

    I think you may want to create a 'master' loading swf, rather
    than loading the second movie into the first, and use the
    MovieClipLoader class to call and load new movies into the master
    container.
    Set up a new swf, that is the same size as the others. you'll
    set up a function on the first frame and then use that function to
    load all subsequent content into the master document. You can also
    use methods of the class to add things like preloaders and other
    event handlers. so for instance, at the last frame of the intro
    swf, you'd add a 'call' to the function in the master telling it to
    load the next movie in the sequence. I'll add the call you will
    need on the bottom of the code example below.
    PS. ------------------------------------
    I'm not one to solicit, however I have (awhile ago) developed
    a Component that you may be interested in for your site, although
    it has not been package and ready for distribution, it does
    function - called 'glitterMouse', and produces a twinkling mouse
    trail effect when you move the cursor, mush like the onRollOver
    animation that you'd painstakingly made (ouch) except that it use
    random twinkle generation at run-time, and has many property
    settings, like color, quantity, gravity, and so on. It might be a
    nice addition to your 'wand' cursor, and would not 'replace it' as
    it's not a 'cursor' but an effect generator.
    If you are interested, an example of it in action (although
    you can't purcahse it from there ... yet) can be seen on my site
    at: www.beechstudios.com goto the 'Flash' section, it's the first
    one listed.
    Just thought I'd throw that out there, sorry all, it just
    fits :]
    OK the code for you, add this to the first frame of the
    'master' swf, then add the code at the bottom to the end of the
    intro swf in the last frame.
    EDIT: this is AS2 code, to use AS3 code do something more
    like the methods as described above, yet I would still consider
    placing all content within a 'master' loading doc, and replaceing
    or removeing previously loaded children.

  • How to make a job run on a appointed node

    I have a problem. The database is Oracle 10g, RAC, two nodes
    There are some job which run on everyday night. Now, something happened, the job run on Node A can't work as normal, but if run on node B, It will work well.
    so I just want to submit the jobs on Node B, I submited the jobs on Node B, but the jobs always run on Node A.
    I want to know how to make a job run on a appointed node.

    the Job just transfer some procedure to add partitions for some table, to merge the records from some tables to one table and so on.
    the problem is when the job run on Node A, it is very very slow, the procedure would run hours and not success end, but if on Node B it will successfully end in seconds.
    restart the Node A would be a way for the problem, but may it will leave a hidden trouble. I want save the scene to find out the problem
    so can you help me

  • My iPhone 4S is dark, this is the second time.  The first time i was able to get it back on by plugging in into my PC.  However this time i have had it plugged in for an hour or so and nothing.  I have done the Start/sleep buttons

    My iPhone 4s is dark, this is the second time.  The first time I was able to get it back up and running by plugging it into my PC.  However this time it has been plugged in for an hour or more and nothing. There was still at least 70% charge left on it when it went dead.  I have pressed the sleep and start button separately and together.  It said that I did not have much space left this morning so I deleted Apps and photos but there was still space.  Just two days ago it was losing power even though it still 55% charge left so I plugged it in and it seemed to gain power.  Any suggestions on the problem?

    Sounds like faulty battery. Make Genius reservation and take to Apple for quick (minutes) free battery diagnostic testing. If you have Warranty or AppleCare the problem will be covered.

  • How can I make iTunes sort on the first word by default, even though that word is "The" or "A"?

    How can I make iTunes sort on the first word by default, even though that word is "The" or "A"?
    I myself think that (for instance) "A tribe called Quest" should be sorted under "A", not "T".
    Now I can edit the sort options manually per track and/or per selection, but I would really like to just kill this "iTunes-knows-how-you-should-sort"-feature in iTunes.
    Anyone any suggestion on how to do that?
    Thanks

    Here is a modified version of one of Doug's Scripts. My modification was to add Sort Name to the list of tags that could be changed. I tried it on a single track and it worked. I recommend backing up your library first. Select the tracks you want to change (or all tracks) and run the script from the Applescript Editor.  If it works as intended, save it so you can apply it to newly imported tracks.  And, yes, I know this isn't the exact answer to your question, you want to change a preference setting in iTunes (if there is such a setting).
    Original script can be forund at http://dougscripts.com/itunes/scripts/ss.php?sp=thistagthattag
    Modified script is below. Start up Applescript Editor, paste it into a new window.  Start up iTunes and select the tracks to modify.  Click Run in the Applescript Editor.  Follow the instructions.
    (* Put This In That
    v2.0 april 22 2008
    - runs as universal binary
    - adds "Show" tag
    - consolidated code
    - saved as script bundle
    v1.7 October 3, 2006
    - adds "Album Artist" as option
    v1.6 October 28, 2004
    - works around iTunes 4.7 selection bug
    v1.5 ('04/1)-- adds "grouping" tag
    Get more free AppleScripts and info on writing your own
    at Doug's AppleScripts for iTunes
    http://dougscripts.com/itunes/
    This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
    Get a copy of the GNU General Public License by writing to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    or visit http://www.gnu.org/copyleft/gpl.html
    -- CONSTANTS
    property allOptions : {"Song Name", "Artist", "Album", "Album Artist", "Composer", "Genre", "Comments", "Show", "Grouping", "Sort Name"}
    property my_title : "Put This In That"
    global thisTag, thatTag, theNewTags, theOriginalTags, yn
    tell application "iTunes"
              if selection is not {} then -- if tracks are selected...
                        set sel to selection
                        set numTracks to (length of sel)
                        set s to "s"
                        if numTracks is 1 then set s to ""
                        display dialog "The data from one tag REPLACES the data in another tag in all the selected tracks, with option to delete data in first tag." & return & return & (numTracks & " track" & s & " selected.") buttons {"Cancel", "Continue"} default button 2 with title my_title giving up after 30
                        if gave up of result is true then return
                        my choose_this_tag()
                        my choose_that_tag()
                        set yn to (button returned of (display dialog "Delete data in " & thisTag & " afterwards?" buttons {"Yes", "No"} default button 2 with title my_title giving up after 45) is "Yes")
                        set oldfi to fixed indexing
                        set fixed indexing to true
                        repeat with t from 1 to numTracks
                                  tell contents of item t of sel
                                            set theOriginalTags to {get name, get artist, get album, get album artist, get composer, get genre, get comment, get show, get grouping, get sort name}
                                            set theNewTags to theOriginalTags
                                            my do_put()
                                            set {name, artist, album, album artist, composer, genre, comment, show, grouping, sort name} to theNewTags
                                  end tell
                        end repeat
                        set fixed indexing to oldfi
              else
      display dialog "No tracks have been selected." buttons {"Cancel"} default button 1 with icon 0 giving up after 30
              end if -- no selection
    end tell
    to choose_this_tag()
              tell application "iTunes"
                        set n to (choose from list allOptions with prompt ("Select a tag to get data from:") with title my_title)
                        if n is false then error number -128
                        set thisTag to (n as text)
              end tell
    end choose_this_tag
    to choose_that_tag()
              set o to {}
              repeat with t in allOptions
                        if (t as text) is not thisTag then copy t to end of o
              end repeat
              tell application "iTunes"
                        set n to choose from list o with prompt ("Use data from the " & thisTag & " tag to REPLACE data in...") with title my_title
                        if n is false then error number -128
                        set thatTag to n as text
              end tell
    end choose_that_tag
    to do_put()
              try
                        repeat with i from 1 to (length of allOptions)
                                  if thisTag is (item i of allOptions) then
                                            set thisTag_sto to (item i of theOriginalTags)
                                            exit repeat
                                  end if
                        end repeat
                        repeat with i from 1 to (length of allOptions)
                                  if thatTag is (item i of allOptions) then
                                            set (item i of theNewTags) to thisTag_sto
                                            exit repeat
                                  end if
                        end repeat
                        if yn then
                                  repeat with i from 1 to (length of allOptions)
                                            if thisTag is (item i of allOptions) then
                                                      set (item i of theNewTags) to ""
                                                      exit repeat
                                            end if
                                  end repeat
                        end if
              end try
    end do_put

  • Modify code to pull the time dependent master data

    I fully under stand the suggestion below for the requirement to add the time dependent attribute comp code
    thanks fo rthe help but please tell me if there is a way i can modify the abap code and make the user enter the value for the date on which he want to pull th emaster data for company code or keydate to and from and pull the master data, so how will i proceede should i create the variable on 0doc_date and how to modify the code. please help . i have opened another question with same desc as above to assign points
    thanks
    soniya
    The literal within <..> is supposed to be replaced by the actual field name (as I didn't know the fields). In this case, I am changing your code for costcenter/company-code.
    data : wa like /bi0/qcostcenter.
    select single * from /bi0/qcostcenter into wa
    where costcenter = comm_structure-costcenter
    and objvers = 'A'
    and datefrom le comm_structure-<keydatefield>
    and dateto ge comm_structure-<keydatefield>.
    if sy-subrc = 0.
    result = wa-comp_code.
    endif.
    abort = 0.
    You can use this code for update rule of company_code. You have to replace '<keydatefield>' with a field name that contains the date on which the company is to be derived. If there is a date in your comm_structure (eg aedat) which you can use, you can specify that field in place of this literal (instead of comm_structure-<keydatefld> use comm_structure-aedat). If you have no such field, and you wish to use current date for getting the company code from time-dependent master data, you can use sy-datum (ie replace comm_strucutre-<keydatefld> with sy-datum).
    And it should work.
    The 'master data attribute' option is one of the options when you create update rule (one of the radio button options).

    That the code is doing anyway.
    If your txn data in the cube doesn't have a date, how does it know it is Feb data, or, it is March data?
    If it has a date or month field, you should modify and use this code to update the company based on that date instead of system date.
    Other than that minor variation, it is already doing what you look for.

  • Redwood - Schedule a job dependant on another jobs completion?

    Hoping someone can help as documentation on Redwood seems to be very limited.
    We are currently running Redwood for the "Standard Jobs" without an issue, however we now have a requirement to start testing our batch schedule through Redwood and can't seem to figure out how to create jobs with dependencies on other job completions?
    Can anyone point us in the right direction?
    The other issue we have, is that we are unable to find an option to release a job based on an event trigger?
    Thanks a lot

    Hi Matthew,
    Jobs can be made dependant in two ways.
    1.     Using Job chains where you will be able to have multiple scripts (each script executes a step in multi step job) dependant on one other. (Documentation for the same is available in Redwood help with key word – ‘What is a job-chain’). In this case you will have one job chain with multiple scripts getting executed in a parallel or sequential way. Also it is possible to embed job chains in other job chain. You can take different actions based on output / processing state (completed, cancelled etc.) of previous script in Job chain.
    2.     Raising events by predecessor script which in turn triggers next script.
    First solution is more appropriate and used one.
    If you are talking about events in Redwood they can be raised and sensed by scripts and can be defined in script properties under node –wait Events & Raise events.
    Hope this helps.
    Regards
    Vithal

Maybe you are looking for

  • Safari will not open, error posted

    My Safari will not open. I am unable to get to the tool bar due to the following error. Please help, I have no clue what I need to do. I apologize if I am not suppose to paste the whole error, however I wanted to ensure that whom ever takes the time

  • Mouse over flicker problem

    I'm fairly new to Flash and couldn't find the exact same problem in the forums so here goes. Flash CS4, Actionscript 3.0 I have a button that I have a mouseover event making another button appear (thus making it look like a color change).  It flicker

  • Backing up Ipod touch

    I have not been able to do a backup on my Ipod touch 4th generation since installing the new update....my Iphone 4 is fine but not the ipod. Any ideas on how to fix would be greatly appreciated.

  • Content getting cut off at the top on my mobile Firefox

    Hi - after the most recent update to my mobile Firefox browser (on a Galaxy GT-19300, running Android 4.1.2) its started to cut off the top of my content on certain websites I've built using a full screen background slideshow: www.seanalexander.tv ww

  • I want to purchase the Oracle Traning Text Book Only, is it possible

    I would like to purchase the following Oracle's Training Text Book alone(NOT CBT CDS), is it possible? if possible need a little guidance Oracle 9i SQL & PL/SQL Oracle 9i Forms Oracle 9i Reports Oracle 9iAS Administration Regards John Veslin