Showing posts with label Background Jobs. Show all posts
Showing posts with label Background Jobs. Show all posts

Report RSBTCDEL2 to delete old jobs

The job SAP_REORG_JOBS is a standard job which runs a report RSBTCDEL2 to delete old, canceled, inconsistent, non-deleted jobs from the system. But the SAP systems older than release 4.7 used RSBTCDEL report to delete the old jobs. But in those systems, after upgrade it may not run and create a dump TSV_TNEW_PAGE_ALLOC_FAILED as the old jobs get accumulated and cause memory problem.

Solution: So in those systems we need to schedule a job with report RSBTCDEL2 and variant which specifies the time range after which the jobs need to get deleted from the system. To create a new variant for the report RSBTCDEL2 we need to know the time range after which the jobs need to get deleted from the client.

1. Create a new variant in Transaction SE38 specifying the number of day’s range after which the jobs need to get deleted from the system.




2. Change the job from released to scheduled and delete the old RSBTCDEL report. Schedule it with the new job RSBTCDEL2




click on save

The job will now work fine since the program and Variant have been replaced.

How to stop Active Background Jobs?

We cannot stop the active background job, however we can pause the active jobs. Goto SA38 and run the report "BTCTRNS1" to suspend/deschedule all the scheduled jobs,ie Move Jobs with Status "Rescheduled due to Upgrade",use program BTCTRNS2 Release jobs with status "Descheduled due to upgrade".

Control Object Types

Definition

You can test and analyze the following objects:

Job starter

The part of the background processing system that starts a job and executes the various job steps.

Time-driven scheduler

The part of the background processing system that prepares jobs for background processing according to their scheduled start times. It runs at regular intervals and determines whether the scheduled start times of released jobs have been reached. Any such jobs found are started by the job starter in the local application server as soon as background work processes become available.

The time interval at which the scheduler is started is laid down in parameter rdisp/btctime .

Event-driven scheduler

The part of the background processing system that prepares jobs for background processing dependent on defined events.

It is triggered each time an event occurs and checks whether any released jobs are linked to this event. Affected jobs are started in the local application server by the job starter as soon as background work processes become available.

External program

The SAP part of the control program that starts an external program from within the background processing system

If required, the external program can store the standard output or standard error output of the external program and can receive the return code from the program, which also goes to the job log.

Zombie clean-up

Removes jobs interrupted by a system crash. Although they have been abnormally terminated, these jobs would have status active because normal processing of the termination could not take place.

When the zombie clean-up is triggered, it determines which jobs have status active but are not currently being processed and then changes the status of these jobs to terminated, allowing you to remove or reschedule the jobs.

In a multi-server environment, another server handles the clean-up for the crashed server. On the other hand, in a single server environment, the zombie clean-up is done when the crashed system is restarted.

Displaying a Job Log

Use

All message types issued by a program running in the background are stored in a job log, which you can display either to obtain information on a prematurely terminated program or to complete a detailed investigation of a particular background processing run. A separate log file is created for each job.

Deleting Log Files

You should never delete log files directly. If you want to clear the log directory, you must delete the jobs to which the logs belong. In the process, the logs are also deleted.

Job logs are held in the TemSe temporary sequential objects storage facility. TemSe is configured to always store job logs as operating system files in the shared SAP directories. If you delete log files directly at the operating system level, you create inconsistencies in the TemSe database, which you'll then need to eliminate with the Consistency check function in Transaction SP12.

Log Messages

Log messages are generally output using ABAP keyword MESSAGE. With the exception of ABAP breakpoint statistics, no other data is normally output to the job log.

ABAP Short Dumps

If an ABAP program generated a dump when it terminated abnormally, you can display the dump by clicking on the Abend message.

Batch Input Messages

Messages output during batch input sessions are not recorded in the job log. These messages are output only to the batch input system.

Procedure

...

1. Go to Select Background Jobs using Transaction SM37 or by choosing CCMS ® Jobs ® Maintenance.

2. Select the jobs you want to review in the job log by specifying conditions that identify the job or jobs, including job name, user name, job status, start condition, or contents of a job step. Execute this selection to see a list of jobs that match these criteria.

