Submit a job in background
Hi,
We have a query regarding submission of Jobs in background. If we use JOB_OPEN,JOB_CLOSE in our executable program to submit a job to run this proram with a transaction code and also schedule this job in background using SM36 the what will be the effect?
Hi pankaj,
1. If the program only display some data,
and does not update anything,
then nothing will go wrong.
2. Both programs will run independently of each other,
in background.
regards,
amit m.
Similar Messages
-
How to run a job in background programatically after 10 sec
Hi Forum,
Can anyone tell me How to run a job in background programatically after 10 sec..
Thanks in advanceHi,
Here is the example code
*Submit report as job(i.e. in background)
data: jobname like tbtcjob-jobname value
' TRANSFER TRANSLATION'.
data: jobcount like tbtcjob-jobcount,
host like msxxlist-host.
data: begin of starttime.
include structure tbtcstrt.
data: end of starttime.
data: starttimeimmediate like btch0000-char1.
* Job open
call function 'JOB_OPEN'
exporting
delanfrep = ' '
jobgroup = ' '
jobname = jobname
sdlstrtdt = sy-datum " You need to give the Date for execution the Job
sdlstrttm = sy-uzeit " You need to give the Time for execution the Job
importing
jobcount = jobcount
exceptions
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03.
if sy-subrc ne 0.
"error processing
endif.
* Insert process into job
SUBMIT zreport and return
with p_param1 = 'value'
with p_param2 = 'value'
user sy-uname
via job jobname
number jobcount.
if sy-subrc > 0.
"error processing
endif.
* Close job
starttime-sdlstrtdt = sy-datum + 1.
starttime-sdlstrttm = '220000'.
call function 'JOB_CLOSE'
exporting
event_id = starttime-eventid
event_param = starttime-eventparm
event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
laststrtdt = starttime-laststrtdt
laststrttm = starttime-laststrttm
prddays = 1
prdhours = 0
prdmins = 0
prdmonths = 0
prdweeks = 0
sdlstrtdt = starttime-sdlstrtdt
sdlstrttm = starttime-sdlstrttm
strtimmed = starttimeimmediate
targetsystem = host
exceptions
cant_start_immediate = 01
invalid_startdate = 02
jobname_missing = 03
job_close_failed = 04
job_nosteps = 05
job_notex = 06
lock_failed = 07
others = 99.
if sy-subrc eq 0.
"error processing
endif.
Regards
Sudheer -
Getting an unusual error message in Compressor 4.1 when I try to submit a job
I'm running Mavericks and have Compressor 4.1 on my Mac Pro along with FCP 10.1. When I submit a job to compressor, I then add the Dolby Digital and Mpeg-2 6.2 Mbps/90. When I hit Start Batch I get this error message
/var/folders/k9/f6fyk4sj4f3_rj2wlrlwx9hr0000gn/T/46BDF064-B30F-4BF1-8D9C-D22DE91 8342B.export-archive
I've tried to uninstall and re-install Compressor but to no avail. What is this error message referring to and how do I rectify it?
Thank you
DrewHi Drew if you haven't resolved this. TRy this to see if the issue is a TRANSIENT object access error instead for submitting directly to Compressor. Do this to isolate any content error defects before making you distribution (older 2 stage workflow)..
in FCPX 10.1, make sure the projects Primary Storyline is completely rendered - select all and cntl+R (render selection or control+shift+R)In FCPX 10.1 watch the background tasks (+9) and wait for all the rendering to be completed.... (make sure no object errors)
in FCPX 10.1 export a master File/Share/Master File (+E) as PRORES 4xx and save it ~/Movies/Drews_final_master.mov (prores)
in Compressor.app V4.1,
create a new BATCH ,
import the MASTER object ~/Movies/Drews_final_master.mov)
(and add your setting and submit it. (dont use FCPX SEND TO COMPRESSOR just yet! until you resolve this issue)
This process will avoid the use of transient file storage areas that seem to be used in the FCPX to COMPRESSOR.
Post your results for others to see
Warwick
Hong Kong -
Code to Submit RIMODGEN in the Background
Does anyone know how to submit RIMODGEN in the background? Here's a small clip of my code. I don't think the problem is with my parameters. The program executes but the integration model is not created.
CLEAR gt_params.
PERFORM load_params USING 'I_INCR' 'P' 'I' 'EQ' 'X'. "Dark Mode
PERFORM load_params USING 'I_MODID' 'P' 'I' 'EQ' p_model.
PERFORM load_params USING 'I_LOGSYS' 'P' 'I' 'EQ' p_lsys.
PERFORM load_params USING 'I_APPL' 'P' 'I' 'EQ' 'MATERIALS'.
PERFORM load_params USING 'I_MATINC' 'P' 'I' 'EQ' 'X'.
LOOP AT gt_mara INTO gs_mara.
PERFORM load_params USING 'MA_MATNR' 'S' 'I' 'EQ' gs_mara-matnr.
ENDLOOP.
SUBMIT rimodgen
WITH SELECTION-TABLE gt_params
AND RETURN.
Thanks in advance for any help someone can provide.
MikeCould you please elaborate on your requirement. In general we use SM36 and SM37 for IM creation and scheduling. For IM activation you have to use program RIMODAC2 and create and schedule job using SM36 and SM37
Thanks
Aparna
Edited by: Saradha Ramesh on Jun 12, 2009 6:15 PM -
Difference between batch job and Background Job
Hi Forum,
Can anyone distinguish between batch job and background job for me please ?
SKHi,
Batch Job:
A batch job is a process that runs in the background, often deferred and unattended, to process data in groups (batch) rather than by individual transactions (e.g. a monthly phone bill rather than a bill for each individual phone call). A batch job executes a sequence of programs and technical instructions that are stored in a command file. Progress and error messages are output to a log file allowing users to determine, at any time, if the batch job completed successfully or identify the cause of the problem. Because batch jobs run in the background they are less visible to the end user.
In a business-computing context, batch job scheduling implies the automatic execution of background tasks (batch jobs) at pre-determined points in time (e.g. every day at 8pm, midday on Wednesday).
3 types of batch job scheduling can be distinguished: native, basic and advanced batch job scheduling.
Most operating systems and some business solutions software come equipped with native batch job scheduling tools that provide a limited service (e.g. Windows Scheduled Tasks, UNIX crontab, SAP CCMS) locally to each installation. However, business processes may span multiple platforms, applications, countries and companies. Their complexity may require much more functional power as provided by basic batch job scheduling including national and regional variations in the working calendar, sequence variations according to the day of the month, triggering of jobs by the successful completion of preceding jobs, elimination of gaps and reduced batch windows. Major benefits of basic batch job scheduling are enhanced productivity, operations reliability and cost-reduction. For e-business applications that require real-time processing, the distance between interactive individual processing and batch processing tends to decrease. Advanced batch job scheduling can handle these advanced requirements: event-driven scheduling for a real-time synchronization with interactive processing, just-in-time scheduling to run operations as soon as possible, cross-platform and cross application services for the entire IT landscape, real-time overall monitoring to track background operations for all applications on all servers.
The standard benefits of batch job scheduling are drastically amplified when job schedulers can handle the end-to-end automation and monitoring requirements for all background operations.
To schedule a back ground job follow the below steps:
1. Use Transaction SM36.
2. Assign a job name.
3. Set the jobs priority, or Job Class:
High --- Class A
Medium --- Class B
Low ---Class C
4. Here you can specify,when the job is to start by choosing Start Condition. If you want the job to repeat, or be periodic, check the box at the bottom.
Else click on the immediate and save this.
5. Now,define the jobs steps by choosing Step.
Here you need to give the ABAP program that has been used and the name of the variant thats being used.
6. Save the fully defined job to submit it to the background processing system.(You need to click save button on the main screen i.e SM36)
7. When you need to modify, reschedule, or otherwise manipulate a job after you've scheduled it the first time, you'll manage jobs from the Job Overview.
8. Release the job so that it can run.
The job, even those scheduled for immediate processing, can not run without first being released.So,do remember to release.
Hope this helps you.
Regards,
Rakesh -
Error while running a job in background
Hi,
I got the following error message while running the job in background.
"Step 001 started .
Control Framework: Fatal error - GUI cannot be reached.
ABAP/4 processor: RAISE_EXCEPTION
Job cancelled"
What is the reason for this error and how to correct it?ALV Grid control is based on the custom controls on the screen. When the program is scheduled in background, it tries to create GUI related front-end objects and hence the error u201CFatal Error u2013 GUI cannot be reachedu201D. This type of problem is common with all the programs that use the ALV grid control to display the output.
Solution:
Whenever we execute this type of programs in background, we should be passing a blank docking container instead of the custom container as parent to our grid control.
The docking container doesnu2019t need any of the custom controls on the screen; instead it attaches an area to any or all of the four edges of the screen (top, left, right or bottom). The behavior of the areas in the container is determined by the sequence in which they are initialized. Docking Containers are attached to the screen from the inside out. This means that when you create a second container, it is attached to the edge of the screen, and the container that was already there is pushed outwards.
Let us modify the standard program (by taking a copy of it) to enable it to execute it in background.
Following modifications have to be made:
· Define a docking container in the program
data: or_doc type ref to cl_gui_docking_container .
· At the time of creating a custom container, check if the program is being executed in background or foreground. If the program is scheduled in background, then create a docking container instead of custom container.
if cl_gui_alv_grid=>offline( ) is initial.
create object or_custom_container
exporting container_name = c_container.
create object or_grid
exporting i_parent = or_custom_container.
else .
create object or_grid
exporting i_parent = or_doc .
endif .
Now test executing the program in background. The report would be generated. -
Problem Submit Via Job in BADI
Hello All
I am using SUBMIT VIA JOB in BADI "work order update" and but no job is created....also sy-subrc is 0.
Here is the code
call function 'JOB_OPEN'
exporting
jobname = name
importing
jobcount = number
exceptions
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
others = 4.
if sy-subrc = 0.
submit z_idoc_create_process_order and return
via job name number number
with p_aufnr = it_header1-aufnr
with p_werks = it_header1-werks
with p_autyp = c_autyp
with p_auart = it_header1-auart
with p_dispo = it_header1-dispo
with p_opt = c_opt
with p_mestyp = c_mestyp.
if sy-subrc = 0.
call function 'JOB_CLOSE'
exporting
jobcount = number
jobname = name
strtimmed = 'X'
exceptions
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
others = 8.
if sy-subrc <> 0.
endif.
Any reason why job is not created?
Thanks in advance.
regads
VInitHi guys,
I tried this
SUBMIT z_idoc_create_process_order USER creator using selection-set lv_variant TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
WITH p_aufnr EQ it_header1-aufnr
WITH p_werks EQ it_header1-werks
WITH p_autyp EQ c_autyp
WITH p_auart EQ it_header1-auart
WITH p_dispo EQ it_header1-dispo
WITH p_opt EQ c_opt
WITH p_mestyp EQ c_mestyp
VIA JOB name NUMBER number
AND RETURN.
Now the job is getting created but my Variant has no values
How to pass values to variant? below values are not getting tranferred.
WITH p_aufnr EQ it_header1-aufnr
WITH p_werks EQ it_header1-werks
WITH p_autyp EQ c_autyp
WITH p_auart EQ it_header1-auart
WITH p_dispo EQ it_header1-dispo
WITH p_opt EQ c_opt
WITH p_mestyp EQ c_mestyp -
Schedule job in background and ftp the data to non-sap system
Hello All,
I have a requirement where in i have to write a program(with selection screen) to download 2 files into application server(frequency: end of each day i.e daily at 23:59), and then in turn i need to put those two files into FTP server using FTP script.
i guess my flow of the code should be
1. write the program with selection screen and
2. get the data from corresponding tables and put it into internal tables.
3. then i have download the data into application server
my question is : how i will schedule the job in background to download the data into application server daily? using job_open, job_submit, job_close?
4. then how i need to move the files from application server to FTP server using FTP SCRIPT?
Also my doubt is once i execute the program ONLY, the background job is triigred (because i wrote job_open, job_submit and job_close inside my program). then how will i input the data into screen daily and download the data into application server in background automatically???? i am confused ...
Please help me to solve the above issues
thanks
sangeetha>
sangeetha s k wrote:
How my data in application server will be transfer to another system using above FM? Because i am not passing application server file path in SAP to that FM. Could you please explain ?
So the path name and the file name are always the same? In that case you could simply create a SM49 entry with hard coded file & path name.
An easy example for the COPY command under WINDOWS OS:
Create a command in SM49 called ZCOPY with following data:
Operating System = Windows NT
OS command: cmd
Parameters for os command: /C copy "C:\tmp\my_file.txt" "z:\tmp\my_file_copy.txt"
Additional parameters allowed: (leave blank)
In this case you would call SXPG_COMMAND_EXECUTE by filling this 2 parameters:
commandname = 'ZCOPY'
operatingsystem = 'Windows NT'
In the case that the file name and the path are not fixed you would set the following in the SM49 definition:
Additional parameters allowed: X
In this case you would call SXPG_COMMAND_EXECUTE by filling this 3 parameters:
commandname = 'ZCOPY'
operatingsystem = 'Windows NT'
additional_parameters = params "<== fill in the path and file name during run time into this variable -
How to delete a job in background programatically after 10 sec
Hi all,
Can anyone tell me how to delete a job in background programatically after the transaction is trigerred in 10 sec.
Yours help will be greatly appreciated
YathishHave a look at standard report RSBTCDEL. May be helpful to you.
Best Regards,
Vibha
*Please mark all the helpful answers -
We run a Job in a 10g (10g Enterprise Edition Release 10.2.0.4.0) DB using this code in SQL*Plus.
SQL> EDIT
Wrote file afiedt.buf
1 DECLARE
2 v_JobNum NUMBER;
3 BEGIN
4 DBMS_JOB.SUBMIT(v_JobNum,'chs_job_test;',sysdate, NULL);
5 DBMS_OUTPUT.PUT_LINE('Job # = ' || v_jobnum);
6 commit;
7* END;
8 /
PL/SQL procedure successfully completed.
SQL> set serverout on
SQL> /
Job # = 462Job runs successfully. i.e. the procedure chs_job_test is executed OK. Problem is when we query the USER_JOBS view, we don't see any record for Job 462??
Why is this??
Where can we get information of the jobs submitted???
If an error occured when running job, from where, which DD View we can get this?If you submit a job without specifying the NEXT_DATE and INTERVAL, Oracle treats it as a "single execution" job. It is removed from the job queue once it is completed.
Hemant K Chitale -
Is this the correct syntax to submit a job using DBMS_JOB.SUBMIT?
Hello,
Is this the correct syntax to submit a job?
DECLARE
v_job_number NUMBER;
v_job_command VARCHAR2(1000) := 'PREPARE_ORACLE_TEXT_SEARCH;';
v_interval VARCHAR2(1000) := 'trunc(SYSDATE)+1+7/24';
BEGIN
DBMS_JOB.SUBMIT(v_job_number, v_job_command, sysdate, v_interval, false);
COMMIT;
END;
Thanks
DougDECLARE
v_job_number NUMBER;
v_job_command VARCHAR2(1000) := 'BEGIN
PREPARE_ORACLE_TEXT_SEARCH; END;';
v_interval VARCHAR2(1000) :=
'trunc(SYSDATE)+1+7/24';
BEGIN
DBMS_JOB.SUBMIT(v_job_number, v_job_command, sysdate,
v_interval, false);
COMMIT;
END;
About your error:
PLS-00201: identifier 'PREPARE_ORACLE_TEXT_SEARCH'
must be declared
ORA-06550: line 1, column 96:
PL/SQL: Statement ignored
The problem is that the job cannot find the procedure
(maybe own by an other user). The user who run the
job is not the same as the owner of the package.
Bye, AronYou forget the semicolon after END.
But we don't need here begin - end Block.
So it's OK.
v_job_command VARCHAR2(1000) := 'PREPARE_ORACLE_TEXT_SEARCH;'[b];
As you right mentioned, it is probably problem with owner or typo in the name of procedure.
Regards
Dmytro Dekhtyaryuk
Message was edited by:
dekhtyar -
[abap] Running job in background
Hi !
When I am running a job in background using the functions :
'JOB_OPEN','JOB_SUBMIT','JOB_CLOSE'.
Eventually the job is in finished status, however
I get the following error popup message :
" classification locked (user username)
you cannot classify the batch
because the batch class is
currently being processed.
Do you want to try to carry out the
classification again ?
Please tell me what's the problem, and how to correct the problem ?.
Thanks
mosheMost likely you try to change data which is locked by another user to the same time in some cases - depending on what you were doing the locks are created by the same job in a previous step. In both cases there is only one scenario that works - check, resp. wait until the locks are released.
Christian -
How to submit a job into a job group
Using job events/actions we occasionally need for a scheduled job to submit another job into the current schedule.
The issue here is that the submitted jobs go straight into the highest level view. We will need to do this for over 400
times in one night, and do not wish to flood the operators view, so are simply trying to find a way to submit it so that
it shows up within an already existing group. Any ideas?It’s just a thought…… but you could..
Job Group A
Jobaa- run
Jobab – echo a blank file to a shared directory, example: /C "echo ''> \\USNPKETLP03\Infa_Shared\File_Inbound\zcmtyr_eu.csv
Job Group B
Jobba – run dependent on zcmtyr_eu.csv being present. Use the check box, “rerun each time the dependencies are met”
Jobbb – delete the echo file. -
Submit Multiple Job Definitions/Job Chains with same Time window/Submit frame in mass
Hi,
We have a requirement to submit multiple Job Definition/Job Chains which are part of common Time Window/Submit frame/Queue....
Ex. We have over 50+ different jobs/job chains which will runs Monday to Friday for every 2 hours on same Queue "XXX_Queue". Instead of submitting each job/job chain manually, we would like to know if we could use any script that can achieve our requirement? since we have couple of other jobs which fall under same scenarios...
We are on M33.104 version. Please let me know if any one has any scripts or alternate way of submitting multiple jobs/job chains in mass.
Thanks in advance!
Nidhi.Hi Nidhish,
Here is some code to set some stuff on a job:
//Get the partition, for global this is not necessary as global is default
Partition part = jcsSession.getPartitionByName("GLOBAL");
//Get the job definition
JobDefinition jobdef=jcsSession.getJobDefinitionByName(part, "System_Info");
//Get the submit frame
SubmitFrame sf = jcsSession.getSubmitFrameByName(part, "SF_Every_Year");
//Get the time window
TimeWindow tw = jcsSession.getTimeWindowByName(part, "System_Week_WorkingHours");
//Set the start time
DateTimeZone dtz = new DateTimeZone(2015, 10, 18, 15, 0, 0, 0);
//Get the Queue
Queue SystemQ=jcsSession.getQueueByName(part, "System");
//Create the Job
Job infoJob=jobdef.prepare();
//Attach queue to job
infoJob.setQueue(SystemQ);
//Attach submit frame, time window, start time
infoJob.setSubmitFrame(sf);
infoJob.setTimeWindow(tw);
infoJob.setRequestedStartTime(dtz);
//Print out the jobid of the job
jcsOut.println(infoJob.getJobId());
//Submit the job
jcsSession.persist();
Regards,
HP -
Downloading the file in our PC , when running the job in Background
Hi,
We have an enquiry for below requirment.
Our client runs some jobs in front end , but as the time taken to execute the JOB is more than 15 minutes , he is getting timeout problem, so we want to run the same program in background.
Generally the output of the report is to download the file into his desktop, so even when he is running
the same job in background he want it to be downloaded into his PC, instead of application servor.
We created a test program similar to the requirment, and ran the job in foreground and the file could easily be downloaded to desktop. Then we ran the program in backgound - The job failed with an error message Codepage could not be determined - Message no. FES025.
My Question is - is it possible to download the file into the desktop while running in background.
Please help me .
Thanks in advance.
Vengal Rao.Please search the forum. This question has been asked and answered many times before.
Rob
Maybe you are looking for
-
Problem with Conditional Formatting
When I use a an if end if statement to conditionally format a field I end up with double spacing between the rows. For example I have the following if statement: <?if:@RealNum!='0.000000' or @ColCnt='c1000'?> the field here<?end if?> With just the fi
-
We got a new Apple TV for Christmas and it works wonderful. However, my question is this. We are on a satelitte internet system and our bandwidth is limited. Can anyone tell me what effect it will have on using up my 10 megs of bandwidth? If I run ov
-
This used to wind me up about the blackerry. I don't want my sent sms messages to appear in the my inbox, its confusing. I like my inbox and my outbox to be seperate. Its the same with email. Every time I reply to a message, I get an email a minute l
-
Special characters not showing
Hello, I am having a strange problem with showing special characters in the browser when I upload the site. (its fine when I view it on localserver) For example on my website: http://www.reese-test2.co.uk/ if you do a search for example: 3GLG534WW -
-
Oracle Help in RH8, not working as it did before
We're building Oracle Help in Robohelp & recently upgraded to RH8. When I delivered the files to our dev team, the files won't work. This is what our dev person wrote to me: When I try to load the Oracle Help I get the following error message: oracle