Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Scheduling background job

Former Member
0 Likes
2,572

Hi,

My requirement is to create a wrapper program which have selection screen parameters.

This program will inturn schedule a background job to run immidiately. The job creates should run for the variant give on the selection screen of the wrapper program.

report A - wrapper program to schedule report B. Both programs at present have the same selection criteria. When I run the program A, it should use the selection criteria given to it and schedule background job for B to run immidiately.

How can I achive this.

Regards,

Shahu

1 ACCEPTED SOLUTION
Read only

Former Member
1,922

Hi Shahuraj,

Use FMs

JOB_OPEN : To open the Batch Job

JOB_SUBMIT : To submit the programm in background or else you can use

SUBMIT program Program name via selection screen with varient .

JOB_CLOSE : To close the batch job

Pls. reward points for all useful answers

Hi Shahuraj,

Use FMs

JOB_OPEN : To open the Batch Job

JOB_SUBMIT : To submit the programm in background or else you can use

SUBMIT program Program name via selection screen with varient .

JOB_CLOSE : To close the batch job

Pls. reward points for all useful answers

8 REPLIES 8
Read only

Former Member
1,922

Please use FM's: <b>JOB_OPEN, JOB_SUBMIT & JOB_CLOSE</b> for the same.

Also go through FM's in Function group: <b>BTCH</b> for more helpful FM's.

Kind Regards

Eswar

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
1,922

Hi,

Use FM JOB_OPEN for opening a background job and SUBMIT program with selection parameters , and close the job via JOB_CLOSE.

Read only

Former Member
1,923

Hi Shahuraj,

Use FMs

JOB_OPEN : To open the Batch Job

JOB_SUBMIT : To submit the programm in background or else you can use

SUBMIT program Program name via selection screen with varient .

JOB_CLOSE : To close the batch job

Pls. reward points for all useful answers

Read only

Former Member
0 Likes
1,922

hi,

job_open,

job_close,

job_submit.

call transaction <tcode> using it_bdcdata mode 'N'

update 'S'

messages into it_messages.

to schedule a background job goto sm36 and create a job with a name & save it.

check this link.

http://help.sap.com/saphelp_nw04/helpdata/en/73/69ef5755bb11d189680000e829fbbd/content.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/2c513897110872e10000009b38f889/content.htm

hope this helps!!!

Message was edited by:

Gayatri M

Read only

Former Member
0 Likes
1,922

hi..

Goto Transaction SM36,

1. Give job name, Traget server and priority.

2. Add step, in that give your program name and variant.

3. Click start conditions and give the date and time for execution.

4. Save the job.

5. Check the job status using transaction SM37

If you want to schedule the job immediately, then from selection screen of your report press F9 and give the start time as immediate. this will schedule the program to run in background. Check the status of job using transaction SM37.

Hope this helps. reward if so.

Read only

Former Member
1,922

Hi Shahu,

Use the following Steps for calling report B from wrapper report A:

1. First of all call the the FM 'JOB OPEN' FM with the name of report A in jobname parameter & BATCH INPUT in jobname parameter.

2. IF sy-subrc value is true, then use submit statement as under:

SUBMIT <REPORT B name> VIA JOB <Report A name> NUMBER f_jobnum(f_jobnum would be returned by FM JOB OPEN used in step 1.) AND RETURN.

3. Finally Call the FM 'JOB CLOSE' to end the processing.

Do let me know if you need any other information.

Regards,

Chetan.

PS:Reward points if this helps.

Read only

0 Likes
1,922

Hi,

Thank you for the valuable responses.

It has solved my issue.

Regards,

Shahu

Read only

Former Member
0 Likes
1,922

hi..

jus try with the below func mod's too.

job_open,

job_close,

job_submit.

all the best