Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
Manoj_007
Advisor
Advisor
621

Introduction to Archiving:

The concept of Archiving comes into picture when the customer needs to delete the Business Partner data which is no longer relevant for the Business Scenario and hence would like to eliminate Business Partner data from the Database. There are basically 2 steps to be performed in order to eliminate the Business Partner data from the Database:

Archiving: Archiving of Business Partners is a process where the complete Business Partner data is been written into a file and later the data is removed from the Database. Archiving is officially released from ABA 5.0 systems. For system 4.6C BDT archiving is officially released and not BP Archiving.

In Broad there are basically 2 steps during archiving:

  • Write Job – Where the entire data of the Business Partner is being written into the flat file.
  • Delete Job – Where the data is removed physically from the Database for the Archiving file created in the previous process

Important reports for BP-archiving

2640553 - How to archive BP (without customer/vendor role) by SARA

2491026 - Guided Answer - How to delete BP (with vendor/customer role) completely in S/4HANA

3110023 - How to archive a person BP after the synchronization employee to BP in S/4 HANA

1. TA: BUPA_PRE_DA, Report: BUPA_PREPARE_DA

  • Preparation of BP for archiving/deletion.
  • ARCH1 or DELE1 FM’s are called to determine system state.
  • Result: BP with system state archivable or delete able.

This transaction is used to prepare the Business Partner for Archiving/Deletion. It sets the XDELE flag to ‘X’ in table BUT000. The settings for the report should be as below:-

Manoj_007_0-1725779358689.png

To archive the same you need to check the ‘Set Flag’ and execute the report which shall flag the Business Partner for archiving as below:

Manoj_007_1-1725779416619.png

Thus, after the above success message is seen then the Business Partner would be ready for archiving by setting the archiving flag XDELE to ‘X’.

The above transaction BUPA_PRE_DA executes the report BUPA_PREPARE_DA which carries out the above functionality of marking the BP for Archiving. This report can be used for a range of Business Partner which can be marked for archiving.

Note: In order to archive the Business Partners in CRM systems you need to execute the report CRM_BUPA_ARCHIVING_FLAGS which shall set the required status for the BP. The setting needs to be as below:

Once this is executed the required status would be set in the CRM_JEST table and for the XDELE flag.

2. TA SARA (schedule job), Report: BUSOBARCH

This is a batch process which is used to archive and delete the Business Partner. This is used to archive and delete a large number of Business Partners and is preferable to be scheduled when not many processes are running. The way to schedule the same is as shown below:

Manoj_007_2-1725779711096.png

This is the initial screen of the transaction SARA. Enter the Object Name CA_BUPA -> Enter in order to archive the Business Partner. Initially you perform the ‘Write’ job which writes the data of the Business Partner into the archive file. When this Write job is executed the report BUSOBARCH is executed.

Steps:

Click on the write button which shall enable us to create a variant as shown below:

Manoj_007_3-1725779763094.png

Click on the Maintain tab in order to maintain the variant. The below pop-up appears select the option ‘For all Selection Screens’ and select the button continue.

Manoj_007_4-1725779786687.png

After pressing the continue button the screen for specifying the Business Partners which you would like to archive is displayed. You can execute the same in the test run or in the detail log (which archives the BP).

Save the above variant with the description for the field ‘Short Text for Archive’. Once the variant is saved you shall be taken to the initial screen where the variant is maintained.

Manoj_007_5-1725779851027.png

Here select the tab ‘Start Date’ where the timing is specified for the Batch job.

Manoj_007_6-1725779867030.png

Here you could specify the details and save the same, for testing you could select the option Immediate and ‘Save’ the settings.

Once this is done in the variant maintenance screen, select the option/tab ‘Spool Params’.

A pop-up as shown below is displayed.

Manoj_007_7-1725779906994.png

In the pop-up for the field ‘Output Device’ enter the value ‘locl/lp01’ and press Enter.

Manoj_007_8-1725780108485.png

Now select the same which shall navigate back to the variant maintenance screen. Later execute the same which shall display a message below ‘New Archiving Job was scheduled’.

Manoj_007_9-1725780125910.png

Once executed the write Job would be performed and you can view the same by navigating to the Management section as below:

Click on the Management Icon which shall display the status of the Jobs.

