Fonction SAP ARCHIVE_NEW_OBJECT - Request Data Object for Writing

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
ARCHIVE_HANDLE SYST-TABIX I 4 Handle to the Open Archive
OBJECT_ID 0 SPACE X Identification of the New Data Object

Exception Description
INTERNAL_ERROR Internal Error
WRONG_ACCESS_TO_ARCHIVE Incorrect Access to the Archive

Functionality
This function module should always be called when a new data object isto be prepared for writing to an archive.
There can only be one data object per handle. When this function moduleis called, all data for the current data object is discarded and allassociated archiving classes are informed that all subsequentoperations on this handle belong to a new data object.
The archiving classes themselves discard all information for thecurrent data object.
The system does not check whether you have saved the current dataobject with the function module ARCHIVE_SAVE_OBJECT. You canthus discard a data object if you find out at a later point that thedata cannot yet be archived.

  • Example 1

  • DATA: HANDLE LIKE SY-TABIX.
    ...
    CALL FUNCTION 'ARCHIVE_NEW_OBJECT'
    EXPORTING
    ARCHIVE_HANDLE = HANDLE
    EXCEPTIONS
    INTERNAL_ERROR = 01
    WRONG_ACCESS_TO_ARCHIVE = 02.
    • Example 2

    • A detailed example can be found in program RSARCH04.

      Notes
      If you try to append a data record to a data object with the functionmodule ARCHIVE_PUT_RECORD before a data object has been madeavailable with this function module, the exceptionWRONG_ACCESS_TO_ARCHIVE is raised.
      The same occurs when you close a data object and write it to thearchive file with the function module ARCHIVE_SAVE_OBJECT butthen try to append another data record to the data object with thefunction module ARCHIVE_PUT_RECORD.

      Description
      You can assign an ID to the newly requested data object using thisparameter. This ID is returned if you read this object from anavailable archive using the function moduleARCHIVE_GET_NEXT_OBJECT. If an index file is to be set up toread individual data objects from an archive file, this ID is used toset up the index.

      Value range
      You should only pass character fields to avoid problems with differentplatforms.

      Default
      If you do not pass a value, an ID is not stored.