Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

background job

Former Member
0 Likes
1,890

What is the meaning of background job pl expalin in simple language

1 ACCEPTED SOLUTION
Read only

i048168
Product and Topic Expert
Product and Topic Expert
0 Likes
1,391

Hi,

There are various types of work processes that will serve different types of requests. They are

Dialog Work Process

Dialog work processes deal with requests from an active user to execute dialog steps (see also Dialog Programming).

Update Work Process

Update work processes execute database update requests. Update requests are part of an SAP LUW that bundle the database operations resulting from the dialog in a database LUW for processing in the background.

Background Work Process

Background work processes process programs that can be executed without user interaction (background jobs).

Enqueue Work Process

The enqueue work process administers a lock table in the shared memory area. The lock table contains the logical database locks for NetWeaver AS ABAP and is an important part of the SAP LUW concept. In NW AS, you may only have one lock table. You may therefore also only have one ABAP application server with enqueue work processes. Normally, a single enqueue work process is sufficient to perform the required tasks.

Spool Work Process

The spool work process passes sequential datasets to a printer or to optical archiving. Each ABAP application server may contain only one spool work process.

Background jobs run in a background work process that is different from dialog work processes. Background processing lets you move long running or resource-intensive program runs to times when the system load is low.

Here are the few points for consideration:

1. Limited Run Time: The Dialog work process has a run-time limit that prevents users from interactively running especially long reports. By default, the system terminates any dialog work process in a transaction that exceeds 300 seconds. Although this limit can be changed by Basis consultants but this is recommended. And if we talk about Background work process, there is no such limit applies to it.

2. Background work processes allocate memory differently than dialog work processes so that background work processes can become as large as they need to in allocated memory to allow for processing large volumes of data.

Hi,

All the Non-dialog and time consuming programs can be executed in the background using background workprocess provided by R/3 system using variants.

SM36 is the tcode to create BG job .

To schedule a background job (BG job) ,you basically need to privide job name,job class,target host name,start date and time and processing step information.

the job class entry decides the job execution priority.

Class A jobs have the highest priorities.these jobs ensure the functioning of R/3 and are time critical.

Class B jobs have medium pririty. these are periodoc jobs.

Class C jobs have normal priority.

we can create a back ground job for our program using job_open,submit,job_close function modules by passing corresponding parameters without specifying in SM36 tcode( as we use to chedule job thru SM36 and SM37 tcodes ).

Simple steps are .

1) open Sm36 .provide job name like Zreport_sch.

) Job class ( A , B,C )

) Target server (where you want to execute this BG job )

) press enter button provide abap program name and variant name and save.

go back to initial screen of sm36 press start conition button .Provide when you want to execute immeduately / date & time / , select check box if it periodic job..etc.

Press save button every time you do some changes .

) goto sm37 tcode and provide your job name entered in sm36 tcode initially.

provide corresponding values and press execute button.so the job will be executed in the time specified in sm36.

Regds

Sivaparvathi

Please reward points if helpful

6 REPLIES 6
Read only

Former Member
0 Likes
1,391

Hi,

You can schedule backgroung job using SM36.

BAckgroung job is scheduling a program in backgroung means if you want a program to run at a specific time and at a certain frequency you can do that in SM36.

we also schedule programs in backgroung which time out due to there long execution time in foreground.

Regards,

Mandeep

Edited by: Mandeep Sindhu on Jan 4, 2008 1:36 PM

Read only

Former Member
0 Likes
1,391

hi,

when u need to run a code daily at some specific time schedule it as a background job........it ll run daily and spool ll be created where u can find the results.

Read only

Former Member
0 Likes
1,391

Hi Krupa,

running something in the "background" means executing code with no user interaction

Means there is no user interaction...

For example..

u wanna execute one report daily at night 12 PM so u can schedule this report for background job... where enduser interaction is not needed...

Foreground means the report need the user interaction,...

Hope it will solve ur problem

Reward points if useful..

Thanks & Regards

ilesh 24x7

Read only

i048168
Product and Topic Expert
Product and Topic Expert
0 Likes
1,392

Hi,

There are various types of work processes that will serve different types of requests. They are

Dialog Work Process

Dialog work processes deal with requests from an active user to execute dialog steps (see also Dialog Programming).

Update Work Process

Update work processes execute database update requests. Update requests are part of an SAP LUW that bundle the database operations resulting from the dialog in a database LUW for processing in the background.

Background Work Process

Background work processes process programs that can be executed without user interaction (background jobs).

Enqueue Work Process

The enqueue work process administers a lock table in the shared memory area. The lock table contains the logical database locks for NetWeaver AS ABAP and is an important part of the SAP LUW concept. In NW AS, you may only have one lock table. You may therefore also only have one ABAP application server with enqueue work processes. Normally, a single enqueue work process is sufficient to perform the required tasks.

