SAP ARCHIV_GET_BYTES Function Module for









ARCHIV_GET_BYTES is a standard archiv get bytes SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 archiv get bytes FM, simply by entering the name ARCHIV_GET_BYTES into the relevant SAP transaction such as SE37 or SE38.

Function Group: OPTD
Program Name: SAPLOPTD
Main Program: SAPLOPTD
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function ARCHIV_GET_BYTES 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 'ARCHIV_GET_BYTES'"
EXPORTING
SAP_OBJECT = "SAP Business Object
OBJECT_ID = "Object ID of business object
* AR_OBJECT = "Document type
LENGTH = "Length (in bytes) of object to be made available
OFFSET = "Position from the object to be made available is in bytes
* MODE = ' ' "Text mode if 'T', otherwise binary

TABLES
ARCHIVOBJECT = "Object to be archived in internal table

EXCEPTIONS
ERROR_ARCHIV = 1 ERROR_COMMUNICATIONTABLE = 2 ERROR_KERNEL = 3 ERROR_CONNECTIONTABLE = 4 NOT_UNIQUE = 5
.



IMPORTING Parameters details for ARCHIV_GET_BYTES

SAP_OBJECT - SAP Business Object

Data type: TOAV0-SAP_OBJECT
Optional: No
Call by Reference: No ( called with pass by value option)

OBJECT_ID - Object ID of business object

Data type: TOAV0-OBJECT_ID
Optional: No
Call by Reference: No ( called with pass by value option)

AR_OBJECT - Document type

Data type: TOAV0-AR_OBJECT
Optional: Yes
Call by Reference: No ( called with pass by value option)

LENGTH - Length (in bytes) of object to be made available

Data type: SAPB-LENGTH
Optional: No
Call by Reference: No ( called with pass by value option)

OFFSET - Position from the object to be made available is in bytes

Data type: SAPB-OFFSET
Optional: No
Call by Reference: No ( called with pass by value option)

MODE - Text mode if 'T', otherwise binary

Data type: C
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for ARCHIV_GET_BYTES

ARCHIVOBJECT - Object to be archived in internal table

Data type: DOCS
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

ERROR_ARCHIV - Archive system error

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ERROR_COMMUNICATIONTABLE - No entry available in the archive table

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ERROR_KERNEL - SAP kernel error

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ERROR_CONNECTIONTABLE - No entry in the connection table

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NOT_UNIQUE - More than one entry available

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for ARCHIV_GET_BYTES 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_sap_object  TYPE TOAV0-SAP_OBJECT, "   
lt_archivobject  TYPE STANDARD TABLE OF DOCS, "   
lv_error_archiv  TYPE DOCS, "   
lv_object_id  TYPE TOAV0-OBJECT_ID, "   
lv_error_communicationtable  TYPE TOAV0, "   
lv_ar_object  TYPE TOAV0-AR_OBJECT, "   
lv_error_kernel  TYPE TOAV0, "   
lv_length  TYPE SAPB-LENGTH, "   
lv_error_connectiontable  TYPE SAPB, "   
lv_offset  TYPE SAPB-OFFSET, "   
lv_not_unique  TYPE SAPB, "   
lv_mode  TYPE C. "   SPACE

  CALL FUNCTION 'ARCHIV_GET_BYTES'  "
    EXPORTING
         SAP_OBJECT = lv_sap_object
         OBJECT_ID = lv_object_id
         AR_OBJECT = lv_ar_object
         LENGTH = lv_length
         OFFSET = lv_offset
         MODE = lv_mode
    TABLES
         ARCHIVOBJECT = lt_archivobject
    EXCEPTIONS
        ERROR_ARCHIV = 1
        ERROR_COMMUNICATIONTABLE = 2
        ERROR_KERNEL = 3
        ERROR_CONNECTIONTABLE = 4
        NOT_UNIQUE = 5
. " ARCHIV_GET_BYTES




ABAP code using 7.40 inline data declarations to call FM ARCHIV_GET_BYTES

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 SAP_OBJECT FROM TOAV0 INTO @DATA(ld_sap_object).
 
 
 
"SELECT single OBJECT_ID FROM TOAV0 INTO @DATA(ld_object_id).
 
 
"SELECT single AR_OBJECT FROM TOAV0 INTO @DATA(ld_ar_object).
 
 
"SELECT single LENGTH FROM SAPB INTO @DATA(ld_length).
 
 
"SELECT single OFFSET FROM SAPB INTO @DATA(ld_offset).
 
 
DATA(ld_mode) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!