Entering content frameProcess documentation Developing Archiving Programs

Purpose

Archiving programs write the data to an archiving object in an archive file. These programs can be adjusted to individual requirements. The data objects to be archived can either be called directly in the archiving program or through a logical database.

All archiving programs have one thing in common. They use the ADK function modules (function group ARCH), to save their data by objects in archive files. All archive file access methods are covered by these function modules (see also Structure link Standard Archiving Programs) .

For the development of archiving programs it is also advantageous if archiving classes are defined. These contain the program logic for the data transfer between the database and the data container (see also Archiving Using Archiving Classes) . If no archiving classes exist, the archiving program must get the data from the database. The data is passed to the data container through the ADK standard class.

Guidelines

Note

For detailed information about ADK function modules, see Function Modules.

Process Flow

Function modules call sequence

  1. Open archiving – ARCHIVE_OPEN_FOR_WRITE
    This archiving object function module is called once only for each archiving session (per archiving object) and returns a unique handle which is required for all further archive operations. The function module performs the following tasks for the archiving object passed:
  1. Dynamically include archiving classes – ARCHIVE_REGISTER_CLASS
    If you want to use archiving classes, and they are to be included dynamically, you must call this function module and pass the handle for each archiving class. The function module writes the information to the archive file (for use by the succeeding programs).
  2. Caution

    Must be called directly after ARCHIVE_OPEN_FOR_WRITE.

    The following steps (3 - 5) must be called in a loop for all data objects to be archived.

  3. Get new data object – ARCHIVE_NEW_OBJECT
    You call this function module for each data object. Only then can you pass data to archiving object function modules. The function module performs the following tasks:

Note

If you have saved a data object in the archive file using function module ARCHIVE_SAVE_OBJECT and you want to archive additional data, you must call this function module again.

  1. Build the data object
    Call either the standard class function module ARCHIVE_PUT_RECORD or archiving class function modules. These are subject to a naming convention, in which "class" represents the archiving class name: class_ARCHIVE_OBJECT.
  2. You must decide whether the data passed should be deleted by the delete program or not. The archiving class function modules provide the parameter OBJECT_DELETE_FLAG for this purpose.
    The function module ARCHIVE_PUT_RECORD provides you with this function through the parameter RECORDS_FLAGS.
    The archiving class function modules select the data for you and optimize database access. First they collect the requests and only then access the database when the function module ARCHIVE_SAVE_OBJECT is called. These function modules recognize the data object to which the data belongs through the handle that must be passed to the function module interfaces.

    Note

    If you have already passed data you do not actually want to archive, call function module ARCHIVE_NEW_OBJECT. The system then discards the passed standard class and archiving class data.

  3. Store data object in archive file – ARCHIVE_SAVE_OBJECT
    You must call the function module ARCHIVE_SAVE_OBJECT to request the actual archiving of a data object. It performs the following tasks:

End of the loop (step 5.)

  1. End archiving I – ARCHIVE_WRITE_STATISTICS
    You use this function module to generate statistics about the archived data at the end of archiving. Data records passed by the standard classes (ARCHIVE_PUT_RECORD) are listed individually.
  2. End archiving II – ARCHIVE_CLOSE_FILE
    You end archiving by calling this function module. The handle passed becomes invalid and can no longer be used.

Caution

This call must not be forgotten, otherwise the last (physical) archive file to be processed is lost, and archiving is incomplete. The function module does the following:

 

 

 

 

Leaving content frame