3. In the Job overview screen, select your desired job and choose Job log.

4. In the Job Log Entries for screen, the date and time of each job step is listed along with identification of any system-generated messages that apply to each step. Message types include A (Abend), E (Error), S (Successful processing completed), I (Information), and W (Warning).

5. You can print the job log (Job log ® Print list) or save the log by exporting it to a word processing, spreadsheet, or local file (Job log ® Print list ® Export ® ).

6. For further information about a particular item in the job log, select the line and choose Long text. The resulting help screen can include further information about diagnosing the message, the system’s response to the message, and how the user should follow up.

End of Content Area

Required Background Jobs

Definition

There are several background jobs that should run periodically in a production SAP System. These jobs perform housekeeping chores such as deleting outdated spool requests of background jobs.

You should schedule each of these jobs for periodic execution according to the schedule shown in the following table.


This list does not include housekeeping and reorganization programs that belong to SAP applications. See the customizing system for more information on these programs.

By following the naming conventions shown in the table, you help ensure that SAP will be able to verify that these programs are properly scheduled in the event of any problems.

Periodic Jobs Required for Housekeeping:


Job Name

ABAP Program

Required
Variant


How Often?

SAP_REORG_JOBS
Deletes old background jobs.

RSBTCDEL

You must create a variant.

Daily

SAP_REORG_SPOOL
Deletes old spool requests.

RSPO0041

You must create a variant.

Daily

SAP_REORG_BATCHINPUT
Deletes old batch input sessions.

This job may not run at the same time as normal batch input activity. Schedule this job for periods during which no batch input sessions are run.

RSBDCREO

You must create a variant.

Daily

SAP_REORG_ABAPDUMPS
Deletes old dumps produced by ABAP abnormal terminations.

Alternative: To keep from needing to schedule this job, run the ABAP report RSNAPJOB from the ABAP editor instead. This schedules RSSNAPDL as follows:

Job name: RSSNAPDL
Variant name: DEFAULT (you must create this variant)
Start time: 0100 AM
Repeat interval: Daily

RSSNAPDL

You must create a variant.

Daily

SAP_REORG_JOBSTATISTIC
Deletes job statistics for jobs not run since the specified date (statistics no longer needed since job was a one-time occurrence or is no longer run)

RSBPSTDE

You must create a variant.

Monthly

SAP_REORG_UPDATERECORDS
Deletes old completed update records (automatic delete deactivated); deletes incomplete update records (automatic delete deactivated)


Run this job ONLY if:

· You have deactivated the default automatic deletion of update records once they have been processed. This function is controlled by the system profile parameter rdisp/vb_delete_after_execution

· You have deactivated the default automatic deletion of incomplete update records (records that are partially created when an update header is created and saved but the generating transaction then ends abnormally). This function is controlled by system profile parameter rdisp/vbreorg

· You have deactivated processing of V2 update components after the processing of the associated V1 updates. This function is controlled by system profile parameter rdisp/vb_v2_start.

RSM13002

None.

Daily

SAP_COLLECTOR_FOR_JOBSTATISTIC
Generates runtime statistics for background jobs

RSBPCOLL

None.

Daily

SAP_COLLECTOR_FOR_PERFMONITOR
Collects system performance statistics

Note

This job was previously called COLLECTOR_FOR_PERFORMANCE_MONITOR. When scheduling this job, be sure to use the new name.

RSCOLL00 schedules all reports that need to run for the performance monitor using table TCOLL to determine what to run. See the CCMS Guide for more information on setting up RSCOLL00.

RSCOLL00

None.

Hourly

End of Content Area

What is Background Processing

Start of Content Area

In background processing, the SAP System automatically runs any report or program that you can start interactively.

When you schedule a job in the background processing system, you must specify:

  • The ABAP report or external program that should be started
  • The start time
  • The printing specifications

The background processing system starts your job and runs the program(s) that you specify. Afterwards, you can check whether your job was executed successfully and display a log of any system messages.


