SAP Function ARCHIVE_OPEN_FOR_MOVE - Write and/or Reload Data Objects to a New Archive File

Parameter Reference Type Length Default Optional Text
ARCHIVE_NAME ADMI_FILES-ARCHIV_KEY C 20 SPACE X Archive File Name According to Archive Management
OBJECT ARCH_OBJ-OBJECT C 10 Archiving Object Name
TEST_MODE 0 SPACE X Reload Program Runs in Test Mode

Parameter Reference Type Length Text
ARCHIVE_READ_HANDLE SYST-TABIX I 4 Handle to the Open Files for Reading
ARCHIVE_WRITE_HANDLE SYST-TABIX I 4 Handle to the Files Open for Writing

Exception Text
ARCHIVING_STANDARD_VIOLATION Violation of the Archiving Standard
FILE_ALREADY_OPEN The System Tried Repeatedly to Open a File
FILE_IO_ERROR Archive File Access Error
INTERNAL_ERROR Internal Error
NOT_AUTHORIZED No Authorization for ARCHIVE_OPEN_FOR_MOVE
NO_FILES_AVAILABLE No Files Exist for Object
OBJECT_NOT_FOUND Object Unknown
OPEN_ERROR Could not open file

Functions
This function module is used to read archive files and to write dataobjects from these archive files to new archive files. This facilitatesthe selective reloading of individual data objects from archives to theSAP System.
Two handles are returned as the result of this function module.

  • You can use ARCHIVE_READ_HANDLE as if you had received this
  • handle via the function module ARCHIVE_OPEN_FOR_READ. You cantherefore carry out all read operations.
    • The handle which is returned via the parameter ARCHIVE_WRITE_HANDLE

    • is used to write data objects which are not to be written back tothe database, to the new archive. You can therefore only call thefunction module ARCHIVE_SAVE_OBJECT with this handle.
      • Example 1

      • DATA: READ_HANDLE LIKE SY-TABIX,
        SAVE_HANDLE LIKE SY-TABIX.
        ...
        CALL FUNCTION 'ARCHIVE_OPEN_FOR_MOVE'
        EXPORTING
        OBJECT = 'BELEG'
        IMPORTING
        ARCHIVE_READ_HANDLE = READ_HANDLE
        ARCHIVE_WRITE_HANDLE = SAVE_HANDLE
        EXCEPTIONS
        FILE_ALREADY_OPEN = 01
        FILE_IO_ERROR = 02
        INTERNAL_ERROR = 03
        NO_FILES_AVAILABLE = 04
        OBJECT_NOT_FOUND = 05
        OPEN_ERROR = 06.
        • Example 2

        • A detailed example can be found in program RSARCH07.

          Notes
          The procedure used with reload programs is simplified by this functionmodule.
          Each time the function module ARCHIVE_SAVE_OBJECT is called withthe handle ARCHIVE_WRITE_HANDLE, the data which was previouslyread with the function module ARCHIVE_GET_NEXT_OBJECT and thehandle ARCHIVE_READ_HANDLE is written to the new archive file.
          You can read the selected archive files in the normal way and decidewhether the data object is to be reloaded in the database. If you do notwant to reload the data object, simply call the function moduleARCHIVE_SAVE_OBJECT and all data for this data object will bewritten to a new archive file.
          INCLUDE 'ARCHIVE_HANDLE' OBJECT DOKU ID TX
          INCLUDE 'ARCHIVE_RELOAD_PROG_HANDLE' OBJECT DOKU ID TX
          INCLUDE 'ARCHIVE_HANDLE' OBJECT DOKU ID TX
          INCLUDE 'ARCHIVE_RELOAD_PROG_HANDLE' OBJECT DOKU ID TX

          Description
          This parameter was used exclusively within the Archive Development Kit(ADK) and is now obsolete. Using it triggers an error message.
          INCLUDE 'ARCHIVE_PARAM_OBJECT_OPEN' OBJECT DOKU ID TX

          Description
          This parameter controls whether the reload program actually reloads thearchived objects to the database.
          If the objects are releaded, archiving generates new archive files withthe objects not reloaded and converts the status of the read archivefiles.

          Value range
          SPACE = objects to be reloaded
          'X' = the reload program is simulated

          Default
          If you do not pass on this parameter, the archiving program assumesthat objects are to be reloaded.