STATUS_CHANGE_FOR_ACTIVITY is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.
See here to view full function module documentation and code listing, simply by entering the name STATUS_CHANGE_FOR_ACTIVITY into the relevant SAP transaction such as SE37 or SE80.
Associated Function Group:
BSVA
Released Date:
Not Released
Processing type: Normal fucntion module
CALL FUNCTION 'STATUS_CHANGE_FOR_ACTIVITY' "Carry Out Status Changes for an Activity
EXPORTING
* activity_allowed = SPACE " xfeld 'Activity Allowed' Flag (Only for OBTYP = ORC)
* check_only = SPACE " xfeld 'Carry Out Checks Only' Flag
* client = SY-MANDT " sy-mandt Client (Use Only in Exceptional Cases!)
* no_check = SPACE " xfeld 'No Check Whether Activity Allowed' Flag
objnr = " jsto-objnr Object Number
vrgng = " tj01-vrgng Activity for which the Subsequent Statuses are to be Set
* zeile = SPACE " mesg-zeile Line Number for Message Handler, if Active
* set_chgkz = " jsto-chgkz 'Activate Change Documents' Flag
* date = " sy-datum Effective Date for Results Analysis
* no_authority_check = SPACE " xfeld Suppress Authorization Check
IMPORTING
stonr = " tj30-stonr Status Number
activity_not_allowed = " 'Activity not Allowed' Flag
activity_not_allowed = " Activity not Allowed
error_occurred = " 'Error Message Occurred' Flag
object_not_found = " 'Status Object Not Found' Flag
object_not_found = " Status Object Not Found
status_inconsistent = " 'Status Set and Deleted' Flag
status_inconsistent = " Individual Status Should be Set and Deleted
status_not_allowed = " 'Status Change Not Allowed' Flag
status_not_allowed = " Status Change Not Allowed
warning_occurred = " 'Warning Message Occurred' Flag
EXCEPTIONS
ACTIVITY_NOT_ALLOWED = 1 " Activity not Allowed
ACTIVITY_NOT_ALLOWED = 1 " 'Activity not Allowed' Flag
OBJECT_NOT_FOUND = 2 " Status Object Not Found
OBJECT_NOT_FOUND = 2 " 'Status Object Not Found' Flag
STATUS_INCONSISTENT = 3 " Individual Status Should be Set and Deleted
STATUS_INCONSISTENT = 3 " 'Status Set and Deleted' Flag
STATUS_NOT_ALLOWED = 4 " Status Change Not Allowed
STATUS_NOT_ALLOWED = 4 " 'Status Change Not Allowed' Flag
WRONG_INPUT = 5 " CHECK_ONLY = 'X' and NO_CHECK = 'X'
WARNING_OCCURED = 6 " Activity is "Allowed with Warning" Only
. " STATUS_CHANGE_FOR_ACTIVITY
The ABAP code below is a full code listing to execute function module STATUS_CHANGE_FOR_ACTIVITY including all data declarations. The code uses 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 original method of declaring data variables up front. 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).
| ld_stonr | TYPE TJ30-STONR , |
| ld_activity_not_allowed | TYPE STRING , |
| ld_activity_not_allowed | TYPE STRING , |
| ld_error_occurred | TYPE STRING , |
| ld_object_not_found | TYPE STRING , |
| ld_object_not_found | TYPE STRING , |
| ld_status_inconsistent | TYPE STRING , |
| ld_status_inconsistent | TYPE STRING , |
| ld_status_not_allowed | TYPE STRING , |
| ld_status_not_allowed | TYPE STRING , |
| ld_warning_occurred | TYPE STRING . |
The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.
DATA:
| ld_stonr | TYPE TJ30-STONR , |
| ld_activity_allowed | TYPE XFELD , |
| ld_activity_not_allowed | TYPE STRING , |
| ld_activity_not_allowed | TYPE STRING , |
| ld_check_only | TYPE XFELD , |
| ld_error_occurred | TYPE STRING , |
| ld_client | TYPE SY-MANDT , |
| ld_object_not_found | TYPE STRING , |
| ld_object_not_found | TYPE STRING , |
| ld_no_check | TYPE XFELD , |
| ld_objnr | TYPE JSTO-OBJNR , |
| ld_status_inconsistent | TYPE STRING , |
| ld_status_inconsistent | TYPE STRING , |
| ld_vrgng | TYPE TJ01-VRGNG , |
| ld_status_not_allowed | TYPE STRING , |
| ld_status_not_allowed | TYPE STRING , |
| ld_zeile | TYPE MESG-ZEILE , |
| ld_warning_occurred | TYPE STRING , |
| ld_set_chgkz | TYPE JSTO-CHGKZ , |
| ld_date | TYPE SY-DATUM , |
| ld_no_authority_check | TYPE XFELD . |
The function module executes an activity on a status object.
It first checks whether the activity is currently allowed, i.e.
...See here for full SAP fm documentation
Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name STATUS_CHANGE_FOR_ACTIVITY or its description.