Troubleshooting Background Issues

Objectives

After completing this lesson, you will be able to:
  • List utility programs and tables for background processing
  • Analyze problems in background processing

Tables, Authorizations and Utility Programs in Background Processing

The following figure shows selected tables, authorization objects and utility programs that are used in background processing:

Tables in Background Processing

Table TBTCO is often called the batch main table. Each batch job has exactly one entry in this table.

Job steps data are stored in table TBTCP. There is a 1:n relationship between TBTCO and TBTCP. TBTCP contains one entry for each job step.

Table TBTCS contains information of all time based jobs (job, with start condition Date / Time), which have not started yet (job, with start condition Date / Time). There is one entry for each such job. The time based scheduler, which is a part of the batch runtime system, select jobs from this table in small periods of time and start it.

Similar to TBTCS table, table BTCEVTJOBS contains information of each event based job, which is still "waiting" for its event to start.

Table TBTCCNTXT is used for storing the application specific return code of a job and the parent child information of jobs.

Certain activities of the batch runtime system are recorded in table BTCCTL .For example: the time stamp of the last execution of the time scheduler and event scheduler.

The table BTCOPTIONS finally can be considered as a configuration table.

Authorization Objects in Background Processing

A user with BTCADMIN = Y for authorization object S_BTCH_ADM can

  • Access background jobs in all clients of an SAP system. In the job overview, the system displays all background jobs throughout the system.

    Note

    Without this authorization, users can only work on background jobs in the clients in which they are logged on.

  • Perform all functions on background jobs.
  • Execute external programs in job steps.

Other values for BTCADMIN for this authorization object may for example allow to copy other users' jobs or create periodic jobs.

The authorization object S_BTCH_JOB consists of the authorization fields JOBACTION and JOBGROUP. JOBGROUP must always have the value *. For JOBACTION, you can assign the values: PLAN (copy or repeat other users' jobs), DELE (delete other users' background jobs.), RELE (release jobs (including your own)), SHOW (display definitions of other users' jobs), and MODI (modify other users' jobs.).

Note

A user without any specific authorization for jobs may perform the following actions:

  • Schedule jobs for which the job class is C and cannot be changed.
  • View and change steps of his or her own jobs.
  • Delete his or her own jobs.
  • View the job details of his or her own jobs.

Authorization object S_BTCH_NAM (with authorization field BTCUNAME – user name that a user can specify as an authorized user) determines the authorized users, which users can choose from when scheduling a background job.

Note

A user can always enter himself or herself as an authorized user when scheduling a job. Thus, an authorization for this object is only required if your users need to use other users as authorized users. This could be the case, for example, if a user requires special authorizations for background jobs.

With authorization object S_BTCH_NA1, an enhancement is available that also checks the program to schedule as well as the user (additional authorization field PROGNAME for the name of the program they want to run in the background).

Hint

Programs can be scheduled without a start authorization check as a job step if they are not assigned to an authorization group. SAP Note 1946079 introduced the supplementary authorization check of the authorization object S_PROGNAM for the dialog-based generic program start. SAP Note 2272827Check of S_PROGNAM for scheduling of job step enables the additional authorization check if job steps are scheduled using transaction SM36 or the job API, too.

Finally, authorization object S_LOG_COM (with authorization fields COMMAND for the name of the external commands, OPSYSTEM for the type of operation system on the target host) and HOST (for the hostname of the target host) needs to be assigned to users who want to create job steps with external commands in background processing. For more information, see SAP Note 854060Authorizations for external commands.

Note

For the execution of external programs, you need system administrator authorization (authorization object S_RZL_ADM), see SAP Note 859104Authorizations for external programs.

Selected Utility Programs

A number of utility programs already exist for certain tasks within background processing. SAP Note 997328Utility programs for background processing lists some of them together with specific SAP Notes for each of the programs. These programs have been extended over time. For example, SAP Note 1439806Listing jobs according to their frequency ships report BTCAUX14 which (among others) list how often a particular job runs in a certain time period.

In the same way, SAP Note 1180215Test programs for the XBP interface also contains a list of programs including a link to additional SAP Notes.

Components Involved in Background Processing

The following figure shows the components that are involved in processing various types of background jobs.

Troubleshooting the Background Processing System

Problems in SAP background processing can be classified as follows:

  • Configuration problems

  • Administration problems

  • Runtime problems.

The following examples show case studies how the different analysis tools may be used for troubleshooting:

