SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software
Development resources, articles, tutorials, code samples, tools and downloads for SAP HANA and ABAP, HANA Database, SQLScript, SAP UI5, Screen Personas, Web Dynpro, Workflow

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.

run ABAP batch program in background

Provide selection screen parameters for the report.

On top SAP menu, select Program > Execute in Background (F9) menu options.

execute ABAP program in background

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.

SAP print parameters for background execution

As I said, since I will not print any documents, the about information about formatting is not related with my case.

SAP output formatting options

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.

configure start time for ABAP report to execute in background

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.

immediate start for ABAP program in background

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.

SAP SM37 transaction to display execution of background 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.

SAP job overview list for ABAP program execution in background


Install SAP Free
CRM Companies List
Web Based CRM Software

Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.