Want to learn ABAP for FREE with direct access to community of students and ABAP experts?
Sometimes your program may contain logic that must run long time. In such case, you can’t easily run it by pressing ‘Execute’ program, because SAP has defined maximum number of seconds that is able to run any programs this way (it’s called foreground processing).
In such case, you must execute the program differently. You have to run it in background.
How to run ABAP program in background?
Well, there are more ways of starting program in background.
When to use this approach?
If you run your program with selection screen, follow this steplist: http://abapacademy.com/blog/how-to-run-abap-program-in-background-manually-easy-way/.
Go to SE36 to define new Background Process / Job
Hit Save button or press CRTL+S.
Fill all needed fields for scheduling ABAP program as shown below and hit Save button.
In this stage, your job is saved and scheduled.
Go to SM37 transaction to view all background jobs and we will start the job from there.
Fill your job name and make sure that you check ‘Sched.’ Checkbox to display also scheduled jobs.
Then press F8 or Execute to display jobs.
This is how screen looks like. In my case, I have displayed 2 jobs. First one is the scheduled one, which I am looking for + one has been canceled.
Left click on scheduled job and then hit ‘Release’ button to start job execution.
Then choose, when do you want to start running this job. I choose to run it immediately.
And then hit Save.
The job, gets immediately into ‘Ready’ state. It means that it is ready to start at any time, when work process will be available to start.
If you have no background jobs running on your system and you hit ‘Refresh’ button or press F8, you should immediately see that your job goes into ‘Active’ state.
In this moment, the job is already running.