SAP ARCHIVE_GET_NEXT_OBJECT Function Module for Read Data Object from the Archive File
ARCHIVE_GET_NEXT_OBJECT is a standard archive get next object SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Read Data Object from the Archive File processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.
See here to view full function module documentation and code listing for archive get next object FM, simply by entering the name ARCHIVE_GET_NEXT_OBJECT into the relevant SAP transaction such as SE37 or SE38.
Function Group: ARCH
Program Name: SAPLARCH
Main Program: SAPLARCH
Appliation area:
Release date: 11-Jan-1995
Mode(Normal, Remote etc): Normal Function Module
Update:
Function ARCHIVE_GET_NEXT_OBJECT pattern details
In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.CALL FUNCTION 'ARCHIVE_GET_NEXT_OBJECT'"Read Data Object from the Archive File.
EXPORTING
ARCHIVE_HANDLE = "Handle to the Open Archive
IMPORTING
OBJECT_ID = "Identification of the Read Data Object
OBJECT_OFFSET = "Offset of Data Object in the Archive
ARCHIVE_NAME = "Archive Key According to Archive Management
COMPR_OBJECT_LENGTH = "Data Object Length (Compressed)
SESSION = "Archiving Session ID
EXCEPTIONS
END_OF_FILE = 1 FILE_IO_ERROR = 2 INTERNAL_ERROR = 3 OPEN_ERROR = 4 WRONG_ACCESS_TO_ARCHIVE = 5
IMPORTING Parameters details for ARCHIVE_GET_NEXT_OBJECT
ARCHIVE_HANDLE - Handle to the Open Archive
Data type: SY-TABIXOptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for ARCHIVE_GET_NEXT_OBJECT
OBJECT_ID - Identification of the Read Data Object
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OBJECT_OFFSET - Offset of Data Object in the Archive
Data type: ARCH_IDX-OFFSETOptional: No
Call by Reference: No ( called with pass by value option)
ARCHIVE_NAME - Archive Key According to Archive Management
Data type: HEADA-ARKEYOptional: No
Call by Reference: No ( called with pass by value option)
COMPR_OBJECT_LENGTH - Data Object Length (Compressed)
Data type: IOptional: No
Call by Reference: No ( called with pass by value option)
SESSION - Archiving Session ID
Data type: ADMI_RUN_DOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
END_OF_FILE - End of the Archive File Reached
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
FILE_IO_ERROR - Archive File Access Error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
INTERNAL_ERROR - Internal error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OPEN_ERROR - Archive File Open Error
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
WRONG_ACCESS_TO_ARCHIVE - Incorrect Access to the Archive
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for ARCHIVE_GET_NEXT_OBJECT Function Module
The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.DATA: | ||||
lv_object_id | TYPE STRING, " | |||
lv_end_of_file | TYPE STRING, " | |||
lv_archive_handle | TYPE SY-TABIX, " | |||
lv_file_io_error | TYPE SY, " | |||
lv_object_offset | TYPE ARCH_IDX-OFFSET, " | |||
lv_archive_name | TYPE HEADA-ARKEY, " | |||
lv_internal_error | TYPE HEADA, " | |||
lv_open_error | TYPE HEADA, " | |||
lv_compr_object_length | TYPE I, " | |||
lv_session | TYPE ADMI_RUN_D, " | |||
lv_wrong_access_to_archive | TYPE ADMI_RUN_D. " |
  CALL FUNCTION 'ARCHIVE_GET_NEXT_OBJECT' "Read Data Object from the Archive File |
EXPORTING | ||
ARCHIVE_HANDLE | = lv_archive_handle | |
IMPORTING | ||
OBJECT_ID | = lv_object_id | |
OBJECT_OFFSET | = lv_object_offset | |
ARCHIVE_NAME | = lv_archive_name | |
COMPR_OBJECT_LENGTH | = lv_compr_object_length | |
SESSION | = lv_session | |
EXCEPTIONS | ||
END_OF_FILE = 1 | ||
FILE_IO_ERROR = 2 | ||
INTERNAL_ERROR = 3 | ||
OPEN_ERROR = 4 | ||
WRONG_ACCESS_TO_ARCHIVE = 5 | ||
. " ARCHIVE_GET_NEXT_OBJECT |
ABAP code using 7.40 inline data declarations to call FM ARCHIVE_GET_NEXT_OBJECT
The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8."SELECT single TABIX FROM SY INTO @DATA(ld_archive_handle). | ||||
"SELECT single OFFSET FROM ARCH_IDX INTO @DATA(ld_object_offset). | ||||
"SELECT single ARKEY FROM HEADA INTO @DATA(ld_archive_name). | ||||
Search for further information about these or an SAP related objects