You are on page 1of 7

Archiving Business Partners

Purpose
Using archiving you can store business partner data that is no longer required and subsequently
delete it physically from the database. In this way the volume of data is reduced and performance
improved.
The archiving object for business partners is CA_BUPA.

Prerequisites
You have activated archiving. For more information about the steps required, see Activating
the Archiving Functionality.
1. In the case of your own data, settings must also be made in the following transactions:
Transaction BUS7 for BDT event modules
User-defined checks (ARCH1)
1. Write routines for user-defined fields or tables (ARCH3)
1. Delete routines for user-defined fields or tables (ARCH4)

Process Flow
The archiving and deletion of business partner data is performed in the following asynchronous
steps:
1. Flagging Business Partners for Archiving
Business partners can be selected for archiving as follows:
1. Directly from business partner maintenance by setting the To Be Archived indicator
1. Using a BAPI, method BusinessPartner.Change
1. By setting the archiving flag with the transaction BUPA_PRE_DA (Set Deletion or
Archiving Flag)
Once a business partner has been flagged for archiving, you are advised not to make any
changes to this business partner.
To be archived, business partners must have an archiving flag for which at least the number of
days defined in Customizing have passed since the check date. The default period of 30 days is
meant to ensure that enough time is available for carrying out synchronization. This should
prevent an order being created on the CRM Mobile Client in parallel to an archiving procedure on
the CRM Server, which could occur if synchronization has not yet taken place. The period can be
customized with transaction DA_CONTROL (or transaction SARA -> Check/Delete ->
Customizing).

2. Executing Usage Checks and Locking Business Partners for Archiving


Only those business partners that are no longer used by any application and have no reference to
other objects can be archived and subsequently deleted from the database. The status of these
business partners is changed by the usage check to Archivable. The usage check is dependent
on the selected archiving object. User-defined checks can also be implemented (ARCH1).
When a business partner is in the process of being archived (and has the system status
Archivable), you cannot make any changes to this business partner. You can only display the
business partner.
3. Write: Writing Data to the Archive
The business partner data with the status Archivable is written to an archive file. There is no
status change in the business partner.

4. Delete: Comparing and Deleting Archived Data


The system compares the data in the local archive with the data in the local database. All
business partners contained in the specified archive file are selected. Note that a separate
comparison program is not available for CRM business partners.
The system then deletes these business partners including the associated dependent data from
the database.

These steps can be scheduled as background processes in the Archive


Development Kit (transaction SARA).

Additional Information
For more information about archiving, see Introduction to Data Archiving (CA-ARC).

Constraints
The following restrictions apply to archiving business partners:
The reference business partner may not be archived.
1. A business partner may not be archived if there are still active business transactions.
The business transactions concerned must first be archived, before the relevant business
partners can be archived.
1. A business partner may not be archived if it is still actively used in the organizational
data.
1. There may no longer be any relationships (product – business partner). These can
however be archived together with the relevant products.
1. There may be no partner/product ranges. They have their own archiving procedure.
1. There may not be an active installed base.
These checks are defined in the form of event modules of the Business Data Toolset
(BDT) (event ARCH1). You have the option of including other check modules at this
point without making modifications.

Activating the Archiving Functionality


Purpose
Archiving must first be activated. To do so, you need to carry out the following steps to
be able to archive business partner data:
1. Adapt the Name and Path of the Archive File (Mandatory)
Before you carry out archiving you must adapt the definition of the archive file to your
system landscape.
To adjust the definition of the archive file CA_BUPA, carry out the following steps:
1. ...
1. 1. In the archiving administration (transaction SARA), select the archiving object
CA_BUPA.
2. 2. Choose Customizing.
3. 3. In the screen Data Archiving Customizing, choose Basis Customizing →
Cross-Client File Names/Paths.
4. 4. Enter data as required.
For more information, see Defining Logical Path and File Names.

The archive files for the archiving object CA_BUPA are created with the logical file
name ARCHIVE_DATA_FILE in the logical path ARCHIVE_GLOBAL_PATH.

2. Adapt the Runtime Settings for the Archiving Object CA_BUPA


(Mandatory)
Before you carry out archiving, you must check the runtime settings for the archiving
object CA_BUPA and adapt them to your system requirements. Check in particular the
settings for Logical File Names, since it is specified here where the data will be
archived.
To check the technical data of the archiving object CA_BUPA, carry out the following
steps:
2. ...
5. 1. Start transaction AOBJ and select the archiving object CA_BUPA.
6. 2. Choose Customizing Settings.
7. 3. Check the system settings for Logical File Names.
8. 4. Check the system setting for Archive File Size.
9. 5. Check the settings for Settings for Delete Program.
10. 6. Check the system settings for Place File in Storage System.
11. 7. Include your own tables in the structure definition, if required.
12. 8. When you have adjusted the data, choose Save.

3. Create Program Variants for the Program


