Running a given Job immediately in background
Hi experts,
I have a requirement where I need to create a program which should take 'JOB NAME' as input and it should get executed immedieately in Background as soon as I execue the program.
I have tried using JOB_OPEN,JOB_SUBMIT, AND JOB_CLOSE.but I am facing challenge while using JOB_SUBMIT as 'Report name' is an mandatory importing parameter(which I don't have).
Can anyone help me out here?or do you think I can use SUBMIT for this req?(again i won't be having program name here).
Thanks,
Rahul.
Edited by: Rahul Siddi on Oct 14, 2009 12:07 PM
If job is predefined ,then u can do like below.
select jobname
jobcount
PROGNAME
VARIANT
from TBTCP
into table ZJOBTABLE
where jobname eq zjobname.
*call function job_open.
LOOP AT ZJOBTABLE INTO W_JOBTABLE .
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
AUTHCKNAM = SY-UNAME
JOBCOUNT = W_JOBTABLE -JOBCNT
JOBNAME = ZJOBNAME
REPORT = W_JOBTABLE-PROGNAME
VARIANT = W_JOBTABLE-VARIANT.
IF SY-SUBRC NE 0.
*message
ENDIF.
ENDLOOP.
*call function job_close.
Similar Messages
-
Need to run the BDC job immediately after XK02 is saved.
Hi all.
I have to trigger a batch job (BDC program) after changing the customer thru xk02 TRANACTION.
I found one exit EXIT_SAPMF02K_001 which checks before saving. But my requirement is job (BDC prog) should run after saving. So I guess its of no use. Do we have any BADI ( method)....?Can you pls let me know how to procede.
If workflow is the solution...
I have run the event traces by transaction code swel & sels, I could not find any event triggering to tigger the workflow ( to perform background task) Do I need to create Change document & BOR for acheiving this thru workflow .
Cheers,
sami.Hi Neha.
Thanks for quik turn around. But I need this z program to run after all changes are done in XK02 because I need to use the changed vendor data in the BDC program. This is the exit which triggers before save, so I couldn't get the changed vendor data from database table to use in z program (BDC).
Hope I am clear.
Cheers,
sami. -
Difference: Job run in foreground, job run in background and batch job
Hi Gurus,
Can you please help me to know what are the differences between job run in foreground, job run in background and batch job? Do jobs in foreground run in presentation server? Do jobs in background or batch jobs run in application server?
Thanks,
Kumarforeground job running may cause job running crash or failed if it is too big or server is busy and it take too long time. meantime it will take one sap session.
background job will run base on request server status. and it will not take your sap session. and it will not failed normally.
and you can get the result by SM37.
my experience show that big report run in background normally faster than in foreground.
Edited by: JiQing Zhao on Sep 3, 2010 4:13 AM -
DBMS_JOB in 9i: Run job immediately
Hello, ALL!
RDBMS Version: 9.0.1.0.0
Operating System and Version: Linux RadHat 7.2 - 2.4.7-10
Before, in RDBMS Version 8.1.7
I set initial parameter
job_queue_interval = 1
and run my job as:
DBMS_JOB.SUBMIT(JOB_ID, PROC_NAME, SYSDATE, 'NULL');
job run immediately (as I want).
RDBMS 9.0.1 hasn't parameter job_queue_interval,
and job running about 5 seconds..
If I still want to run my job immediately,
what I must to do?
Thank you,
WBR, Ivan.when all else fails, Read The Fine Manual
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e16760/d_job.htm#i1000807
"WHAT" parameter is supposed to be a PL/SQL procedure; not SQL statement(s) -
Execute a background job immediately
Hi everyone,
If a user wants to execute a background job immediately but there is no Background work process available. How u will do?
Regards
GaneshYes, as JIM said, the job will queue until a BTC become available. You can also increase the number of batch processes changing the value of rdisp/wp_no_btc = <Number of processes desired>, or use Operation modes to increase the ammount of batch processes during a specific period of time.
Hope this help!
Juan
Please reward points if helpful -
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
RadhikaHi 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 -
Is it possible to run a form offline (in the background)..?
Is it possible to run a form offline (in the background) by passing all the required parameters? I know this sounds crazy...but like to know if a form can be run in silent mode.
This will help us in reusing the form for online and background processing.
Thanks.If there is something to run in background, why would that be a form? Normally, a form is supposed to interact with the user.
If you want to do some data crunching in the database in background, then that should be a job. And, if needed, you may submit the job even from a form, after which you may close the form. RTM for dbms_job and dbms_scheduler - that should help. -
Solution Manager 7.1 - Monitor scripts which runs as cron job at OS level ?
Hi All,
We have Solution Manager 7.1 in our landscape and we have configured RCA, Monitoring.. Is it possible to Monitor the scripts running as Cron Job at the OS level?
If in case, the script stops due to an issue, we need to get the alert in Solution Manager.
Also can you please let us know whether it is possible to monitor jobs scheduled through external job scheduling tool.
Thanks & Regards,
Vaishali.KHi,
How to Schedule the background Job at the OS level:
Invoke a sapevent using a OS script and then have a SAP background job set to run on a sapevent. I say this assuming Unix and a job in crontab. I would guess the same thing could be done on a Windows system.
sapevt TRIGGER_NAME -t
pf=d:usrsapDEVsysprofileDEV_DVEBMGS00_SVRNAME nr
Kindly go through the links,hope this will help you out
[Steps to configure RCA and Monitoring in SolMan;
[http://help.sap.com/saphelp_45b/helpdata/en/c4/3a7ef8505211d189550000e829fbbd/content.htm]
Thanks & Regards
Ajitabh -
How to terminate the next job step in Background job?
Hi,
I have the requirement from the user that want to terminate the next job step in the background job that currently running (Status Active).
For example, Background Job A, contains 5 job step, once the background is running, we would like Job A not run thru job step 4 and 5, just run up to job step 3.
Anyone have any idea how can I do that?
Thanks
Nattawat S.Hi,
Try to delete instead of cancel in SM37.
To cancel and active job, select the job from SM37 and Click on STOP button in application toolbar. You can refer to your other thread for more info.
Regards -
ECATT:To run the test configuration in the background,
Hi All,
Can anyone guide me on , how i can run the ECATT Test script in background i.e. as background job.
My test script is running successfully in foreground and the usage of running it in background is mass upload of data.
Regards
Edited by: Shweta gupta on Jan 24, 2008 9:48 AMusername: portal
password: <same as ias_admin>
AS next step, you can disable Reports using SSO, or you can create other users (within SSO) with access to Reports so that they don't have to login as portal-user.
Regards,
Martin Malmstrom -
We currently have batch jobs that are running hourly. Theste jobs processes IDOCs that are in the queue. Sometimes the job runs for more than an hour causing a concurrrent session to be running at the same time which cause issues.
I was wondering if there was a way to set up the job so it will postpone the job if there is a current job running already.
I know of other external applications like Autosys or Tidal that can do it but I was wondering if there is anything in SAP.
Thanks for the help in advanceThe reason why we need to do this is because we don't want the job running at the same time trying to process the same IDOCs which may cause inconsistencies. So we were wondering if there was an option some where that will:
-run a batch job hourly,
-if batch job is still running, hold the next batch job and run during the next available hour.
-and have this run periodically.
Another reason is we only have 8 background processes - "limited resources". if multiple instances of same job start every hour due to large number of IDOCs, other jobs will have to wait.
your replies are much appreciated.
Thanks -
Script to stop running SQL Agent job without passing job name as a parameter
Looking for script to stop running job and don’t want to pass job name as a parameter, any job which is in running state I want that to be stop/disable.
I have script to disable all jobs however if any jobs are in running state my requirement is to stop that job immediately and gets disable.
RahulTry the below scripts and then apply script to disable all jobs.
execute xp_cmdshell 'net stop sqlserveragent'
execute xp_cmdshell 'net start sqlserveragent'
Regards, RSingh -
Sorting array not working when run as a job
I have a Powershell script that reads data from a log file, extracts a username and adds it to an array. I then sort the array to remove duplicates and export the data to a CSV file. The script works fine when run locally on the server but I need to call
the script remotely for a number of servers and when I do this it does not output anything to the CSV. The script is run as a job.
$ArrList = [System.Collections.ArrayList]@()
# open file and read data
$arrlist.Add("$final")
$arrlist | sort -unique | out-file c:\scripts\iis_users.csv
If I change the script to use add-content it can add entries to the same CSV file. But ideally I need to sort the output as there are many duplicates.Not sure why but that would only export the last user. I didn't have time to investigate so instead I decided to only add users to the array after first checking they didn't exist already:
if ($arrlist -notcontains $final)
$arrlist.Add("$final")
add-content c:\scripts\iis_users.csv "$final"
I thought this would create a performance hit but it seems almost as fast. -
How to get the status of Job scheduled in Background.
Hi,
I wanted to know the status of job scheduled in Background.
I am using below FM.
BP_JOB_STATUS_GET
but what value will it reutrn after completion of the job.
That the status is complete.Use the Table
TBTCO
to know the status
or else call the FUNCTION
BP_JOB_SELECT -
when I run a web browser immediately loaded two blank tabs. How to make the browser load the only one?
Did you check the home page setting to make sure that if doesn't have pipe (|) symbols?
See these articles for some suggestions:
*https://support.mozilla.org/kb/Firefox+has+just+updated+tab+shows+each+time+you+start+Firefox
*https://support.mozilla.org/kb/How+to+set+the+home+page - Firefox supports multiple home pages separated by '|' symbols
*http://kb.mozillazine.org/Preferences_not_saved
Maybe you are looking for
-
Help! iTunes only imports the first 3 seconds !!
When i insert a CD and select import the software only imports the first few seconds argghhh !
-
ESS / MSS Implementation for ECC 5.0 (ERP2004)
Hello, We are preparing to implement ESS/MSS for ERP2004. We are using EP6.0 SP9. The notes for both ESS and MSS business packages refer to OSS Note 761266 regarding the versioning of XSS components. Are the patches for the XSS components supposed
-
Stoping System Clock using Java code.
Is it possible to do so if yes then some code idea for Stoping System Clock using Java code. [email protected]
-
Servlet or jsp for online ordering system?
i'm new to servlet and jsp. i'm going to develop and online ordering which is still thinking to use servlet or jsp. If i want to develop a web-based ordering system with nice interface and most data will be retrieve from database, should i go for jsp
-
Keep getting an error message that reads, "LR An error has occurred while creating the book on Blurb" An error has occurred while trying to create texts and fonts. Pleas advise as Blurb has said that it's a LR issue.