Fonction SAP ARCHIVE_GET_FIRST_RECORD - Sequential Read of a Data Object from the First Data Record

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
ARCHIVE_HANDLE SYST-TABIX I 4 Handle on Open Archive Files
AUTOMATIC_CONVERSION 0 'X' X Automatic Conversion of the Data Record
GET_REAL_STRUCTURE_NAME 0 'X' X Conversion of the Structure Name

Paramètre Reférence Type Long. Description
RECORD 0 The Returned Record
RECORD_FLAGS ARC_BUFFER-FLAGS C 8 Flag Bar per Data Record
RECORD_LENGTH ARCH_INT-INT4 I 4 Length of the Data Record in Parameter RECORD
RECORD_REF REF TO DATA 0 Reference to Data Record
RECORD_STRUCTURE ARC_BUFFER-RNAME C 30 Name of Returned Structure

Exception Description
END_OF_OBJECT No Record Exists in the Object
INTERNAL_ERROR Internal Error
WRONG_ACCESS_TO_ARCHIVE Incorrect Access to the Archive

Functionality
Using this function module, you set the record cursor on the firstrecord of the data object previously read withARCHIVE_GET_NEXT_OBJECT and read the record. At the nextsequential access with ARCHIVE_GET_NEXT_RECORD orARCHIVE_GET_NEXT_STRUCT_SPECIF, the second record of the dataobject is read.
You can use this function module when you want to read the data recordsof a data object again. This functionality combines the calls offunction modules ARCHIVE_SET_RECORD_CURSOR andARCHIVE_GET_NEXT_RECORD.

Example

  • Example 1

  • Read first data record of a data object with additional information
    TABLES: BKPF, BSEG, BSET, BVOR, BSEC, BSED.
    DATA: HANDLE LIKE SY-TABIX.
    BUFFER_REF TYPE REF TO data,
    FLAGS LIKE ARCH_FLAGS,
    STRUC LIKE ARC_BUFFER-RNAME.
    ...
    CALL FUNCTION 'ARCHIVE_GET_FIRST_RECORD'
    EXPORTING
    ARCHIVE_HANDLE = HANDLE
    IMPORTING
    RECORD_REF = BUFFER_REF
    RECORD_FLAGS = FLAGS
    RECORD_STRUCTURE = STRUC
    EXCEPTIONS
    END_OF_OBJECT = 01
    INTERNAL_ERROR = 02
    WRONG_ACCESS_TO_ARCHIVE = 03.
    • Example 2

    • Read first data record of a data object without additional information
      CALL FUNCTION 'ARCHIVE_GET_FIRST_RECORD'
      EXPORTING
      ARCHIVE_HANDLE = HANDLE
      IMPORTING
      RECORD_REF = BUFFER_REF
      EXCEPTIONS
      END_OF_OBJECT = 01
      INTERNAL_ERROR = 02
      WRONG_ACCESS_TO_ARCHIVE = 03.

      Notes
      If you want to read the first data record again without changing therecord cursor for reading the next record, you can use function moduleARCHIVE_GET_WITH_CURSOR.
      If you only need the fields RECORD_FLAGS andRECORD_STRUCTURE, you can use function moduleARCHIVE_GET_RECORD_INFO.

      Description
      The parameter RECORD_LENGTH provides the length of the datarecord passed on via the parameter RECORD.

      Description
      INCLUDE 'ARCHIVE_PARAM_RECORD_REF_GET' OBJECT DOKU ID TX
      INCLUDE 'ARCHIVE_PARAM_HANDLE_READ' OBJECT DOKU ID TX
      INCLUDE 'ARCHIVE_PARAM_AUTOMATIC_CONV' OBJECT DOKU ID TX