Anda di halaman 1dari 7

Step-by-step procedure for Creation of Custom Archiving Object

By Sriranjani Chimakurthy, Infosys Technologies

Introduction:

This document provides the step by step procedure to create a simple custom archiving object. Data
archiving is very crucial with the growing business along with the growth of any organization. The
increase in the volume of the data has always led to various performance issues. Some data stored in
the database can be some transactional data which might not be relevant after the completion of the
business life cycle. But at times it is good to have the data stored in the database for forecasting, auditing
purposes. Since storage of the data in the database leads to performance issues, the data can be
archived. In this document let us create the archiving object for table ZTESTARCH.

Steps :

Step 1: Go to transaction AOBJ-> Click on New Entries

Step 2: Provide the new object name as mentioned below :


Here ZCUSARCH is the name of the custom archiving object.

ZCUSARCH_WRITE and ZCUSARCH_DELETE are WRITE and DELETE programs of custom archiving
object respectively. The code for the same is provided in the further steps.

Step 3: Click on the structure definition:

ZTESTARCH is the name of the table the entries of which we are going to archive.

If there are multiple tables which are linked then here we can specify the hierarchy by specifying the
parent segment and segment.
Step 4: Click on the Tables from which you only delete.

Here in this section specify the list of tables for which the entries are to be deleted directly from the
database when archiving is run. Tough specifying the table name here will not delete the entries directly
from database. It has to be explicitly coded in the program to achieve this. But it is an indicator which
states that for the tables mentioned in this section archiving is not required.

Step 5: Click on the customizing settings :-> Click on new entries:


Here ZCUSARCH is the name of the archiving object. ARCHIVE_DATA_FILE is the logical file path provided
by SAP. The physical file path can be changed as per the requirement in the project in FILE transaction.

Maximum size of the archive file in MB needs to be specified. The value can be derived after a trial and error
method of looking at how many data objects are archived approximately per each archive run.

Maximum number of data objects can be specified if required. Here in our scenario each document number in
table ZTESTARCH refers to each data object. If the maximum number of data objects is specified as 10 then
the program writes the data of the data objects into a new archive file once the first file is filled with the first 10
data objects.

Commit counter represents after how many data objects should the data be deleted from the database.

Test variant defines the variant of the delete program when run in test mode and when run in production mode.
Create the variants respectively by clicking on the variant button next to the variants.

Deletion jobs can be scheduled manually or a setting (Start Automatic) can be done to trigger immediately after
the write program is finished.

Content repository: Check with the basis team on the content server that needs to be used for archiving.
Sequence section defines whether the deletion job should run before storing the file into content server or after
storing the file into content server. We can choose the option of reading the data from the content server if we
want that only the data that has been written to the file is to be deleted from the database.

Step 6: Create the Archive write program in SE38 (click here for the program code).

The below screen shot displays the selection screen:

The below flow chart depicts the sample flow in the archive write program:
Step 7: Create archive delete program in SE38 (Click here for the code).
Selection screen:

Flowchart:

Summary :

With the above steps the creation of custom archiving object is completed.