Suppose you need to run a report of customers whose bills are overdue.You can:

    • Start the report yourself from the ABAP Editor. If you do this, the system runs the report interactively, in a session at your PC or workstation. While the report is being processed, your computer response time may be slower.
    • Or, you can have the background processing system run the report. To do this, you must create a background job that tells the system what you want it to do.

The background processing system runs your "late bills" report according to your instructions. The list generated by the report is either printed directly or is waiting for you in the SAP output controller (see Using the Output Controller).You can also check in the background processing system whether the report ran correctly.

Features

  • Running a report in the background does not tie up the SAP sessions you are currently working with.

When you start a report interactively, your current SAP session is blocked for further input for as long as the report runs.

When you start the report in the background, running the report does not influence your interactive work with the SAP System.

  • You can shift the execution of reports to the evening or other periods of low load on the SAP System.

You can schedule a report or external program to run at any time that the SAP System is active. You can also set up reports to run automatically on a regular basis (for example, on the last day of each month).

  • Background processing is the only way you can execute long-running jobs.

To prevent tying up system resources with interactive sessions for long reports, the SAP System has a built-in time limit on interactive sessions. If a single ABAP report runs for more than 5 minutes continuously in an interactive session, the SAP System terminates the report automatically.

The background processing system executes long-running ABAP reports more efficiently. Often, such reports are automatically scheduled for execution in the background. In this case, you do not need to schedule them for background processing yourself.

Checking the Status of a Background Job

Procedure

  1. Check the status of your background jobs by choosing System
  2. ® Own jobs from anywhere in the system.

    At the top of the screen, the system displays the status of each of your jobs. The F1 field help explains each status.

    This graphic is explained in the accompanying text

    In the middle of the screen, the system displays the names of your jobs that are active (that is, currently running). Unless you are sure of what you are doing, you should leave the Cancel button alone. Cancel interrupts an active job; that is, it terminates the report that was running.

    This graphic is explained in the accompanying text

    At the bottom of the screen, the system displays the names of any of your jobs that have been cancelled (that is, ended unsuccessfully). To see the background processing log, choose Log. The log indicates what went wrong with the job.

    This graphic is explained in the accompanying text

  3. For more information on your jobs, you can access the management functions of the background processing system by choosing Job overview.

Scheduling Background Jobs

Use

In many SAP applications, long-running programs are automatically scheduled as background jobs. However, you can also schedule background jobs yourself.

Procedure

To schedule a program for background processing:

  1. Start the job scheduling function.
  2. To start the standard job scheduling function, choose Administration ® CCMS ® Jobs ® Define job.

    To schedule ABAP programs, you can also use the ABAP job scheduling function. From the ABAP Editor, choose Program ® Execute ® Background.

    If you are scheduling an external command or external program as a background job, you must use standard job scheduling.

  3. This graphic is explained in the accompanying textUse the Job Wizard to define your job. In the application toolbar, choose the wizard icon: This graphic is explained in the accompanying text


The Job Wizard is available only from the standard job scheduling function.

The initial screen of the SAP Job Wizard appears:

