Get an overview of the SAP CRM data archiving process and learn an eight-step method you can use to archive data. Also, find out what you should consider for your SAP CRM data archiving project.
Key Concept
SAP provides the archive service technology Archive Development Kit (ADK) for implementation of secure and efficient archiving processes. This tool allows you to archive and retrieve CRM business objects. The archiving object specifies precisely which data is archived and how. The phased process for data archiving guarantees data protection if any problem occurs during the archiving process.
Many companies use an external storage system to archive SAP CRM business transactions that belong to completed business processes or master data that is no longer needed. This helps to improve system performance and response time. Furthermore, archiving this data allows companies to use their resources more efficiently, manage data growth, reduce hardware and administration costs, and support compliance with legal data retention policies and regulations.
Archiving data in SAP CRM is based on Archive Development Kit (ADK) technology, which uses ABAP archiving objects. The data archived is independent of the hardware and software’s release level, so you can retrieve it even after you upgrade to a new release. Also, if you use custom database tables in CRM, you can include them in the data archiving process and retrieve them later as needed.
I’ll provide an overview of the archiving and retrieval process in SAP CRM and then show you a proven approach to archiving CRM business transactions. This method is based on my knowledge gained from working in the archiving area in SAP CRM, as well as my interaction with clients. The concepts I present apply to both mySAP CRM 4.0 and SAP CRM 2005.
The SAP CRM Archiving Process
Figure 1 describes the technical process flow during archiving in SAP CRM. The phases involved are the archivability check, write program, delete program, archive files, and storage system.

Figure 1
SAP CRM archiving process
Archivability check: This process checks whether the data object that belongs to the CRM business process meets the archiving business rules specified for the CRM business process. For example, your company could have a rule that you should archive all closed business activities that are older than 180 days and that you should have no open follow-up (preceding or succeeding). You schedule this check in Archive Administration (transaction SARA).
The archivability check incorporates the pre-processing check plus a business check. The system performs the following archivability checks:
- Is the status complete? (Is the business object closed?)
- Is the residence time fulfilled? (Has the business object spent sufficient time in the CRM system and is no longer needed on a regular basis?)
- Does the business object comply with the application business checks? For example, the follow-up transaction for a sales order should be closed before you can archive the sales order.
If the business object meets the archivability criteria, the pre-processing check program assigns the Archivable status to the business object.
Write program: The write program selects all the business objects with the archivable status and writes them to the archive, creating an archive file. The program writes the data using an archive object, which all standard business objects have. You can either use transaction SE38 to execute the write program or you can schedule the process in transaction SARA. This process concludes when one of the following occurs:
- The system writes all the data to the archive file
- The archive file reaches the maximum size specified in the archiving object customizing although archiving is not complete. In this case, the system creates another archiving file.
- The archive file contains the maximum number of the data objects maintained in customizing although archiving is not complete. In this case, the system creates another archiving file.
Next, the read verification confirms that the write program data successfully wrote the data to the archive and sets the status to Archived.
Delete program: The delete program deletes the data written in the archive files from the database, allowing you to restart the process if necessary. You can run the delete program using transaction SE38 or schedule it in transaction SARA.
The phased process for data archiving guarantees data protection if any problem occurs during the archiving process. For example, if an error occurs during the archiving process, you can restart it because the data is still in the CRM database or the archive files.
External storage system: After the write program creates the archive files, you can move them to a storage system or copy them to storage media. You can schedule this process to run automatically or perform the task manually.
Read archive files: You can use two ways to read from the archive files: read programs or Archive Information System (AS) in transaction SARI. Read programs allow index-based, single-document access to the files, which you can implement using function module AS_API_READ. AS allows users direct access to the archived data using archive information structures (infostructures). The function module itself does not carry out any archiving accesses; it merely determines where in the archive a specific data object resides. ADK carries out the actual access to the archive.
Archive a CRM Business Transaction
Before you begin the archiving process, make sure that your user ID has the authorization for archiving CRM business transactions, S_ARCHIVE.
Step 1. Define the archiving object in the transaction AOBJ. Figure 2 shows all the CRM archiving objects. The archiving object specifies which data to archive and how. It describes which database objects the system must handle together as a single business object. For my example, I selected the archiving object CRM_SALDOC for a sales transaction.

Figure 2
SAP CRM archiving objects
Double-click on the archiving object or press Crtl-Shift-F2 to see the details for the archiving object CRM_SALDOC (Figure 3). In this screen, you can set up and view the application area to which this archiving object belongs. You can also see which programs the system should use for CRM_SALDOC during the archivability check, write, and delete phases.

Figure 3
Archiving object for sales transactions
Click on Structure Definition on the left side of the screen to view the structure definition of the archiving object CRM_SALDOC (Figure 4). This screen contains the different tables in which the CRM sales transaction data resides. Upon execution, the system archives the data from these tables for this archiving object.

Figure 4
Structure of the archiving object CRM_SALDOC
Note
If you have developed custom database tables in SAP CRM and want to include them in the data archiving process, you should create a custom archiving object using transaction AOBJ.
Step 2. Create the function module and the reports for the archivability check, write, delete, and archive phases. In the standard CRM archiving process, both the pre-processing check and the business check are part of the archiving process.Consider a situation in which you copy a sales order from a quotation. This sets the status of the quotation to Completed, but the business may want to keep this quotation in the CRM database until the sales order is closed. In my example, the function module CRM_BUS2000115_MAIN_CHECK_AC performs the business checks for the sales transaction.
Use transaction SE80 and select the package CRM_ARCHIVE to see the screen in Figure 5. Here you can view all the standard function modules, reports, and function groups related to archiving. For example, the function module CRM_BUS2000115_CHECK_AC is used for the archivability check of a CRM sales transaction. The function module on this screen lets you know if the sales transaction can be archived.

