Thursday, 24 May 2018

Archiving Setup

Introduction: This document details out the standard SAP Archival process and also the possible customizations which we can implement while archiving.Data Archiving is the process where in, huge volume of data is deleted from the system which has not been used for a long time. SAP recommends this process of data archiving to clean up the SAP standard tables, to improve the system performance and usability which yield to shorter response time.
Transaction’s Used in Data Archival :
The standard transaction’s used to archive the business objects are SARA, SARJ.
Data Archival Process Flow:
SAP Archival process mainly involves the below steps:
  1. Preprocessing Operation: This is an optional step , which makes the date/flag value set for the data which needs to be archived, but doesn’t delete the data . This is not found in all archiving objects.
  2. Write Operation : It is a mandatory step which mainly writes the archival file in the logical file path before deletion occurs, based on the criteria chosen.
  3. Delete Operation: It is a mandatory step which deletes the archival file which has been written out in the above step.
  4. Read Operation: It reads the archived data from the storage area after the deletion.
SAP Standard Archiving Objects:
SAP provides many archiving objects , few of the most commonly used are listed below.
              Archiving Object                       Description
CHANGEDOCUChange Documents
CRM_OPPTCRM Opportunity
CRM_MKTSETSegmentation Model
CRM_MKTTGTarget Groups
BC_SBALArchiving Object for Application Log
CA_BUPAArchiving Business Partners
This document explains in detail about the various configurations and possible customizations considering the Activity Archiving object – CRM_ACT­_ON.
The first section of this document briefs on the various configurations which must be maintained before the archival happens. And the later section details out on the various operations performed during the archival process.

Configuration Steps in Archiving the Object:
Step1: Goto SARA Transaction and identify the Archiving Business Object for Activity Transaction – CRM_ACT_ON.
Step2: We find many tabs in this transaction. We shall discuss below the most important tabs.
Step3: Customizing: Click on the tab – Customizing. You get many options when you choose the customizing settings.
Step4: Click the Technical Settings under the Cross- Archiving Object Customizing. You can change these as per the business requirements or retain the same.

Step5: Check and Delete will show for which archiving objects pre-check is active.

Step6: Under the Archiving Object Specific Customizing settings, we get the below screens.
Step7: Under Technical Settings, we mainly need to maintain the logical file name and the file size.
  • Maximum size in DB represents the file size. If this size exceeds , it generates another file.
  • The radio button under Delete Jobs-> Start Automatically will trigger the Delete Job soon after the Write Job.
Step8: Under Check and Delete we find the below screen.
Step9: Under Archive Routing we link the archiving object with the logical file name.
Step10: Click on rules and maintain the logical file name.
Step 11: Under conditions we can maintain the Selection Criteria which appears in the report program if needed or can be maintained as blank.
Step 12: Click on Basis Customizing, this navigates to FILE transaction. In the FILE transaction we maintain a Logical file name and maintain the same under the Archive Routing. The logical file name indicates where the archival file needs to be placed.
Step13: Choose the Logical file path and click on the Assignment of physical path to logical path to maintain the actual storage location of the Archived files in the system.
Step 14: Click on the Logical File Name Definition, to maintain the file name in which the archived files would be generated.
Step15: By default standard SAP provides the below naming convention for the files.
PARAM_1: This is a two-character application abbreviation for the classification of the archive files in the system. The value of the definition is determined from the relevant archiving object at runtime.
PARAM_2: Single-character alphanumerical code (0-9, A-Z). If, when creating a new archive file, an existing file with an identical physical name would result in a conflict, the ADK increases this value by 1. This value must, therefore, always be a part of the physical name.
PARAM_3: This parameter is filled at runtime with the name of the archiving object. In archive management, this enables you to check the file contents or to store the archive files by archiving objects.

Wednesday, 23 May 2018


Archiving can be done in different objects of PP/MM/FI/CO/PM etc.

The example is with a MM object, but it can be applicable equally to any PP object (PR_ORDER-Process order)

This document demonstrates the process of archiving in different objects. Though this is a archiving process, this is a general way of archiving. Archiving is required to have a faster and clean system. It is also possible to get the data once these are archived.

The archiving process have generally four steps.
There are 4 Main steps in SAP Archiving are:
  • Step 1 – Pre processing
                     Deletion indicators will be set in this step
                     Applicable for some objects
  • Step 2 – Write
                    Records chosen for Archiving will be written in Archiving file system in Unix server  (Path: /Volumes/Archiving/<Object name>/…)
                    Applicable for all objects
  • Step 3 – Delete
                   Written records will be deleted
                   Applicable for all objects
                   To ensure that the Archiving file system back up is taken for written records, at least 2 days gap to be maintained before performing Delete step.
  • Step 4 – Post processing
                   For deleting secondary indexes in FI_DOCUMNT and movement data in QM_CONTROL.

Useful Transaction codes:
  • SARA- Archive Administration
  • SARI-  Archive Information System
  • SARE- Explorer
  • ALO1- Search for documents with relationships (Incl. Archive)

The archiving process:

Object: MM_EKKO (Purchase order)

  1. Pre processing Step: Create Variant (KT2NDLINE):

Enter the New Variant name and click on ‘Maintain’ button. Maintain “Purchasing Documents” information and “Restrictions” as required.

Save Variant.
Execute the variant. Check the jobs.

Open the spool.

Pre-processing step successful for the selection.

        2. WRITE Step: Variant KT2NDLINE-WR
Create and save variant for the selection (should be same as maintained in Pre processing step).
Execute the variant. Check the Jobs.

Open the Spool.

Write step successfully completed.
           3. DELETE Step:
Click on “Archive Selection”. Select the files to be deleted.

Execute the selection.

Open the Spool

File is successfully deleted.

        4. Checking Information system – Info structure updation.

We can see a Green signal light for the last archiving session. This means that the Info structure is updated successfully.

If the signal is Yellow or Red, Please Click in  .It will fill the info structure once again.

After every archiving run this should be checked. Otherwise, reading data from archived files will not work for the users, which leads to raising a ticket.

           5. STATISTICS:

This option shows the details of archiving sessions. The details include,
  • Number of objects (header records) Written, Deleted
  • Number of Delete jobs
  • Write and Delete Job durations
  • Etc.
       6. LOGS:

If Job log is clicked for the Write step job, the following log is displayed.

We can see the Program name, variant used, User id, Archiving session number, How many number of documents processed,
Path of the system where the written file is stored .
Name of the Archive file created in the file system, etc., can be seen in the log.

      7.   READ:

We can see the archived Purchasing documents. For further documents, refer to User document for this object.
( SPEED_MM_Display_archived_Purchase_Order_v1.pdf)

        8.    MANAGEMENT:

It shows the status of archiving session. (Complete or Incomplete).
  Double clicking on the session will lead to the following screen where the archived file related details can be seen.