Execute ABAP Program in Background as Background Task
SAP enables ABAP developers to execute ABAP programs execute in background just like a background task or a job.
Programmers run ABAP reports using SE38 transaction and are able to configure execution of ABAP programs in background using same SAP transaction SE38.
This ABAP tutorial shows how to execute programs in background using SE38 and display process of background execution using SM37 tcode in SAP system.
I have recently created a batch process and converted the batch process into an ABAP program by adding select option for VBELN billing document number field.
Now I want to execute this ABAP program with given select option values (document number for invoices) as a SAP background job.
Running the ABAP report (program) as a background task will prevent useless screen displays, etc.
It will execute faster as well.
First of all, call SAP transaction SE38 and provide the ABAP program name. Press Execute icon or F8 to display the initial screen for providing select option values required for the program to run.
Provide selection screen parameters for the report.
On top SAP menu, select Program > Execute in Background (F9) menu options.
You can set a dummy printer name (output device) if the ABAP program is not printing any thing.
Otherwise, you have to define the correct printer as tha target output device for the resultant outputs from your ABAP report.
As I said, since I will not print any documents, the about information about formatting is not related with my case.
On below screen titled "Start Time", you can schedule the execution time and frequency of this ABAP program for a background task.
Since I'll not schedule this ABAP report execution periodically, I chosed "Immediate" to execute the ABAP program immediately for only once.
Leave "Periodic job" select option clear, if you want to run ABAP program once. If you want to execute it periodically, you can configure it too.
Press Save button. When you save the background execution configuration, the ABAP report is automatically started as a background task.
Using SM37 SAP transaction code, ABAP developer can check the execution status of the background jobs or the background task created previously defined on the target system.
On below SM37 Simple Job Selection SAP screen, I provide filter data to list my background report execution tasks.
Here are the background tasks where I execute an ABAP program and I can see the start time, end time and duration details for each background task execution.