Use
For data security reasons, the write program must not delete any data in the database. During the delete phase, a separate delete program deletes the data from the database. This ensures that no data can be lost during the write phase, and makes online archiving possible.
The delete program reads the archive files using the ADK function modules (FM) and then deletes the data from the database. A delete program always only processes one archive file at a time. Several delete programs can run in parallel, each processing one archive file.
Important Information

The Unicode-enabled ADK requires certain changes in existing delete programs, specifically for ARCHIVE_GET_NEXT_RECORD. Of course, these new guidelines must also be followed for new delete programs you develop.
Procedure
Function Module Call Sequence
This function module:
You use this function module to get the commit counter set in Customizing in transaction AOBJ.
As of SAP Web Application Server 6.10, you use this function module to get the structures of the initialization data you passed in the write program using ARCHIVE_PUT_INIT_DATA.
As of SAP Web Application Server 6.10, you use this function module to get the initialization data you passed in the write program using ARCHIVE_PUT_INIT_DATA.
The following steps (5 - 8) must be called in a loop for all data objects to be deleted.
You use this function module to read the next data object from the archive file opened for deleting.
This function module:

The parameter OBJECT_ID must syntactically be CHAR.
This function module must be called after every ARCHIVE_GET_NEXT_OBJECT and cannot be grouped according to < commit counter > data objects.
You use this function module to get the archiving object data from ADK’s data container and store the data in an internal table for each structure or table. Call this function module in a loop within the loop started in step 5 until no more records can be read from ADK’s data container.
If your write program stored information in the RECORD_FLAGS field, you can use this information in the delete program to determine which data should actually be deleted from the database.
In the Unicode context, there are two possibilities for calling this function module:

In the Unicode context, it is no longer possible to use the CHAR record buffer variable for generic reading of records for structures containing non-character-like fields.
After each ARCHIVE_GET_NEXT_OBJECT, increase a counter by one. When the delete program is running in production mode, call your subroutine whenever the counter is equal to the Commit Counter set in Customizing. In test mode, do not call this subroutine.
Your subroutine must:

You must call this function module. Otherwise the statistics function will not work correctly.
End of loop

In delete programs, ARCHIVE_GET_STATISTICS only works in production mode.
You use this function module to get the statistics ADK collected. You can then use these statistics to create your own specialized log. This function module can be used in addition to ARCHIVE_WRITE_STATISTICS or on its own.

In delete programs, ARCHIVE_WRITE_STATISTICS only works in production mode.
You use this function module to output the standard archiving statistics log with the relevant information for the delete program. This function module must be called directly before ARCHIVE_CLOSE_FILE.
This function module:
Result
When you finish developing your delete program, enter it for your archiving object in transaction AOBJ.
Example
Sample programs SBOOKD and SFLIGHTD (for use of archiving classes)