Knowledge Base > Automation Engine and Target Systems > SAP > Archiving Data in SAP Systems

Archiving Data in SAP Systems

Data archiving in SAP systems removes mass data from the databaseA database is an organized collection of data including relevant data structures. that is no longer required in the system but should remain available for future analyses. The Automation Engine provides for centrally controlled data archiving.

Data to be archived is pooled in "archiving objects" (e.g. the archiving object SD_VBAK contains all data concerning sales records). Archiving runs are integrated using the Archive Development Kit (ADK). ADK provides the technical basis for the archiving transaction (SARA).

Usually, a separate program flags data to be archived based on configurable residence periods. Flags are often used in two steps: After the end of residence period 1 (e.g. 6 months), a deletion annotation is set and after the end of residence period 2, the deletion annotation becomes a deletion flag. Now the object can be archived.

The archiving process is basically divided into four steps:

  1. Pre-run (deletion annotation):
    Flags data that should be archived. A pre-run can also be performed regardless of the time frame specified for the archiving run.
  2. Creating archive files:
    During the archiving process, the data to be archived is sequentially written into newly created archive files.
  3. Starting the deletion program:
    Based on the generated archive files, the deletion program removes the archived data from the database.
  4. Storing the archived files:
    The newly created archive files can finally be stored in a filing system or manually stored on tape. The storing process can be initiated automatically or manually.

Transaction SARA provides for a manual or a semi-automatic (deletion, storage) archiving process. AE fully automates archiving runs in all SAP releases.

For archiving data outside transaction SARA please adhere to the following notes:

Controlling with AE

From the technical point of view and regardless of the object to be archived, archiving runs in SAP systems always consist of four steps:

  1. Writing program (WRI)
    The write program deals with pre-runs and the creation of archive files. It is capable of running in the background, parameters can be set using a variant.
  2. Deletion program (DEL)
    The writing program automatically creates a deletion (DEL) job for each archiving file, if this has been specified in the relevant archiving object's customizing. The DEL job contains the deletion program.
  3. Storing the archived files (STO)
    The deletion program creates a storing (STO) job. The STO job contains the storing program.
  4. Possible post processing (END)
    Post processing jobs are also automatically created. They are not available for all archiving objects.

Requirements in the SAP System

  1. Automatic deletion program
    Specify in the archiving object's customizing that the deletion program starts automatically.

  2. DEL, STO and END jobs must not start automatically in SAP.
    For controlling these jobs with AE, their automatic start in the SAP system must be prevented. The function "Job Interception" serves this purpose as of release 4.6C. Activate it with the ABAP program INITXBP2. The interception table must contain the job names of the DEL, STO and END jobs of all archiving runs.

Objects

The entire process is handled with a workflow which contains 3 steps:

  1. Starting and monitoring the writing program
    The AE function "Submit ABAP program" creates a WRI job in SAP and monitors it until it ends.
  2. Starting and monitoring deletion jobs
    The AE function "Select and start intercepted jobs" starts and monitors DEL jobs created by the WRI job.
  3. Starting and monitoring storing jobs
    The AE function "Select and start intercepted jobs" also starts and monitors storing jobs created by the DEL jobs.

Procedure

  1. Workflow activation
    Use the :READ mask to query the name of the archiving object.
  2. Workflow Monitor
    Select or specify the archiving object and the workflow automatically starts and is displayed in the monitor. It only ends when all processing steps ended successfully.
  3. Monitoring and control
    The entire procedure can be traced within Automation Engine and SAP. AE provides all logs  for automatic analyses. In SAP, the procedure can also be traced in the administration function of the relevant archiving object (transaction SARA).

Conclusion

SAP data archiving is easily implemented using AE's standard functions and offers various advantages: