Start background Job when another is finished (NOT with the JobSteps)

Hi guys,
i need your help.
I've already searched here in forum, but i wasn't able to find a good solution.
I have this problem.
I have a program that create a background job with the FM FM JOB_OPEN.. SUBMIT report with parameters .. JOB_CLOSE.
I want that if i run this report again (20 secs after for example) it does:
- Check if there is an already running Job with the same name (means with state 'R') (This task is simply, with a select on TBTO table)
- If it's found, it have to create a new job with the same name that starts automatically AFTER the first running job is finished (don't care about the end-state of the first job).
I've already tried with pred_jobcount & PRED_JOBNAME parameters of the JOB_CLOSE FM but it doesen't works!
The JOB_CLOSE, creates a job in Planned state. But when the first Job is finished, the second job(Planned) doesen't start automatically.
In this scenario, i CANNOT use endless loops (wait until the first job is finished and then submit the second) Job-steps (one job that contains multiple steps) events (i have to start only one job after the predecessor is finished), because this report could be run many times and each job should be collected like a "stack" (only when the first job is finshed the second "registered" should be started and so on, until the aren't more planned jobs).
<REMOVED BY MODERATOR>
Thx a lot for your help.
Andrea
Edited by: Alvaro Tejada Galindo on Jun 12, 2008 12:19 PM

Hi Veda
i can tell u but ... some reward points are very appreciated ....
I'm joking (of course)
Here the question:
I have a program (called A) that submit a new program (called B) with the JOB_OPEN .. submit JOB_CLOSE. The program B should start only if another program B (called before for example) is finished.
Here the solution.
I add a parameter (with no-display clausole) to the program B. In this parameter i pass to the program, the job number returned by the JOB_OPEN function. 
When i create the JOB with the function, the "jobname" parameter is set with value 'G_DELIVERY' (Here u can change the name of the job as u want : this is the jobname that u see in SM37 transaction).
In the start-of-selection of program B i put a "waiting" procedure like this :
First i save a timestamp of system-date and system-time (called for example r_date and r_time)
select from table TBTCO all the jobs called "G_DELIVERY" with jobnumber <> from the jobnumber parameter (that means exclude itselfs)  with status running ('R')  -> that have startdate /starttime less than the r_date and r_time <- (this is the key of the selection that solve the problem).
if it is found (means there is another running job started before this one).
wait up to 60 seconds. "for example
repeat the selection.
endif.
When the job called before ends, this one programs exits from the loop and continues. If u submit more programs "B", they'll works like a stack.
I should say to u just one thing.... I solved my problem in another way (because i've changed the logic so this problem was no more) so i didn't implemented that logic, but it should works very good.
Try it and tell me!
Bye
Andrea

Similar Messages

  • Background job within another background job

    Hello Experts,
    I have a BDC program (for BW tcode OLI7BW) which executes by scheduling a number of background jobs. This report works fine when run manually. But doesn't work if it is scheduled as a background job through SM36. The status of the job is shown as finished, but the data is not uploaded.
    Is it not possible to execute a background job within another background job?
    If it's possible, what could be the possible cause of error?
    Thanks In Advance
    Radhika

    Hi Radhika,
    If you are trying to upload data from a file on ur desktop to Internal table, then background job doesn't work. Always remember GUI means ur front end and all background jobs are run on application server and they dont run w.r.t ur desktop.
    Kindly check it and get back to me incase of any queries.
    Dont forget to reward points, if found useful.
    Thanks and Regards,
    Satyesh

  • Scheduling one background job inside another

    Hi All,
    Is it possible to Scheduling one background job inside another.? i.e In my Z program I am calling job_open, job_submit, job_close and to execute one standard report in background. And after that I am executing my Z program itself  from SE38 as Program->Execute->Background->Execute Immediately. Is this logically correct? I am asking this because I am not getting the desired result
    Thanks & Regards,
    Neethu.

    HI,
    Check the job steps in SM36.
    First schedule the Standard job and in the job steps schedule the z report.
    Schedule job in chain

  • I have a long-existing iPhone 4s with one apple id and started a job where I received a macbook with another apple id. how do i get my phone to sync with the Mac Pro and secondly how do i get my music on there?

    i have a long-existing iPhone 4s with one apple id and started a job where I received a macbook with another apple id. how do i get my phone to sync with the Mac Pro and secondly how do i get my music on there?

    No not bothered about sycing apps etc it is all about calendars and maybe notes. IN terms of how its done I just want it the easiest way and preferably so that if an entry is made on one calendar then it populates the other.
    Thgius is beacuse I have my work diary on outlok, which I then link with my ical. I want to make sure that information is then shared with her.
    Chris

  • When selecting the camera on 3gs the screen just goes black i can still take a photo using the top volume button but not with the screen please help

    hello there
    when selecting the camera on my 3gs the screen goes black and has no responce i can take a picture with the top volume button but cannot see it until i open photos
    please can anyone help
    thankyou andy

    Try closing the Camera app completely and see if it works properly when you re-open the app : from the home screen (i.e. not with the Camera app 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Camera app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    If that doesn't work also do a reset (unless this is what you mean by powering off and restarting) : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • I tried to upgrade to the latest version of Firefox but on the Firefox start page is still says "you are not on the latest version of Firefox, upgrade now"

    I tried to upgrade to the latest version of Firefox but on the Firefox start page it still says "you are not on the latest version of Firefox, upgrade now". The start page looks different so maybe it did upgrade but why does the reminder still show?

    You may see that message below the Google search box on www.google.com/firefox which is the old Firefox default home page. It appears that page is no longer being maintained by Google. You appear to have the latest Firefox version.
    '''If you want the Google search page as your home page,''' change your home page to '''''about:home''''' (a new, updated version of the old Google/Firefox home page is now built-in to Firefox).
    *See --> http://support.mozilla.com/en-US/kb/How+to+set+the+home+page
    Also see --> https://support.mozilla.com/en-US/kb/Finding+your+Firefox+version<br />
    You can also see your version on the ''Help > Troubleshooting Information'' display
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check --> http://www.mozilla.org/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.com/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *'''''Shockwave Flash''''' (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *'''''Next Generation Java Plug-in for Mozilla browsers''''': [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • What do I do when my printer will not print the whole page of something I wirelessly send to print

    What exactly do I need to do when my printer will not print the whole page of a job i send to it wireless?

    hi there,
    could you provide the community with a little more information to help narrow troubleshooting? Things like your printer model and your operating system help out a lot.
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • How can I be certain the contact list in my iPod touch updates my computer Outlook contact list when I sync and not go the other way? The options in iTunes are not specific enough.

    How can I be certain the contact list in my iPod touch updates my computer Outlook contact list when I sync and not go the other way? The options in iTunes are not specific enough. In other words, I want to replace the information in my computer Outlook contact list with the data from my iPod touch. 

    How is your iPod configured to sync music from your iTunes library?  In other words, what options and configurations do you have enabled from under the iPod's Summary and Music configuration panes in iTunes?
    B-rock

  • I get an error message when downloading ITunes :could not access the network location %public%\desktop\

    I get an error message when downloading ITunes "could not access the network location" %public%\desktop\?
    windows vista 32 bit

    Try the following user tip:
    "Could not access network location %PUBLIC%\Desktop\" install errors

  • HT204380 My iPhone and iPad are set up under the same account and when I try to FaceTime with the iPad or vice versa it says face time is busy and will not connect, how do I fix this

    My iPhone and iPad are set up under the same account and when I try to FaceTime with the iPad or vice versa it says face time is busy and will not connect, how do I fix this

    I can call my ipad with my iphone alll the time.  That's how I check up on my kids at home when I"m at work. You just set up to your iphone's facetime setting with your phone number and set up your ipad's facetime settings with your apple id (in this case it's your email)

  • How can I add a language on pages (Greek) to check the spelling when that language is not on the list?

    how can I add a language on pages (Greek) to check the spelling when that language is not on the list?
    I can see other languages available for spelling check, but not Greek and I dont see how to add it.
    I have added the Greek keyboard on the Mac, so I can write in Greek , but I dont know how to check the spelling in Greek on pages

    You can try to add a 3rd party spellchecker
    http://milaraki.com/blog/2010/11/greek-spelling-at-pages-how-to/

  • In version 10.1 fcpx how do I edit in proxy, then when I am finished share with optimize footage? It was easy in 10.9 version, but I can't figure this out in 10.1, please help.

    in version 10.1 fcpx how do I edit in proxy, then when I am finished share with optimize footage? It was easy in 10.9 version, but I can't figure this out in 10.1, please help.

    The switch is in the upper right of the viewer.

  • When i run keynote in the play mode, some times the computer get stuck, why?, when i run key note in the play mode, some times the computer get stuck, why?

    when i run keynote in the play mode, some times the computer get stuck, why?, when i run key note in the play mode, some times the computer get stuck, why?

    hello,
    I had the same issue. This is what I was told to do.
    iWork has to be removed completely to be effective when re-installing, you must use an application removal tool to do this or it wont remove every Keynote file.
    Appcleaner   will do this and its free.
    The following procedure has helped solve many issues with Keynote:
    1  Close Keynote then use Appcleaner
    2  Empty the Trash
    3  Shut down the Mac, then restart and press the shift key immediately after the startup sound, then release shift when the Apple logo appears
              allow the Mac to boot up to the desktop, it will take longer then usual as the hard drive is being repaired
    4  restart the Mac
    5  Reinstall iWork
    6  Repair permissions:
              Applications > Utilities > Disk Utility > First  Aid:   click on your system disc in the drive column
              and select Repair  Disk Permissions
    7  open Keynote and test

  • When I make a video with the camera ipad mini seen but not heard I can do ?

    when I make a video with the camera ipad mini seen but not heard I can do ?

    Yeah, of course you can. All you do is, open PhotoBooth, record your video and then, once you have stopped the video recording just drag the movie out of the bottom of PhotoBooth onto the desktop. It is in .mov format so you can then add it to iMovie for further editing or just upload it to youTube as it is.
    Easy as pie!

  • I do a movie whith iMovie. I finalize the project and I pass it to iDvd. Then I do a little menu and I burn my DVD. When I play my DVD on a computer or in my TV it ALWAYS begins directly with the movie and not with the menu... PLEASE HELP!!!!

    I do a movie whith iMovie. I finalize the project and I pass it to iDvd. Then I do a little menu and I burn my DVD. When I play my DVD on a computer or in my TV it ALWAYS begins directly with the movie and not with the menu... PLEASE HELP!!!!

    Go to the Map mode in your iDVD project and make sure the blue bin at the left is empty.  That's where you drag slideshows to if you want the DVD to open immediately to that slideshow and bypass the menu. 
    Click to view full size
    If there is an item in there drag it out.
    OT

Maybe you are looking for

  • How can i Open mail attachments in a separate Window

    Who knows how I can open attachments from mails like PDF and so on in a new window so that I just see he attachment not the email text and the attachment? Mercy

  • Can not print print after upgrade to Mac OS 10.8 Mountain Lion

    Hi all, I just upgrade Macbook air to Mountain Lion, but after upgrade it can not print due to "hold for Authentication" error. Mac asking for User name and password, I tried to enter my mac User name and password but can not help. I change to other

  • Not able to send mail through java

    Hi, I am sending an email through java but it gives me exception that Authentication failed exception but I have provided correct credentials I have given stack trace as below 19 Mar 2013 16:32:58,579 614378 [[ACTIVE] ExecuteThread: '4' for queue: 'w

  • Table controls

    hi friends i created a table control .but its giving syntax error like this . The field "AGE" is not assigned to a loop. "LOOP ... ENDLOOP" must appear in "PBO" and "PAI".           please help me. please look at this code . tables : zpr_table. data

  • Download helper converts to .flv instead of .avi

    since a few months when downloading a video from the same source, the download helper converts to .flv and no longer to.avi. what do I need to do to have .avi? Even if it downloads as .avi, it converts automatically to .flv . Thank you for help. Rgds