SAP AUTHORITY_CHECK Function Module for
AUTHORITY_CHECK is a standard authority check 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 authority check FM, simply by entering the name AUTHORITY_CHECK into the relevant SAP transaction such as SE37 or SE38.
Function Group: SUSR
Program Name: SAPLSUSR
Main Program: SAPLSUSR
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function AUTHORITY_CHECK 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 'AUTHORITY_CHECK'".
EXPORTING
* NEW_BUFFERING = 3 "Auth. object in user master maintenance
* FIELD4 = ' ' "
* VALUE4 = ' ' "
* FIELD5 = ' ' "
* VALUE5 = ' ' "
* FIELD6 = ' ' "
* VALUE6 = ' ' "
* FIELD7 = ' ' "
* VALUE7 = ' ' "
* FIELD8 = ' ' "
* VALUE8 = ' ' "
* USER = SY-UNAME "Name of the user to be checked
* FIELD9 = ' ' "
* VALUE9 = ' ' "
* FIELD10 = ' ' "
* VALUE10 = ' ' "
OBJECT = "Name of the object to be checked
* FIELD1 = ' ' "An authorization field to the obje
* VALUE1 = ' ' "Inspection value to field1
* FIELD2 = ' ' "Another author.field to the object
* VALUE2 = ' ' "Inspection value to field1 (may be
* FIELD3 = ' ' "Another a author.field to the obje
* VALUE3 = ' ' "Inspection value to field1 (may be
EXCEPTIONS
USER_DONT_EXIST = 1 USER_IS_AUTHORIZED = 2 USER_NOT_AUTHORIZED = 3 USER_IS_LOCKED = 4
IMPORTING Parameters details for AUTHORITY_CHECK
NEW_BUFFERING - Auth. object in user master maintenance
Data type: XUFLAGDefault: 3
Optional: Yes
Call by Reference: No ( called with pass by value option)
FIELD4 -
Data type: UST12-FIELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VALUE4 -
Data type: UST12-VONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FIELD5 -
Data type: UST12-FIELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VALUE5 -
Data type: UST12-VONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FIELD6 -
Data type: UST12-FIELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VALUE6 -
Data type: UST12-VONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FIELD7 -
Data type: UST12-FIELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VALUE7 -
Data type: UST12-VONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FIELD8 -
Data type: UST12-FIELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VALUE8 -
Data type: UST12-VONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
USER - Name of the user to be checked
Data type: USR02-BNAMEDefault: SY-UNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)
FIELD9 -
Data type: UST12-FIELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VALUE9 -
Data type: UST12-VONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FIELD10 -
Data type: UST12-FIELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VALUE10 -
Data type: UST12-VONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
OBJECT - Name of the object to be checked
Data type: UST12-OBJCTOptional: No
Call by Reference: No ( called with pass by value option)
FIELD1 - An authorization field to the obje
Data type: UST12-FIELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VALUE1 - Inspection value to field1
Data type: UST12-VONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FIELD2 - Another author.field to the object
Data type: UST12-FIELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VALUE2 - Inspection value to field1 (may be
Data type: UST12-VONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FIELD3 - Another a author.field to the obje
Data type: UST12-FIELDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VALUE3 - Inspection value to field1 (may be
Data type: UST12-VONDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
USER_DONT_EXIST - User does not exist
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
USER_IS_AUTHORIZED - User is authorized
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
USER_NOT_AUTHORIZED - User is not authorized
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
USER_IS_LOCKED -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for AUTHORITY_CHECK 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_new_buffering | TYPE XUFLAG, " 3 | |||
| lv_user_dont_exist | TYPE XUFLAG, " | |||
| lv_field4 | TYPE UST12-FIELD, " SPACE | |||
| lv_value4 | TYPE UST12-VON, " SPACE | |||
| lv_field5 | TYPE UST12-FIELD, " SPACE | |||
| lv_value5 | TYPE UST12-VON, " SPACE | |||
| lv_field6 | TYPE UST12-FIELD, " SPACE | |||
| lv_value6 | TYPE UST12-VON, " SPACE | |||
| lv_field7 | TYPE UST12-FIELD, " SPACE | |||
| lv_value7 | TYPE UST12-VON, " SPACE | |||
| lv_field8 | TYPE UST12-FIELD, " SPACE | |||
| lv_value8 | TYPE UST12-VON, " SPACE | |||
| lv_user | TYPE USR02-BNAME, " SY-UNAME | |||
| lv_user_is_authorized | TYPE USR02, " | |||
| lv_field9 | TYPE UST12-FIELD, " SPACE | |||
| lv_value9 | TYPE UST12-VON, " SPACE | |||
| lv_field10 | TYPE UST12-FIELD, " SPACE | |||
| lv_value10 | TYPE UST12-VON, " SPACE | |||
| lv_object | TYPE UST12-OBJCT, " | |||
| lv_user_not_authorized | TYPE UST12, " | |||
| lv_field1 | TYPE UST12-FIELD, " SPACE | |||
| lv_user_is_locked | TYPE UST12, " | |||
| lv_value1 | TYPE UST12-VON, " SPACE | |||
| lv_field2 | TYPE UST12-FIELD, " SPACE | |||
| lv_value2 | TYPE UST12-VON, " SPACE | |||
| lv_field3 | TYPE UST12-FIELD, " SPACE | |||
| lv_value3 | TYPE UST12-VON. " SPACE |
|   CALL FUNCTION 'AUTHORITY_CHECK' " |
| EXPORTING | ||
| NEW_BUFFERING | = lv_new_buffering | |
| FIELD4 | = lv_field4 | |
| VALUE4 | = lv_value4 | |
| FIELD5 | = lv_field5 | |
| VALUE5 | = lv_value5 | |
| FIELD6 | = lv_field6 | |
| VALUE6 | = lv_value6 | |
| FIELD7 | = lv_field7 | |
| VALUE7 | = lv_value7 | |
| FIELD8 | = lv_field8 | |
| VALUE8 | = lv_value8 | |
| USER | = lv_user | |
| FIELD9 | = lv_field9 | |
| VALUE9 | = lv_value9 | |
| FIELD10 | = lv_field10 | |
| VALUE10 | = lv_value10 | |
| OBJECT | = lv_object | |
| FIELD1 | = lv_field1 | |
| VALUE1 | = lv_value1 | |
| FIELD2 | = lv_field2 | |
| VALUE2 | = lv_value2 | |
| FIELD3 | = lv_field3 | |
| VALUE3 | = lv_value3 | |
| EXCEPTIONS | ||
| USER_DONT_EXIST = 1 | ||
| USER_IS_AUTHORIZED = 2 | ||
| USER_NOT_AUTHORIZED = 3 | ||
| USER_IS_LOCKED = 4 | ||
| . " AUTHORITY_CHECK | ||
ABAP code using 7.40 inline data declarations to call FM AUTHORITY_CHECK
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_new_buffering) | = 3. | |||
| "SELECT single FIELD FROM UST12 INTO @DATA(ld_field4). | ||||
| DATA(ld_field4) | = ' '. | |||
| "SELECT single VON FROM UST12 INTO @DATA(ld_value4). | ||||
| DATA(ld_value4) | = ' '. | |||
| "SELECT single FIELD FROM UST12 INTO @DATA(ld_field5). | ||||
| DATA(ld_field5) | = ' '. | |||
| "SELECT single VON FROM UST12 INTO @DATA(ld_value5). | ||||
| DATA(ld_value5) | = ' '. | |||
| "SELECT single FIELD FROM UST12 INTO @DATA(ld_field6). | ||||
| DATA(ld_field6) | = ' '. | |||
| "SELECT single VON FROM UST12 INTO @DATA(ld_value6). | ||||
| DATA(ld_value6) | = ' '. | |||
| "SELECT single FIELD FROM UST12 INTO @DATA(ld_field7). | ||||
| DATA(ld_field7) | = ' '. | |||
| "SELECT single VON FROM UST12 INTO @DATA(ld_value7). | ||||
| DATA(ld_value7) | = ' '. | |||
| "SELECT single FIELD FROM UST12 INTO @DATA(ld_field8). | ||||
| DATA(ld_field8) | = ' '. | |||
| "SELECT single VON FROM UST12 INTO @DATA(ld_value8). | ||||
| DATA(ld_value8) | = ' '. | |||
| "SELECT single BNAME FROM USR02 INTO @DATA(ld_user). | ||||
| DATA(ld_user) | = SY-UNAME. | |||
| "SELECT single FIELD FROM UST12 INTO @DATA(ld_field9). | ||||
| DATA(ld_field9) | = ' '. | |||
| "SELECT single VON FROM UST12 INTO @DATA(ld_value9). | ||||
| DATA(ld_value9) | = ' '. | |||
| "SELECT single FIELD FROM UST12 INTO @DATA(ld_field10). | ||||
| DATA(ld_field10) | = ' '. | |||
| "SELECT single VON FROM UST12 INTO @DATA(ld_value10). | ||||
| DATA(ld_value10) | = ' '. | |||
| "SELECT single OBJCT FROM UST12 INTO @DATA(ld_object). | ||||
| "SELECT single FIELD FROM UST12 INTO @DATA(ld_field1). | ||||
| DATA(ld_field1) | = ' '. | |||
| "SELECT single VON FROM UST12 INTO @DATA(ld_value1). | ||||
| DATA(ld_value1) | = ' '. | |||
| "SELECT single FIELD FROM UST12 INTO @DATA(ld_field2). | ||||
| DATA(ld_field2) | = ' '. | |||
| "SELECT single VON FROM UST12 INTO @DATA(ld_value2). | ||||
| DATA(ld_value2) | = ' '. | |||
| "SELECT single FIELD FROM UST12 INTO @DATA(ld_field3). | ||||
| DATA(ld_field3) | = ' '. | |||
| "SELECT single VON FROM UST12 INTO @DATA(ld_value3). | ||||
| DATA(ld_value3) | = ' '. | |||
Search for further information about these or an SAP related objects