06-06-2013 8:08 PM
Dear Experts,
I have developed a report that does not have a selection screen and is meant to fill a z table and the program has to be executed in the background
through SM36. I have been asked by the Functional guy to create a T-Code for the development. I just need to ask that whether we can create a background job from SM36 through a T-code? I have always created a background job from program name but is it possible to create a background job from T-Code??
Please Guide.
Regards,
Mahesh
06-07-2013 6:16 AM
Hi Mahesh,
As far as I know you can not create a job using T Code.
BR,
Sandeep Katoch
06-07-2013 6:16 AM
Hi Mahesh,
As far as I know you can not create a job using T Code.
BR,
Sandeep Katoch
06-07-2013 6:30 AM
hi Mahesh,
The functional would have asked for a TCODE for online run of the program. This is generally to have a better authorization control in production scenario. You will have to schedule background job via Program Name only as per my knowledge. Anyways it doesnt matter in background job if you call using a program name or its transaction. I think you can once discuss with your FC guy and your issue would be sorted.
Please revert if still in doubt.
Regrads,
DN.
06-07-2013 6:34 AM
Hi Mahesh,
There is no options to Create Background Job using Transaction Code. We can Schedule Background jobs only on the basis of ABAP Program names.
Thanks & Regards,
Kumaran Duraiswamy.
06-07-2013 7:50 AM
Hi Mahesh,
You can create a job using the below code.
1) FM 'JOB OPEN' opens a job
2) Submit a job with name, where you can pass values into the parameter of submitting program.
specify the parameter of submitting program and the values to be passed to it using WITH statement
3) Close the job.
************************************SOURCE CODE***********************************************************
DATA: JOBNUM LIKE TBTCJOB-JOBCOUNT,
JOBNAME LIKE TBTCJOB-JOBNAME.
call function 'JOB_OPEN' .
exporting jobname = lv_jobname
importing jobcount = lv_jobcount
exceptions others = 1.
if sy-subrc = 0.
submit <report name> user sy-uname
via job lv_jobname
number lv_jobcount
with p_handle = XXXXXXXX
with val_15 = YYYYYYY
with p_corr1 = ZZZZZZZZ
and return.
if sy-subrc = 0.
call function 'JOB_CLOSE' "
exporting jobcount = lv_jobcount
jobname = lv_jobname
strtimmed = 'X'
exceptions others = 1.
*************************************************************************************************************
Regards,
Thanga Prakash T
06-07-2013 10:25 AM
06-07-2013 8:16 AM