Figure 5
Function modules for the sales transaction
Next, use transaction SE38 to find the reports (programs) for checking the business objects’ archivability, writing the business transaction in the archive files, reading from the archive files, and deleting the business objects from the CRM database. You can use the report if you want to execute archiving for a business object manually without going to ADK. To execute the report, use transaction SE38, select the name of the report, and press F8.
The reports follow the following naming convention: CRM_ARC__. The refers to the name of the archiving object with CRM_ removed. The can be check, save, read, or delete, depending on the report’s function. Figure 6 displays the reports for the sales transaction.

Figure 6
Archiving reports for the sales transaction
Step 3. Maintain the sub-objects for the application log in transaction SLG0. The application log records application-specific events. You need to record these events for archiving to show the progress of each step in the archiving process. You can see the sub-object CRM_SALDOC that I selected for the CRM data archiving object CRM_ DATAARCHIVING in Figure 7.

Figure 7
CRM_SALDOC selected for the SAP CRM data archiving object
You create the application log with the function modules provided by the function group SLG0. Use transaction SE80 to see these function modules that you need to build the application log (Figure 8). For example, you use APPL_LOG_INIT for initializing, which checks if the specified object or sub-object exists and deletes all associated data.

Figure 8
Function modules needed to create the archiving application log
Step 4. Enter the application specific configuration for the archiving objects using this transaction DACONTROL. Archiving parameter settings control the archiving object check and delete programs. Figure 9 shows the configuration for the CRM sales transaction. In this screen, you set and control the check for the archiving object.

Figure 9
Archiving control parameters for the SAP CRM sales transaction
SALDOC_CHECK is an active variant in this case. The variant determines the parameters the system uses with the archiving program when you execute the archiving check and delete programs. When you use the transaction SARA for archiving, you can select an existing variant or create a new one.
Step 5. Update the control table AIND_STR5. Access AIND_STR5 in transaction SE16, which you use to view the business objects. Press F5 to enter the archiving object, the read function module, and the type of views.
Step 6. Assign the residence time in transaction CRMORDERARC. Residence time is the minimum duration that data must spend in the database before it meets the archivability criteria. In Figure 10, I specified that all sales orders (transaction type TA) must spend a minimum of 180 days in the CRM database before I can archive them.

Figure 10
Residence time for different business transactions
Step 7. Redefine the Business Object Repository (BOR) object definition. The BOR is the cross-client repository for all the business objects. It contains their definitions and implementations. Whenever you define an archiving object, you should maintain the entry in the BOR.
Go to transaction SWO1 to edit the object definition of the BOR object for the sales transaction BUS2000115. To ensure that you can perform the pre-processing check in ADK, select the method DARGEVerify. In the pop-up screen that appears, click on the ABAP tab (Figure 11). Select Function module and enter the name of the pre-processing check function module, in this case CRM_BUS2000115_CHECK_AC. Click on the generate icon to generate the object. Repeat the process for the DARGEPreselect method.

Figure 11
BOR for the SAP CRM sales transaction
Step 8. Select the information for reading the business transaction from the archive. In this step, you maintain the infostructure and field catalog and activate the infostructure. This is required to associate the archiving object with an archive infostructure, which displays the archived data.
Use transaction SARI for customizing and go to Environment>Field catalog to select the field catalog. For the sales transaction, the field catalog is SAP_CRM_SALDOC. Then go to Environment>Create structure. Enter the field selection for the field catalog using the target field, source table, and reference field. Click on the activate icon to activate the infostructure.
Finally, use transaction SARA to complete the archiving process (Figure 12). Click on each of the buttons to perform each phase of the process, completing the archive.

Figure 12
ADK screen (transaction SARA)
Data Archiving Considerations
Any company planning for the implementation of an enterprise solution should consider data archiving as an important aspect from the beginning of the implementation. If your database growth rate is around six to eight gigabytes per month, then you should consider data archiving.
Ensure that you copy data from completed, infrequently used business operations to archive files. Then delete those that are in the database and have been archived from the database. To take full advantage of data archiving, you should schedule this process on a regular basis. Comprehensive archivability checks at the application level guarantee that the data archived is consistent and complete and that you archive only data from completed business processes.
When implementing the data archiving solution, you must first identify the data objects for archiving. Then you should analyze, set up, test, archive, and reorganize the archiving objects as needed.
You may find instances in which your system study shows that your business processes predominantly contain one data object, such as Financial Accounting and Controlling, and the initial archiving of receipts reduces their database size significantly. Similarly, you may have custom queries and programs that are no longer needed.
Kunal Verma
Kunal Verma, PMP, is global business applications manager with a medical device and solutions company. He is responsible for CRM, customer service, and e-commerce applications. He has more than 11 years of consulting and leadership experience in the CRM and ERP spaces, with companies including IBM, SAP, and Infosys. Kunal has been involved in several consulting, roadmap definition, business process transformation, pre-sales, project management, and implementation projects, mainly on SAP products. He has worked extensively on SAP implementations for the healthcare, hi-tech, CPG, and automotive industries.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.