In the follow-up to his March article on archiving, the author further explains his recent successful archiving project. He shows how to group and prepare your data for archiving. He also discusses two data retrieval functions, Analyze and Archive Information System.
In my earlier SAPexperts article, I introduced the HR/Payroll data archiving project that my company helped implement for a customer with 100,000 employees. Of those, 55,000 were paid and managed using the SAP HR module. The March article described how to set up an archiving project. This month’s article focuses on the specific archiving and retrieval procedures for the archiving objects that were implemented in our project.
I will first explain the HR archiving process, then describe data retrieval from the archive using two functions: Analyze and Archive Information System.
Archiving Data from Human Resources
HR data is an all-encompassing term for payroll results, time evaluation results, and trip data. To protect that data for regulatory and legal reporting, strict rules and stipulations must be satisfied before it can be archived. SAP HR includes easy-to-use and reliable functionality to move “old” data from the online database to store it externally. The preparation procedures required to accomplish this are unique to the HR functionality, but lead to the same archiving procedures in use for data archiving in other modules such as Financials, Materials Management, and Sales and Distribution.
When archiving HR data, you need to specify the following in each archiving run:
- Archive date
- Retroactive accounting limit, which is the date that determines how far back in the past retroactive accounting can take place. Payroll adjustments based on historical changes can require retroactivity back several years. This limit prevents calculations going back too far.
- Country where the employees work and whose regulations must be used for legal reporting
- Which HR data archiving object is to be used
- Whether the HR data needs to reside online longer than legally required for functionality such as calculating averages
- The archiving date (that is, the date up to which you want to remove data from your database) and the retroactive accounting limit must be compatible for payroll results. Compatibility is required because of statutory regulations for retroactive accounting runs and to facilitate reporting requirements, time evaluation, or trip data processing.
Some data that is archived for HR is subject to strict requirements. Therefore, it has its own data archiving preparation transaction – PU22 (preparation and archiving). Preparation refers to the process for determining what is to be archived and configuring the archiving to be done. Archiving refers to the actual execution of the archiving jobs.
Transaction PU22 must be used to prepare the HR data for archiving. Then the archiving steps can be carried out using PU22 or SARA. PU22 provides a well- organized structure for keeping track of where all the archive groups are in the multi-step archive process. Transaction SARA can configure, set up, and monitor archiving jobs. You can use SARA’s functionality to complete the technical aspects of the archiving procedure or you can complete them using choices offered in transaction PU22.
Archiving Groups
Before archiving of time and payroll results can start, you have to create one or more archiving groups. Then you assign personnel numbers of the data that is to be archived to the archiving groups. From a business perspective it is not necessary to separate personnel numbers into different archiving groups. The decision as to how many groups are required can be made on the basis of data volume and the required archiving run time. There are no business requirements with regards to the archiving group and personnel number assignment.
The archiving objects included in the implementation I’m writing about are:
- PA_LDOC: long-term documents (infotype audit logs)
- PA_TIME: time evaluation results
- PA_CALC: payroll calculation results
- PA_PDOC: payroll posting documents
- FI_DOCUMNT: financial documents primarily for payroll postings
- CO_COSTCTR: cost center documents created from posting documents
Archiving groups are used to define a structure in which the required criteria (archive date, retroactive accounting limit, country, HR data archiving object, residence time extension) are stored for the HR archiving runs. These criteria provide additional protection for your HR data so that you do not accidentally archive data that might be needed for reporting or, in certain countries, averaging. Once the archiving group is created, you are ready to start archiving your HR data.
Preparing and Archiving Your Data
When preparing your data for archiving, the system performs the required business and data checks to ensure the integrity of your data in your database. For the actual archiving run, the system performs checks to make sure that the data in your database remains consistent once archiving is complete. The restrictions imposed during an archiving run (such as a lock on personnel numbers to prevent their inclusion in payroll runs) are checked. Other checks performed include ensuring that the data to be archived has the appropriate shelf life and that the postings have been made to finance for completed payroll periods. If any of the criteria are not met, then this employee will not be eligible to be archived in the current archiving run. After the preparation steps are complete, you can continue to work in the system as usual, even while the archiving run is executing.
You execute the archiving run using choices presented in transactions PU22 or SARA. The archiving run copies data out of the online database to archive files, verifies the data copied against the online database, and then deletes it from the database.
Retrieving Archived HR/Payroll Data
The rest of this article describes how archived data can be retrieved. The retrieval can be categorized in two ways: technical processes for retrieving archived data and user processes for retrieving archived data. Technical processes present the retrieved data in simple table or list formats, while user processes present the retrieved information in a format that the user is familiar with for viewing the data.
The technical processes for retrieving archived data are provided by R/3 and are common for most archive objects. You have the following two alternatives for retrieving simple lists of archived data:
- Analyze function on the main screen of the SARA transaction.
- Archive Information System (AS) on the main screen of the SARA transaction. (AS is one of the archive retrieval tools provided by R/3 as standard functionality. It provides the ability to search and display archived business documents stored within the archive files using specific search criteria.)
User processes for retrieving archived data are user transactions that have been archive-enabled. All archive objects do not have archive-enabled transactions.
Analyze Function
I will use archive object PA_LDOC (infotype audit logs) to show the Analyze functionality because it contains all the specific retrieval procedures. The other archive objects also have Analyze functions. The Analyze function is accessed from transaction SARA. Analyze functions take into account the different R/3 tables and data formats for each archive object and therefore require separate programs to retrieve and present the data lists. I’ll take you through the process you use to retrieve the archived data.
PA_LDOC is used to archive log data that results from changes in HR infotypes. The logged change documents can be for personnel numbers or applicant numbers. The change documents are stored in cluster table PCL4: by personnel numbers (LA) or by applicant numbers (LB). Follow these steps to retrieve a list of change documents:
- Execute transaction SARA. Choose or enter archive Object PA_LDOC. Click on the Analyze button. This takes you to the Archive Management: Execute Analysis Program screen.
- Choose Batch to run the job in the background when long retrieval times are expected. Select Dialog to run a job online when it will complete without timing out. Only experience allows you to predict this before running the job. The batch method creates a spool report and the dialog method produces an online display. I’m selecting Dialog for my example.
- Choose the read program. The read program is a predefined program that is archive-enabled and included in R/3 with the specific archive object functionality. The descriptions in the read program drop-down list allow you to choose the report that is closest to your needs. Double-click on the program of your choice and enter the required selection criteria (Figure 1). The selection criteria can differ for each archiving object.
- Select the run program icon (clock at the top left). The results of the search are then displayed online if you selected the Dialog option.

