Fonction SAP ARCHIVE_OPEN_FOR_WRITE - Open Archive File for Writing

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
CALL_DELETE_JOB_IN_TEST_MODE 0 'X' X Run Delete Program in Test Mode Only
COMMENTS 0 SPACE X Comment Line For Archiving Session
CREATE_ARCHIVE_FILE 0 'X' X Create or Do not Create Archive File
DESTROY ADMI_DESTR C 1 ABAP_FALSE X Indicator for Archiving Session for Data Destruction
DO_NOT_DELETE_DATA 0 SPACE X Do not Delete Archived Data
OBJECT ARCH_OBJ-OBJECT C 10 Archiving Object Name
OUTPUT_SEL_SCREEN_WHEN_BATCH C C 0 SPACE X If in Background, Output Selection Screen
OUTPUT_SEL_SCREEN_WHEN_DIALOG C C 0 SPACE X If in Dialog Mode, Output Selection Screen

Paramètre Reférence Type Long. Description
ARCHIVE_HANDLE SYST-TABIX I 4 Pointer to Open File

Exception Description
ARCHIVING_STANDARD_VIOLATION Violation of the Archiving Standard
INTERNAL_ERROR Internal Error
NOT_AUTHORIZED No Authorization for ARCHIVE_OPEN_FOR_WRITE
OBJECT_NOT_FOUND Unknown Object
OPEN_ERROR Could not open file

Functions
The function module ARCHIVE_OPEN_FOR_WRITE is the first functionmodule you need to call in a write programm if you want to create a newarchive file. The parameter ARCHIVE_HANDLE gives you the handlewhich you need to pass in write operations.

  • Example 1

  • Extract from the write program for FI documents.
    PARAMETERS: TESTRUN DEFAULT 'X' AS CHECKBOX.
    DATA: HANDLE LIKE SY-TABIX.
    ...
    CALL FUNCTION 'ARCHIVE_OPEN_FOR_WRITE'
    EXPORTING
    CALL_DELETE_JOB_IN_TEST_MODE = TESTRUN
    OBJECT = 'FI_DOCUMNT'
    IMPORTING
    ARCHIVE_HANDLE = HANDLE
    EXCEPTIONS
    ...
    • Example 2

    • You can find a detailed example in the program RSARCH04 or SBOOKA.

      Additional hints:

      Automatic call of the delete program
      Using transaction AOBJ "Customizing Settings", you canspecify whether the delete program should be called automatically forthe archived data.

      Assignment of file names for archive files
      The archiving function modules use theplatform-independent file names to create new archivefiles. Using transaction AOBJ "Customizing Settings",you can specify which platform-independent file name is to be used foryour archiving object.
      If you have not specified a file name, the platform-independent filename ARCHIVE_DATA_FILE is used automatically to generate theplatform-dependent file name.
      The platform-independent file name is converted into theplatform-dependent file name using the function moduleFILE_GET_NAME. It has the two parameters "" and"". The application code (for example, FI for FinancialAccounting) is passed to "" and a value between 'a' and'z' or between '0' and '9' to "". The application codein entered in transaction AOBJ "Detail".

      Writing data records to the archive file
      Complete data objects are always written to an archive file using thefunction module ARCHIVE_SAVE_OBJECT.
      Using the transaction AOBJ "Customizing Settings", youcan specify how large an archive file can be.
      There are two ways in which data can be passed to the data object:

      • individual data records via the function module ARCHIVE_PUT_RECORD


        • complex data via the archiving classes.

        • INCLUDE 'ARCHIVE_PARAM_HANDLE_WRITE' OBJECT DOKU ID TX
          The parameter CALL_DELETE_JOB_IN_TEST_MODE controls whether theautomatically called delete program should run in test mode. The systempasses this value to the parameter TESTRUN.
          when the delete program is called.

          Possible entries:

          • 'X' = Let program run in test mode (recommended value).

          • ' ' = Let delete program run in normal mode.
          • Description
            Comment line on the archiving session. This comment is stored in themanagement record of the archiving session.

            mRANGE&
            A six-character long string.
            Using this parameter you can control whether you want to create anarchive file.
            If you do not create an archive file statistics are generated thatmatch precisely the statistics generated if a file had been created. Noentry is made in the archive management and the delete program is notcalled.
            The statistics are analyzed and output with the function moduleARCHIVE_WRITE_STATISTICS.
            You can use this parameter to enable the user of the archiving programto make a test run to determine what has been archived.

            Description
            This parameter comtrols whether regular archive files are created, orarchive files with the status "Database copy".
            Archive files with the status "Database copy" can only be read. Nodeletion run is generated for these archive files. Storage is possible.

            Value range
            ' ' = archive files have normal status
            'X' = archive files have the status "Database copy"

            Default
            ' ' = archive files have normal status
            INCLUDE 'ARCHIVE_PARAM_OBJECT_OPEN' OBJECT DOKU ID TX

            Description
            This parameter controls whether the archiving program selection screenis displayed if the archiving program is running in the background.

            Value range
            ' ' = No output
            'X' = Output

            Default
            ' '

            Description
            This parameter controls whether the archiving program selection screenis displayed when the archiving program is running in dialog mode.
            Note that archiving in dialog mode is only supported for test purposes.

            Value range
            ' ' = No output
            'X' = Output

            Default
            'X'