SAP ARCHIVE_SET_STATUS Function Module for Archive status change









ARCHIVE_SET_STATUS is a standard archive set status SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Archive status change 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 set status FM, simply by entering the name ARCHIVE_SET_STATUS into the relevant SAP transaction such as SE37 or SE38.

Function Group: FR01
Program Name: SAPLFR01
Main Program: SAPLFR01
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function ARCHIVE_SET_STATUS 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_SET_STATUS'"Archive status change
EXPORTING
I_APPLI = "SAP application
I_ARKEY = "Archive key
* I_ERRNO = ' ' "Error number for status, if no error, ' '
* I_MSGGR = ' ' "Error message ID, if no error, ' '
I_OBJCT = "Archiving object
I_STATE = "Status which archive should take with ARKEY

EXCEPTIONS
ARCHIVE_EMPTY = 1 ERROR_PUT = 2 NO_TRANS_ALLOWED = 3 WRONG_OBJECT = 4
.



IMPORTING Parameters details for ARCHIVE_SET_STATUS

I_APPLI - SAP application

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

I_ARKEY - Archive key

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

I_ERRNO - Error number for status, if no error, ' '

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

I_MSGGR - Error message ID, if no error, ' '

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

I_OBJCT - Archiving object

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

I_STATE - Status which archive should take with ARKEY

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

EXCEPTIONS details

ARCHIVE_EMPTY - Data could not be read from RFDT

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

ERROR_PUT - Data could not be written back in RFDT

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

NO_TRANS_ALLOWED -

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

WRONG_OBJECT - Object is not the one currently being processed

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

Copy and paste ABAP code example for ARCHIVE_SET_STATUS 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_i_appli  TYPE TR01-APPLI, "   
lv_archive_empty  TYPE TR01, "   
lv_i_arkey  TYPE SR01A-ARKEY, "   
lv_error_put  TYPE SR01A, "   
lv_i_errno  TYPE SR01A, "   SPACE
lv_no_trans_allowed  TYPE SR01A, "   
lv_i_msggr  TYPE SR01A, "   SPACE
lv_wrong_object  TYPE SR01A, "   
lv_i_objct  TYPE TR01-OBJCT, "   
lv_i_state  TYPE TR01. "   

  CALL FUNCTION 'ARCHIVE_SET_STATUS'  "Archive status change
    EXPORTING
         I_APPLI = lv_i_appli
         I_ARKEY = lv_i_arkey
         I_ERRNO = lv_i_errno
         I_MSGGR = lv_i_msggr
         I_OBJCT = lv_i_objct
         I_STATE = lv_i_state
    EXCEPTIONS
        ARCHIVE_EMPTY = 1
        ERROR_PUT = 2
        NO_TRANS_ALLOWED = 3
        WRONG_OBJECT = 4
. " ARCHIVE_SET_STATUS




ABAP code using 7.40 inline data declarations to call FM ARCHIVE_SET_STATUS

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 APPLI FROM TR01 INTO @DATA(ld_i_appli).
 
 
"SELECT single ARKEY FROM SR01A INTO @DATA(ld_i_arkey).
 
 
DATA(ld_i_errno) = ' '.
 
 
DATA(ld_i_msggr) = ' '.
 
 
"SELECT single OBJCT FROM TR01 INTO @DATA(ld_i_objct).
 
 


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!