Figure 1
Selection screen for the Analyze program for PA_LDOC archive object
Selecting the archive session (Figure 2) reduces the time it takes to find the data. It reduces the number of archive files that must be parsed to retrieve the archived business object. This program looks through all files for this archive object to find the data you requested. Preselecting the files reduces the search time. If the User archive selection box is left blank, all archive files are searched sequentially.

Figure 2
Selection screen for choosing archive files to be searched
See Figure 3 for the results from the archive retrieval. The result is a list of archived business objects that meet your selection criteria. The user then either chooses to display one of them in the list or to conduct another search using different search criteria.

Figure 3
List of documents that meet the selection criteria
From the list of items in the archive, you can drill down to the detail information by double-clicking on a line in the report. Double-clicking on the first line of the list shown in Figure 3 brings up the detailed document shown in Figure 4.

Figure 4
Detailed document retrieved from archive
The Analyze program has also been included in a variety of user transactions. The transactions use standard security functionality that allows only authorized users to retrieve the specific data. For example, the Analyze program for PA_LDOC is used in transaction S_AHR_61015505. These jobs can be run in the background, but the resulting report in the spool system does not allow for drill-down. If the main objective is to get to a specific document, then drilling down is only available from a dialogue process.
Remaining Archiving Objects
Following are some other examples of user transactions that use the Analyze programs for the archiving objects we created for our project. This list is not all-inclusive. The archiving of data for any archive object can only be done by a single program. Each archive object has its own program. The programs are made available via several transactions in R/3, so it might seem as if you have alternatives, but the reality is all paths lead to the same program.
The following archive objects deal with different data in the system, but the process of retrieval is the same as for the PA_LDOC example for the Analyze function. I have shown some examples of user transactions that use the Analyze program for the specific archive object.
- Archive object PA_CALC: The Analyze program is also available in transactions PC_PAYRESULT and PC00_M44_CLSTR.
- Archive object FI_DOCUMNT: The Analyze program is also available in transactions S_ALR_87009826, S_ALR_87009827, S_ALR_87012288, and S_ALR_87012289.
- Archive object PA_TIME: The Analyze program is also
available in transactions PT66, PT_CLSTB2, S_AHR_61016312, and S_AHR_61016478.
- Archive object PA_PDOC: The Analyze program is also available in transaction PCP0 (display posting runs).
- Archive object CO_COSTCTR: The Analyze program is also available in transaction S_ALR_87013612 to access the cost center archives. Standard R/3 provides 10 reports under SARA-Analyze for displaying archived cost center data.
Archive Information System
AS allows you to keep certain key fields in R/3 as an index for retrieving from the archive. The archive information structure is an index containing all the information needed to identify individual archived data objects (Table 1).
000000100000 |
12.10.2003 |
000163-001PD_LDOC |
566.345 |
related object text |
000000100002 |
12.10.2003 |
000163-001PD_LDOC |
567.375 |
related object text |
000000100003 |
12.10.2003 |
000163-001PD_LDOC |
568.383 |
related object text |
|
|
Table 1 |
Example of an archive information structure |
|
Note
Archive information structures are created and activated using the Archive Retrieval Configuration, one of the two major components of AS. The other one is the Archive Explorer. AS has a number of process implications depending on the timing of creating and activating the information structure, which are beyond the scope of this article. A future article will provide more detail.
The first two fields provide the data object key, the second set of fields provides the pointers to the archive file, and the final field contains a mini-document extract for display reference. This function is available on the archive administration screen or through transaction SARI.
Each archive object can have one or more information structures to collect the key field data during the archive process. The key fields defined in the info structure become the selection screen fields. The list of records matching your selection criteria is displayed. You may then choose to drill down to the individual items, which are retrieved from the archive.
Terry Lewis
Terry Lewis is vice president of d.d. synergy. A 20-year IT veteran, Terry has spent the past five years helping SAP customers identify their SAP data and document business requirements. Terry specializes in mapping optimal archiving strategies, eliminating the business users’ fear that they will lose control of their data, and selecting the tools and resources required for a successful end-to-end SAP archiving solution.
You may contact the author at terry.lewis@ddsynergy.ca.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.