This graphic is explained in the accompanying text

  • Save the job. When you see the message Job saved, the job has been successfully scheduled.

  • A job that has been scheduled must also be released. This restriction applies even if you specify an immediate start for your job.

    If you have the necessary authorization, your job is released automatically when you schedule it. Otherwise, your system administrator will release your job.

  • Check the status of your job by choosing System
  • Scheduling Background Jobs

    Use

    You can define and schedule background jobs in two ways from the Job Overview:

    · Directly from Transaction SM36. This is best for users already familiar with background job scheduling.

    · The Job Scheduling Wizard. This is best for users unfamiliar with SAP background job scheduling. To use the Job Wizard, start from Transaction SM36, and either select Goto ® Wizard version or simply use the Job Wizard button.

    Procedure

    ...

    1. Call Transaction SM36 or choose CCMS ® Jobs ® Definition.

    2. Assign a job name. Decide on a name for the job you are defining and enter it in the Job Name field.

    3. Set the job’s priority, or “Job Class”:

    · High priority: Class A

    · Medium priority: Class B

    · Low priority: Class C

    4. In the Target server field, indicate whether to use system load balancing.

    · For the system to use system load balancing to automatically select the most efficient application server to use at the moment, leave this field empty.

    · To use a particular application server to run the job, enter a specific target server.

    5. If spool requests generated by this job are to be sent to someone as email, specify the email address. Choose the Spool list recipient button.

    6. Define when the job is to start by choosing Start Condition and completing the appropriate selections. If the job is to repeat, or be periodic, check the box at the bottom of this screen.

    7. Define the job’s steps by choosing Step, then specify the ABAP program, external command, or external program to be used for each step.

    8. Save the fully defined job to submit it to the background processing system.

    9. When you need to modify, reschedule, or otherwise manipulate a job after you've scheduled it the first time, you'll manage jobs from the Job Overview.

    Note: Release the job so that it can run. No job, even those scheduled for immediate processing, can run without first being released.

    Required Background Jobs

    Definition

    There are several background jobs that should run periodically in a production SAP System. These jobs perform housekeeping chores such as deleting outdated spool requests of background jobs.

    You should schedule each of these jobs for periodic execution according to the schedule shown in the following table.


    This list does not include housekeeping and reorganization programs that belong to SAP applications. See the customizing system for more information on these programs.

    By following the naming conventions shown in the table, you help ensure that SAP will be able to verify that these programs are properly scheduled in the event of any problems.

    Periodic Jobs Required for Housekeeping:


    Job Name

    ABAP Program

    Required
    Variant


    How Often?

    SAP_REORG_JOBS
    Deletes old background jobs.

    RSBTCDEL

    You must create a variant.

    Daily

    SAP_REORG_SPOOL
    Deletes old spool requests.

    RSPO0041

    You must create a variant.

    Daily

    SAP_REORG_BATCHINPUT
    Deletes old batch input sessions.

    This job may not run at the same time as normal batch input activity. Schedule this job for periods during which no batch input sessions are run.

    RSBDCREO

    You must create a variant.

    Daily

    SAP_REORG_ABAPDUMPS
    Deletes old dumps produced by ABAP abnormal terminations.

    Alternative: To keep from needing to schedule this job, run the ABAP report RSNAPJOB from the ABAP editor instead. This schedules RSSNAPDL as follows:

    Job name: RSSNAPDL
    Variant name: DEFAULT (you must create this variant)
    Start time: 0100 AM
    Repeat interval: Daily

    RSSNAPDL

    You must create a variant.

    Daily

    SAP_REORG_JOBSTATISTIC
    Deletes job statistics for jobs not run since the specified date (statistics no longer needed since job was a one-time occurrence or is no longer run)

    RSBPSTDE

    You must create a variant.

    Monthly

    SAP_REORG_UPDATERECORDS
    Deletes old completed update records (automatic delete deactivated); deletes incomplete update records (automatic delete deactivated)

    Caution

    Run this job ONLY if:

    · You have deactivated the default automatic deletion of update records once they have been processed. This function is controlled by the system profile parameter rdisp/vb_delete_after_execution

    · You have deactivated the default automatic deletion of incomplete update records (records that are partially created when an update header is created and saved but the generating transaction then ends abnormally). This function is controlled by system profile parameter rdisp/vbreorg

    · You have deactivated processing of V2 update components after the processing of the associated V1 updates. This function is controlled by system profile parameter rdisp/vb_v2_start.

    RSM13002

    None.

    Daily

    SAP_COLLECTOR_FOR_JOBSTATISTIC
    Generates runtime statistics for background jobs

    RSBPCOLL

    None.

    Daily

    SAP_COLLECTOR_FOR_PERFMONITOR
    Collects system performance statistics


    This job was previously called COLLECTOR_FOR_PERFORMANCE_MONITOR. When scheduling this job, be sure to use the new name.

    RSCOLL00 schedules all reports that need to run for the performance monitor using table TCOLL to determine what to run. See the CCMS Guide for more information on setting up RSCOLL00.

    RSCOLL00

    None.

    Hourly

    End of Content Area