Fonction SAP ARCHIVE_READ_OBJECT - Read a Data Object from an Archive File

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
ARCHIVKEY ARCH_IDX-ARCHIVEKEY C 20 SPACE X Logical Name of the Archive File
MOVEFLAG ARCH_OBJ-INDXFLAG C 1 SPACE X Reloading Control Indicator
OBJECT ARCH_IDX-OBJECT C 10 Archiving Object Name
OBJECT_ID ARCH_IDX-OBJECT_ID C 50 SPACE X Data Object Key
OFFSET ARCH_IDX-OFFSET I 4 0 X Data Object Address
USER_EXIT_FORM ARCH_GENER-EXIT_FORM C 30 SPACE X User Exit, Form Routine Name
USER_EXIT_PROGRAM ARCH_GENER-EXIT_PROG C 40 SPACE X User Exit, program name

Paramètre Reférence Type Long. Description
ARCHIVE_HANDLE SYST-TABIX I 4 Pointer to Open File
COMPR_OBJECT_LENGTH I I 4 Data Object Length (Compressed)

Exception Description
ARCHIVELINK_ERROR ArchiveLink Error Occurred
CANCELLED_BY_USER User Has Cancelled the Action
FILENAME_CREATION_FAILURE File Name Could not Be Created
FILE_ALREADY_OPEN The System Tried Repeatedly to Open a File
FILE_IO_ERROR Archive File Access Error
FILE_NOT_FOUND The Archive File Does not Exist
INTERNAL_ERROR Internal Error
NOT_AUTHORIZED No Authorization
NO_RECORD_FOUND No Data Object Found
OBJECT_NOT_FOUND Unknown Object
OPEN_ERROR Archive File Open Error

Functionality
This function module reads a data object for an archiving object froman archive file and returns a handle for further processing. The dataobject can still be read by this function module if the archive filehas been saved via ArchiveLink. The function module handles thedifferent processing methods.
After the data object has been read by ARCHIVE_READ_OBJECT
you can access the handle to the data via the functionmodules ARCHIVE_GET_NEXT_RECORD, ARCHIVE_GET_NEXT_STRUCT_SPECIF.

  • Example 1

  • DATA:
    archiving_object TYPE objct_tr01 VALUE 'BC_SBOOK',
    archive_key TYPE arkey VALUE '001469-001BC_SBOOK',
    archive_offset TYPE admi_offst VALUE 285884,
    handle LIKE sy-tabix.
    ...
    CALL FUNCTION 'ARCHIVE_READ_OBJECT'
    EXPORTING
    object = archiving_object
    archivkey = archive_key
    offset = archive_offset
    IMPORTING
    archive_handle = handle
    EXCEPTIONS
    ...
    ...
    DO.
    CALL FUNCTION 'ARCHIVE_GET_NEXT_RECORD'
    ...
    • Example 2

    • You can find a detailed example in the program SBOOKS.

      Further notes:

      Before the function module is called again, you must call A
      RCHIVE_CLOSE_FILE for the redelivered handle,that is you do not reenter ARCHIVE_READ_OBJECT. Theassigned ADK index must be filled at runtime.

      Other sources of information: INCLUDE 'ARCHIVE_MORE_DOCUMENTATION'OBJECT DOCU ID TX
      INCLUDE 'ARCHIVE_PARAM_HANDLE_OPEN' OBJECT DOKU ID TX

      Description
      Length of a data object in bytes as it is stored in compressed form inthe archive file.

      Functionality
      If this flag is set, the system will call the function moduleARCHIVE_OPEN_FOR_MOVE to reload the data object. If the flag isleft empty, then the system will call the function moduleARCHIVE_OPEN_FOR_READ for reading an individual data object.

      Description
      The parameter OBJECT describes the archiving object. In thiscase you specify using the parameter for which archiving object youwant to read a particular data object from the archiving file.

      Value range
      It must be a valid archiving object.

      Description
      Using this parameter you specify an object for which you want to importthe corresponding data records.

      Description
      FORM form_name USING OBJECT_ID LIKE ARCH_IDX-OBJECT_ID
      CHANGING ARCHIVE_KEY LIKE ARCH_IDX-ARCHIVEKEY
      OBJECT_OFFSET LIKE ARCH_IDX-OFFSET.

      Default
      USER_EXIT_FORM = ' '

      Description
      Using a given program you can read the index using its own table. If noprogram is given the index is read from the index table ARCH_IDX

      Default
      USER_EXIT_PROGRAM = ' '

1295776P21:REQARCH:Dump X001: Error when FM <XYZ> is called