Skip to Content
0
Former Member
Nov 01, 2010 at 09:39 AM

Scheduling a background abap report to run on a specific date

734 Views

Hello Experts,

I have an ABAP report I want to schedule in another program.

Basically, I want to schedule it, so that it runs the next day (sy-datum + 1). I have used FM Job_open followed by submit and Job close, but the program is executed immediately.

Below is the code snippet:

......

v_datenext = sy-datum + 1.

CALL FUNCTION 'JOB_OPEN'

EXPORTING

delanfrep = ' '

jobgroup = ' '

jobname = jobname

sdlstrtdt = v_datenext

sdlstrttm = sy-uzeit

IMPORTING

jobcount = jobcount.

SUBMIT z_prg_spinterf

WITH i_year EQ v_subyrnext

WITH i_month EQ app->g_str_header-f_month

WITH i_dc EQ 'B'

USER sy-uname

VIA JOB jobname

NUMBER jobcount

AND RETURN.

starttime-sdlstrttm = sy-uzeit + 60.

  • Close job

CALL FUNCTION 'JOB_CLOSE'

EXPORTING

jobcount = jobcount

jobname = jobname

  • prddays = 1

sdlstrtdt = v_datenext

sdlstrttm = starttime-sdlstrttm

strtimmed = starttimeimmediate

targetsystem = host.

The report z_prg_spinterf is getting executed immediately, which i dont want. I wanted it to be executed the next day.

Can someone help find out the source of the error. Maybe I am missing out something.

Thanks,

Nitish.