When a job was not started, (besides of obvious things such as the start date has not yet been reached) you may proceed as follows:

  1. Check whether the user who has scheduled the job has the authorization to release the job.
  2. Check whether the job has a target server assigned and – if "yes" – if there is a free background work process on the target server for the job class requested.
  3. Use the analysis tool for background processing (transaction SM65) to check the profile parameters of the background processing on all applicable application servers.
  4. Check the system log (transaction SM21) on all applicable application servers for unusual entries.
  5. Record the component of the background processing which is responsible for starting the job and analyze the trace information. For this, enter transaction SM61 and switch to change mode (Modify control object list entry). Switch on the trace level for the control object you want to check (and do not forget to switch off the trace again later). As long as the control object has run at least once, you can have a look at the trace file for the work process on the appropriate application server.

    Note

    In the case of control objects that run in dialog work processes, it is not possible to predict in which of the available work processes the object will be processed. However, it is quite likely to be work process 0 or 1. The best approach is to sort the list of trace files according to date and time (transaction AL11). The trace entries should be found in one of the most recently written trace files. Look through the files for entries that have an "L" in the first column.

    For control objects that run in a background work process, you can find the work process number in the job detail data in the job overview (transaction SM37).

For additional information, see SAP Note 165084Why does my job not start?.

When the job terminates unexpectedly, you may proceed as follows:

  1. Display the job log and check for any error messages. For example there may be a variant for an ABAP program that cannot be found, a runtime error in an ABAP program has occurred or an external program could not be started.
  2. Check whether the job has a target server assigned and then check the system log (transaction SM21) on all applicable application servers for unusual entries.

When the job remains in status 'active', you may proceed as follows:

  1. Check whether the job really is still running. For this, select the job in the job overview (transaction SM37) and choose JobCheck Status. If the job is still active, you may try to capture it (JobCapture: active job). This can be used to pause and analyze an active job which is in the middle of executing an ABAP program. An ABAP debugger window is opened, showing the ABAP program code at the point at which it is being executed. The code can then be analyzed.

    Note

    However, this only works for ABAP programs that are executed as job steps. It is not possible to analyze external programs in this way. For an external program, the check for whether it is still active has to be made at the operating system level.

  2. Check whether the job waits for an external program that is being executed in the job to be terminated. In this case it might be helpful to check whether the user SAPCPIC exists in the client in which the job is running.
  3. Check whether the job server was restarted while the job was running. For this, you need to

    • find out the start time and the execution host of the job (for example, by checking the job log)
    • find out when the job server was last started (by checking the system log of the job server) .
  4. When the job server was restarted while the job was running.,the runtime environment of the background processing system may not have been able to update the job status in the database. In this case, you may try to manually set the job status to canceled (JobCancel active job in transaction SM37).

Additional Information

For more information on trouble shooting, see SAP Note 3008195FAQ: Background Processing BC-CCM-BTC-* and the Support Wiki for SAP Background Processing System (https://wiki.scn.sap.com/wiki/display/SI/SAP+Background+Processing+System).

Additional Information on Background Processing

The following section contains some typical question related to background processing, together with some SAP Notes.

Where can I get more information about background jobs?

Note the answers provided in SAP Notes31503: FAQ: Background jobs and 3008195FAQ: Background Processing BC-CCM-BTC-*.

How can I debug programs in the background?

Note the procedure described in SAP Note 573128: Debugging programs in the background.

Identifying jobs with deleted users

Note the solution described in SAP Note 1533612: Identify jobs with deleted users which ships program BTCAUX09.

How often does each job run?

Note the solution described in SAP Note 1439806: Listing jobs according to their frequency which ships program BTCAUX14. Transaction SM37C (Extended Job Selection) gives you another way to access this valuable information under GotoJob Statistics.

Why does my job not start?

Note the solution described in SAP Note 165084: Why does my job not start?.

How can I see who has deleted which job?

Note the solution described in SAP Note 850885: Logging the deletion of jobs.

How can I log calls of external commands?

Note the solution described in SAP Note 1663158: Logging calls of external commands.

How can I select jobs with the step user, SM37C?

Note the solution described in SAP Note 1742282: Job selection by step user referring to transaction SM37C.

What is the meaning of program BTC_OPTIONS_SET?

The program BTC_OPTIONS_SET offers you versatile options for background processing in your system. For each option in this report, the SAP Note that provides additional information for the relevant function is identified.

Which transaction can I use to only display jobs?

Note the solution described in SAP Note 1665057: Display transaction for background jobs.

Errors occur during the multiple scheduling of periodic jobs. What can I do?

Note the solution described in SAP Note 1130883: Periodic job is scheduled several times which ships program BTCAUX04.

My job uses a printer that does not exist anymore and reports errors.

Note the solution described in SAP Note 1226171: Identifying jobs with deleted printer which ships program BTCAUX02.

In which job has this spool request been created?

Note the solution described in SAP Note 1145265: In which job has this spool request been created? which ships program BTCAUX05. Alternatively, you can also access this function in transaction SM37C with the menu path GotoFurther SelectionsJobs for Spool Request. This path is only available in AS ABAP-based SAP systems as of SAP_BASIS 731.

Why are background processing jobs not generally transportable?

Note the information described in SAP Note 51135: Why are bkgd processing jobs not generally transportable?.

Log in to track your progress & complete quizzes