This screen ‘Overview of Archiving Sessions’ would have 4 main categories.

  • Archiving Sessions with Errors: If there are errors during archiving then the Archiving Job would be under this section.
  • Incomplete Archiving Sessions: After the write job is done the archive file would be under this section. As above we could see the Archive file with variant ZTEST is under this section.

· Complete Archiving Sessions: This section would contain the archiving jobs which are completely done (i.e. after both the write and the delete job is been executed).

  • Replaced Archiving Sessions: This section contains the completely replaced archive sessions.

Thus after the ‘Write’ job is performed through Transaction SARA the archive file would be under the section ‘Incomplete Archiving Sessions’.

Note: TA SARA cannot be used for debugging as it is a batch job. In order to the write job you could execute the report BUSOBARCH and set the variable tnobatch = ‘X’ during debugging. Once this variable is set you can debug the same.

TA: SARA, Report BUSOBARCH_DELETE

Now since the Business Partner details have been written to the Database we proceed to the deletion of the same by executing the ‘Delete’ functionality in TA SARA. The process is carried out as below:

Manoj_007_10-1725780188734.png

From the initial screen (tr SARA) you select the tab ‘Delete’ Icon which shall enable the delete functionality of archiving through transaction SARA. When this Delete functionality is executed the report BUSOBARCH_DELETE is executed. When this is executed, below are the activities performed in broad sense:

- Delete data from database, after data is archived (ARCH4 Function modules).

- Delete data archived by archiving classes via Function module: ARCHIVE_DELETE_OBJECT_DATA. (Defined by archiving handle).

Manoj_007_11-1725780214583.png

In the above screen select the Icon Archive Selection which enables us to select the Archive file previously created through the Write Job. As shown above the Archive file with number 000092 (ZTEST) created during the write job is displayed. Select the same and click on the select mark. Once this is done the previous screen is displayed where Start Date and the Spool Parameters needs to be specified as previously done during the write job.

Manoj_007_12-1725780243336.png

After the above settings are made, execute the same to complete the deletion of the Business Partner. Once executed you can find the entry in under the Management section ‘Complete Archiving Sessions’ as shown below:

Once the archive session/file is under the ‘Complete Archiving Sessions’, it implies that the Archiving/Deletion of the Business Partner has been completed successfully.

Important Tables:

TBZ1F

- Contains BDT customizing, FNAME ZTPKT

- Customizing via TA BUS7.

TBZ1

- Allocation of Field catalogue to archiving object

- Primary key is application object (-> BUPA for business partner).

CRM_JEST (CRM)

- Status of BPs (archivable / deletable)

- No status set for BP, no entry in this table.

- Status no.:

o I1100 archivable (CRM)

o I1101 archived (CRM)

o I1102:deleteable (CRM)

o I0810: archivable

o I0811: archived

o I0812: deletable

Important Notes on Archiving:

In order to find notes on Archiving use the key word BP_ARCHIVING.

  1. Notes on Performance: The below notes improves the performance of archiving and deletion to a very large extent. The note 740677 (BP_ARC: Archiving in CRM systems with partner guid) should be applied in the customer system it improves the performance to a great extent. Other performance related notes are as below:
  • 645420: Archiving: Performance (change documents)
  • 644786: Archiving: Poor performance during deletion
  • 658530: BP archiving: Performance improvement for archiving
  • 692310: Business partner archiving: Bad performance in del
  1. 898419: Note on BADI Implementation: BANKS_USAGE_LIST
  2. 825102: Memory leak in BP archiving deletion
  3. 780668: Memory consumption of the archiving job
  4. 965875: Poor performance of BUPA_PREPARE_DA
  5. 905666: BUPA_DEL not working for more than 750 nondeletable
  6. 903882: Internal Table gt_chart empty in BUSOBARCH
  7. 953542: BP_Archiving: SQL Dump in FM BUP_PARTNER_ARCHFLAG_GET
  8. 875376: Performance/Memory problems with report BUSOBARCH

Important Facts:

  • For CRM systems the Business Partner reference is the Partner Guid and not the Business Partner Number. After the ARCH3 events it is the Partner Guid which is passed to the CRM systems and not the Partner number.

· Transaction AS_AFB can be used to see the contents of the archived file created after deleting the partner. All the tables and the data are shown in one view.