A reload program is used to reload data from archive files back into the database and must process all the archived data of an archiving session. If not all the data is reloaded into the database, the remaining archived data is written to a new archiving session. Once an archiving session is reloaded, it can no longer be accessed from archive management.
The reload program reads the archive files using the ADK function modules (FM) and then reloads the data into the database. A reload program always only processes one archiving session at a time.
Function Module Call Sequence
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.
Steps 5-9 must be called in a loop for all archived data objects.
The parameter OBJECT_ID must syntactically be CHAR.
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.
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.
Decide whether to reload this data object into the database. If yes, only run steps 7 and 8. If no, only run step 9.
This function module must be called after every ARCHIVE_GET_NEXT_OBJECT.
After each ARCHIVE_GET_NEXT_OBJECT, increase a counter by one. When the reload program is running in production mode, call your subroutine whenever the counter is equal to the Commit Counter set in step 2. 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.
Do not use the write archive handle to call ARCHIVE_GIVE_STATISTICS.
If you do not call ARCHIVE_SAVE_OBJECT, you will no longer be able to access the data not reloaded through archive management.
If the Prohibit New Session During Reload indicator is set in AOBJ for the relevant archiving object, calling ARCHIVE_SAVE_OBJECT will have no effect.
End of loop
Only use the read archive handle for this function module.
In reload 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.
In reload 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 read program. This function module must be called directly before ARCHIVE_CLOSE_FILE.
This function module:
If the No New Session During Reload indicator is set in AOBJ for the relevant archiving object, the status of the archiving session is not set to Replaced. This means the archiving session is still accessible in archive management and could be reloaded again into the database. You must ensure that the archiving session cannot be reloaded again or could be read along with the database when searching for a document, for example, which could possibly result in two identical documents being found.
You only need to pass one of the two archive handles with the call. ADK automatically determines the second archive handle.
When you finish developing your reload program, enter it for your archiving object in transaction AOBJ.
Sample programs SBOOKL and SFLIGHTL (for archiving classes)