Entering content frame

Procedure documentation Developing Read Programs Locate the document in its SAP Library structure

Prerequisites

Use

Read programs are used to read both archiving object and archiving class data from archive files.

Procedure

Function Module Call Sequence

  1. Open selected archive files for reading – ARCHIVE_OPEN_FOR_READ

This function module:

  1. (Optional): Get structures for initialization data – ARCHIVE_GET_INIT_STRUCTURES

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.

  1. (Optional) Get initialization data – ARCHIVE_GET_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 (4 - 7) must be called in a loop for all data objects to be read.

  1. Read next data object from archive files – ARCHIVE_GET_NEXT_OBJECT

You use this function module to read the next data object from the archive files opened.

This function module:

Note

The parameter OBJECT_ID must syntactically be CHAR.

  1. Get archiving object data – ARCHIVE_GET_NEXT_RECORD (or ARCHIVE_GET_TABLE where it makes sense)

Call this function module in a loop within the loop started in step 4 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:

Caution

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.

  1. Read archiving class data – <CLASS>_ARCHIVE_GET_TABLE or archiving class-specific read function module(s)

For each archiving class, there may be one or two (or possibly more) read function modules. After reading the function module documentation, determine which one you want to use:

To determine the name of the class-specific read function module,

      1. Find the function group for the archiving class using Displaying Archiving Classes Used in an Archiving Object
      2. Go to transaction SE80 (Object Navigator)
      3. Choose Repository Browser
      4. From the pull-down menu, select Function Group and choose Display
      5. Under Function Modules, look for the read function module; for help, use the relevant function module documentation.

End of loop

  1. (Optional) Pass statistics to ADK – ARCHIVE_GIVE_STATISTICS

You use this function module to pass statistics to ADK after the data is read from the archive files.

  1. (Optional) Get statistics from ADK – ARCHIVE_GET_STATISTICS

You use this function module to get the statistics ADK collected. You can then use these statistics to create your own specialized log.

  1. (Optional) Output standard statistics log – ARCHIVE_WRITE_STATISTICS

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.

  1. End read – ARCHIVE_CLOSE_FILE

This function module:

Result

When you finish developing your read program, enter it for your archiving object in transaction AOBJ.

Example

Sample programs SBOOKR, SBOOKR_2, SBOOK_3, and SFLIGHTR (for use of archiving classes)

Leaving content frame