Dear All,
I am scheduling background job using JOB_OPEN SUBMIT JOB_CLOSE.
I want to schedule it at a specific time for that I have used two parameters in FM JOB_CLOSE
1.SDLSTRTTM (job schedule time)
2.SDLSTRTDT (job schedule date).
Using above parameters I am able to schedule the job at specific time. But every time when the scheduled job time arrives it takes 12 seconds delay to make the job Active from Released status.
I don't want this delay, kindly help me.
With Regards,
Akshay
See the following example you just set WAIT UP TO 1 SECONDS.
DATA : new_jobname TYPE tbtcp-jobname ,
jobcount TYPE tbtcjob-jobcount,
print_parameters TYPE pri_params,
user_name TYPE sy-uname,
default_language TYPE sy-langu,
rc(4) TYPE c,
info_msg(125) TYPE c,
l_variant TYPE raldb-variant VALUE 'SAP&CONNECTINT'.
new_jobname = 'SENDMAIL'.
print_parameters-pdest = sy-pdest.
print_parameters-primm = sy-primm.
print_parameters-prnew = sy-prnew.
WAIT UP TO 1 SECONDS.
user_name = sy-uname.
default_language = sy-langu.
*-- CREATE THE JOB
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = new_jobname
IMPORTING
jobcount = jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'JOB_SUBMIT'
EXPORTING
authcknam = sy-uname
jobcount = jobcount
jobname = new_jobname
language = default_language
priparams = print_parameters
report = 'RSCONN01'
variant = l_variant
EXCEPTIONS
bad_priparams = 1
bad_xpgflags = 2
invalid_jobdata = 3
jobname_missing = 4
job_notex = 5
job_submit_failed = 6
lock_failed = 7
program_missing = 8
prog_abap_and_extpg_set = 9
OTHERS = 10.
IF sy-subrc EQ 4.
MESSAGE s000(38) WITH 'User cancelled the action'.
ELSEIF sy-subrc <> 0.
MOVE sy-subrc TO rc.
CONCATENATE 'Job Submit Failed. sy-subrc:' rc INTO info_msg
SEPARATED BY space.
MESSAGE w208(00) WITH info_msg.
ELSE.
MESSAGE 'Background Job Scheduled Successfully' TYPE 'I'.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = jobcount
jobname = new_jobname
strtimmed = 'X'
* targetserver = 'ctecpci_ECP_02'
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.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
LEAVE PROGRAM.
Dear Krupa Janiji,
I wants to schedule it on specific time in day, when the scheduled time arrives, it takes 12 seconds to become active from released status when system hits the background job scheduled time.
With Regards,
Akshay
Hi Akshay Gujrati
schedule it 12 seconds earlier :-)
(hate simple solutions?)
Regards,
Clemens
Dear Clemens Li ,
I am using a background job(execution time is 150 sec) which has to be executed approx. 60 times a day as per background scheduled time, before every execution it takes 12 sec more to become Active.
So to schedule it 12 sec earlier is not solution for this as I am having approx 60 jobs in queue. & this blocks systems background process for 12 sec before every job.
With Regards,
Akshay
Hi Akshay,
If your background processes are not free, there will be a delay.
Check these discussions are suitable for you.
Dear Shambu VS,
Irrespective of free Background process, it takes 12 seconds exactly every time.
With Regards,
Akshay
Hmm...then why dont you schedule this 12 seconds earlier as an intermediate solution ![]()
Hi Akshay,
If you really need to start at an exact time (but I don't advise, as for accounting systems, we usually don't care about jobs running late), you'd better have a job running a certain time before (so that you are comfortable), and wait until the time has been reached.
Regards,
Sandra
You can change the job class to 'A'
This is not an ABAP question, better ask Basis team on parameter rdisp/btctime. Read also Note 519059 - FAQ: Background processing system for better understanding.
(Of course you could submit the job some seconds earlier and use a WAIT statement at the start of the program or adding a first step z-program in case of standard program to start at the exact scheduled time
)
Regards,
Raymond