CRM_BUPA_DA_SELECTIONS (Optional)
You need to create a variant for the program CRM_BUPA_DA_SELECTIONS to be able
to start the check program in the background. You can adapt the variant as appropriate so
that you can restrict archiving to certain business partners.
To create a program variant, carry out the following steps:
3. ...
13. 1. In the archiving administration (transaction SARA), select the archiving object
CA_BUPA.
14. 2. Choose Customizing.
15. 3. In the screen Data Archiving Customizing, choose Archiving Object-
Specific Customizing → Check and Delete.
16. 4. In the screen Customizing for Cross- Archiving-Object Programs, choose
Create Variant.
17. 5. In the screen ABAP: Variants –Initial Screen, enter a variant name and
choose Create.
18. 6. In the screen Maintain Variant: Report CRM_BUPA_DA_SELECTIONS,
Variant <Variant Name>, enter data as required.
19. 7. To specify attributes for these variants, choose Attributes.
20. 8. To save the attributes, choose Save.
21. 9. To set a variant as active for archiving, in the screen Customizing for Cross-
Archiving-Object Check/Delete, choose this variant in the field Active Variant.
22. 10. Choose Save.

4. Activate Archiving Information Structure CA_BUPA_ALL


(Optional)
The archive information structure CA_BUPA_ALL is delivered inactive. The
information structure must be activated before the first archive read.
The information structure can (if active) be automatically updated during the archiving
deletion run and is required for displaying archived business partners through the archive
explorer of the SAP Archive Information System.
To activate the archiving information structure, carry out the following steps:
4. ...
23. 1. Choose archiving administration (transaction SARA).
24. 2. Choose Goto → Information System.
25. 3. Choose Customizing.
26. 4. In the field Archive Infostructure, enter CA_BUPA_ALL.
27. 5. Then choose Archive Infostructure → Activate.

Performing the Archiving


1. Execute the Usage Check
The system checks all business partners for which the Archiving Flag (To Be Archived)
indicator has been set. If the check shows that the business partner can be archived, the
system sets the status of the business partner to Archivable.
To schedule these checks to run in the background, perform the following steps:
5. ...
6. ...
28. Start transaction SARA.
29. Enter the archiving object CA_BUPA.
30. Choose Check/Delete.
31. Choose the variant you created for report CRM_BUPA_DA_SELECTIONS using the
input help.
You also have to enter a start date and define a spool parameter. Enter an output device in
the spool parameters.
32. Choose Execute.
33. You can view the status of the archiving by choosing Job Overview.

2. Write Object Data to the Archive


The write program writes the data of all objects that have the status Archivable to the
archive files defined for the appropriate archiving object.
In the archive administration of the ADK (transaction SARA), the system sets the status
of the archiving run to Incomplete.
7. ...
34. Start writing data to the archive using the archive administration (transaction SARA).
35. Enter the archiving object CA_BUPA.
36. Choose Write.
37. Choose a variant of the report BUSOBARCH using the input help.
If a variant has not been defined, create a variant of the report BUSOBARCH. Select the
business partners to be archived using the selection criteria and assign a short text for the
archive.
You also have to enter a start data and define a spool parameter. Enter an output device in
the spool parameters.
38. Choose Execute.
39. You can view the status of the archiving by choosing Job Overview.

3. Delete Objects in the Database


The delete program opens the archive files that the write program previously created and
reads them.

This step is only required if you have not set the flag in Customizing for
automatically starting the deletion report with the stated report variant.
8. ...
40. Start the deletion of data from the database using the archiving administration,
(transaction SARA).
41. Enter the archiving object CA_BUPA.
42. Choose Delete.
43. Enter the archive selection, start date, and the spool parameters.
You must enter an output device in the spool parameters. Normally there is the output
device LP01 in the system (virtual printer).
44. Choose Execute.
The system sets the status of the archiving run to Complete.
The business partners archived or removed from the system, as well as the business
partners that are still being used and that cannot be archived or deleted, are recorded in a
log.
You can call up all the logs for your archiving object directly in the archive
administration.

You can delete and archive complete business partner data records only. It is not
possible to archive and delete only part of the business partner data.

4. Data Exchange with Other Systems


Archiving occurs in the local system. An exchange with other systems is performed as
follows:
By replicating the archiving flag
1. By sending a delete BDoc for each archived business partner
In this way the business partners in question are also deleted on the CRM Mobile Client.
The archiving and deletion of the flagged business partners has to be triggered separately
in SAP ECC.

Monitoring
1. Usage Check
During the usage check, business partners that could not be archived are recorded in the
application log. To evaluate these logs, use transaction SLG1 and enter the object
BDT_DATAARCHIVING and subobject BUPA. You are advised to also specify the date
and time of the usage check.

2. Archive Job
Execute transaction SARA and choose Goto → Job Overview to see the status of the
jobs generated in SARA for writing or deleting the archive.

3. Archive File
Execute transaction SARA and choose Goto → Statistics to display the status of the
archive files.
4. Archive Information System
Use the archive information system to display the archive files for business partners. The
following prerequisites must be fulfilled to be able to display data in the archive
information system:
Check if the archiving information structure CA_BUPA_ALL has already been activated.
1. ...
1. Choose the archiving information system (transaction SARI).
2. Choose Customizing.
3. In the field Archive Infostructure, enter CA_BUPA_ALL.
4. Choose Activate.
5. Check the system message.
1. Check if index structures were set up for the archive files.
2. ...
6. Choose the archiving information system (transaction SARI).
7. Choose Status.
8. In the field Archiving Object, enter CA_BUPA.
9. Choose Status per Archive.
10. If the structure status is incomplete, select the relevant archive.
11. Choose Build Structures.
You can execute the creation of the index structure in dialog or in the background.

You might also like