SAP STATUS_CHANGE_INTERN Function Module for Set/Delete System Status
STATUS_CHANGE_INTERN is a standard status change intern SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Set/Delete System Status 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 status change intern FM, simply by entering the name STATUS_CHANGE_INTERN into the relevant SAP transaction such as SE37 or SE38.
Function Group: BSVA
Program Name: SAPLBSVA
Main Program: SAPLBSVA
Appliation area:
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function STATUS_CHANGE_INTERN 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 'STATUS_CHANGE_INTERN'"Set/Delete System Status.
EXPORTING
* CHECK_ONLY = ' ' "'Carry Out Checks Only' Flag
* CLIENT = SY-MANDT "Client (Only for Exceptional Cases!)
OBJNR = "Object Number
* ZEILE = ' ' "Predefined Line Number for MESSAGE_STORE
* SET_CHGKZ = "'Activate Change Documents' Flag
IMPORTING
ERROR_OCCURRED = "A General Error has Occurred
OBJECT_NOT_FOUND = "Status Object Not Found
STATUS_INCONSISTENT = "Subsequent Status Situation is Inconsistent
STATUS_NOT_ALLOWED = "'Status Change Not Allowed' Flag
TABLES
STATUS = "Table of Individual Statuses for the Object
EXCEPTIONS
OBJECT_NOT_FOUND = 1 STATUS_INCONSISTENT = 2 STATUS_NOT_ALLOWED = 3
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLBSVA_001 User Exit PP Order Processing (Non-Order-Type-Specific)
IMPORTING Parameters details for STATUS_CHANGE_INTERN
CHECK_ONLY - 'Carry Out Checks Only' Flag
Data type: XFELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CLIENT - Client (Only for Exceptional Cases!)
Data type: SY-MANDTDefault: SY-MANDT
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJNR - Object Number
Data type: JSTO-OBJNROptional: No
Call by Reference: No ( called with pass by value option)
ZEILE - Predefined Line Number for MESSAGE_STORE
Data type: MESG-ZEILEDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
SET_CHGKZ - 'Activate Change Documents' Flag
Data type: JSTO-CHGKZOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for STATUS_CHANGE_INTERN
ERROR_OCCURRED - A General Error has Occurred
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
OBJECT_NOT_FOUND - Status Object Not Found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
STATUS_INCONSISTENT - Subsequent Status Situation is Inconsistent
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
STATUS_NOT_ALLOWED - 'Status Change Not Allowed' Flag
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for STATUS_CHANGE_INTERN
STATUS - Table of Individual Statuses for the Object
Data type: JSTATOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
OBJECT_NOT_FOUND - Status Object Not Found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
STATUS_INCONSISTENT - Subsequent Status Situation is Inconsistent
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
STATUS_NOT_ALLOWED - 'Status Change Not Allowed' Flag
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for STATUS_CHANGE_INTERN 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: | ||||
| lt_status | TYPE STANDARD TABLE OF JSTAT, " | |||
| lv_check_only | TYPE XFELD, " SPACE | |||
| lv_error_occurred | TYPE XFELD, " | |||
| lv_object_not_found | TYPE XFELD, " | |||
| lv_client | TYPE SY-MANDT, " SY-MANDT | |||
| lv_object_not_found | TYPE SY, " | |||
| lv_status_inconsistent | TYPE SY, " | |||
| lv_objnr | TYPE JSTO-OBJNR, " | |||
| lv_status_not_allowed | TYPE JSTO, " | |||
| lv_status_inconsistent | TYPE JSTO, " | |||
| lv_zeile | TYPE MESG-ZEILE, " SPACE | |||
| lv_status_not_allowed | TYPE MESG, " | |||
| lv_set_chgkz | TYPE JSTO-CHGKZ. " |
|   CALL FUNCTION 'STATUS_CHANGE_INTERN' "Set/Delete System Status |
| EXPORTING | ||
| CHECK_ONLY | = lv_check_only | |
| CLIENT | = lv_client | |
| OBJNR | = lv_objnr | |
| ZEILE | = lv_zeile | |
| SET_CHGKZ | = lv_set_chgkz | |
| IMPORTING | ||
| ERROR_OCCURRED | = lv_error_occurred | |
| OBJECT_NOT_FOUND | = lv_object_not_found | |
| STATUS_INCONSISTENT | = lv_status_inconsistent | |
| STATUS_NOT_ALLOWED | = lv_status_not_allowed | |
| TABLES | ||
| STATUS | = lt_status | |
| EXCEPTIONS | ||
| OBJECT_NOT_FOUND = 1 | ||
| STATUS_INCONSISTENT = 2 | ||
| STATUS_NOT_ALLOWED = 3 | ||
| . " STATUS_CHANGE_INTERN | ||
ABAP code using 7.40 inline data declarations to call FM STATUS_CHANGE_INTERN
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.| DATA(ld_check_only) | = ' '. | |||
| "SELECT single MANDT FROM SY INTO @DATA(ld_client). | ||||
| DATA(ld_client) | = SY-MANDT. | |||
| "SELECT single OBJNR FROM JSTO INTO @DATA(ld_objnr). | ||||
| "SELECT single ZEILE FROM MESG INTO @DATA(ld_zeile). | ||||
| DATA(ld_zeile) | = ' '. | |||
| "SELECT single CHGKZ FROM JSTO INTO @DATA(ld_set_chgkz). | ||||
Search for further information about these or an SAP related objects