Spool Work Process

The spool work process passes sequential datasets to a printer or to optical archiving. Each ABAP application server may contain only one spool work process.

Background jobs run in a background work process that is different from dialog work processes. Background processing lets you move long running or resource-intensive program runs to times when the system load is low.

Here are the few points for consideration:

1. Limited Run Time: The Dialog work process has a run-time limit that prevents users from interactively running especially long reports. By default, the system terminates any dialog work process in a transaction that exceeds 300 seconds. Although this limit can be changed by Basis consultants but this is recommended. And if we talk about Background work process, there is no such limit applies to it.

2. Background work processes allocate memory differently than dialog work processes so that background work processes can become as large as they need to in allocated memory to allow for processing large volumes of data.

Read only

Former Member
0 Likes
1,391

Hi,

All the Non-dialog and time consuming programs can be executed in the background using background workprocess provided by R/3 system using variants.

SM36 is the tcode to create BG job .

To schedule a background job (BG job) ,you basically need to privide job name,job class,target host name,start date and time and processing step information.

the job class entry decides the job execution priority.

Class A jobs have the highest priorities.these jobs ensure the functioning of R/3 and are time critical.

Class B jobs have medium pririty. these are periodoc jobs.

Class C jobs have normal priority.

we can create a back ground job for our program using job_open,submit,job_close function modules by passing corresponding parameters without specifying in SM36 tcode( as we use to chedule job thru SM36 and SM37 tcodes ).

Simple steps are .

1) open Sm36 .provide job name like Zreport_sch.

) Job class ( A , B,C )

) Target server (where you want to execute this BG job )

) press enter button provide abap program name and variant name and save.

go back to initial screen of sm36 press start conition button .Provide when you want to execute immeduately / date & time / , select check box if it periodic job..etc.

Press save button every time you do some changes .

) goto sm37 tcode and provide your job name entered in sm36 tcode initially.

provide corresponding values and press execute button.so the job will be executed in the time specified in sm36.

Regds

Sivaparvathi

Please reward points if helpful

Read only

mahaboob_pathan
Contributor
0 Likes
1,391

hi,

With Release 4.0, there are now two ways to schedule external programs or commands in a job step. These are:

● External commands -- pre-defined symbolic names for commands or programs at the operating system level. External commands are intended for ordinary users. Because they are pre-defined in the SAP system and are authorizations-tested, the administrator has control over what users can do at the operating system level through background jobs.

● External programs -- OS commands that are directly entered into the job step specifications and for which no specific authorization test is carried out in the SAP system. Use of external programs is restricted to administrators (a special authorization is required.

You can schedule either an external command or an external program in a single job step, but not both. To schedule an external command, you use the COMMANDNAME and OPERATING SYSTEM parameters. To schedule an external program, you use the EXTPGM_NAME parameter.

Both external commands and external programs share the EXTPGM-parameters other than EXTPGM_NAME.

For more information, search for “External Programs” in the CCMS Guide.

  • Add a job step: external program

CALL FUNCTION 'JOB_SUBMIT'

EXPORTING

AUTHCKNAM = SY-UNAME “ User for runtime

“ authorizations

JOBCOUNT = JOBNUMBER “ From JOB_OPEN

JOBNAME = JOBNAME “ From JOB_OPEN

COMMANDNAME = EXTERNAL_COMMAND “ Name of a pre-defined

“ external command.

“ COMMANDNAME and

“ EXTPGM_NAME are

“ mutually-exclusive

“ alternatives.

“ Both

“ use the EXTPGM

“ parameters.

OPERATINGSYSTEM= 'AIX' “ Operating system for

“ choosing COMMANDNAME

“ variant.

EXTPGM_NAME = '/usr/exe/myexe' “ Pathname of an

“ external program;

“ an authorization

“ for S_RZL_ADM (CC

“ Control Center:

“ System Administration)

“ is required.

EXTPGM_PARAM = '<Parameter String>' “ Program parameters

EXTPGM_SYSTEM = 'host01' “ Host for execution

EXTPGM_WAIT_FOR_TERMINATION = 'X' “ Control flags for

EXTPGM_STDOUT_IN_JOBLOG = 'X' “ external programs:

EXTPGM_SET_TRACE_ON = 'X' “ see RSXPGDEF

EXTPGM_STDERR_IN_JOBLOG = 'X' “ documentation for

“ EXTPGM options

EXCEPTIONS

INVALID_JOBDATA = 02

JOBNAME_MISSING = 03

JOB_NOTEX = 04

JOB_SUBMIT_FAILED = 05

LOCK_FAILED = 06

PROGRAM_MISSING = 07

PROG_ABAP_AND_EXTPG_SET = 08

BAD_XPGFLAGS = 09

OTHERS = 99.

IF SY-SUBRC > 0.

<Error processing>

ENDIF.