Tracing Standard Authorizations

Objective

After completing this lesson, you will be able to trace standard authorizations

Business Example

Customer thinking about the need to understand standard authorizations tracing.

This lesson covers the use of standard authorization tracing strategies, focusing on tools like SU53, ST01, STAUTHTRACE, and STUSERTRACE to support the specification and assignment of standard authorizations.

Trace Tools for Standard Authorizations

In the absence of documentation or encountering failed authorization checks during transaction execution, use the following methods to determine the required SAP standard authorizations:

Which authorization is missing? Use the following authorization trace tools: Authorization Error Analysis SU53 and System Trace ST01 or STAUTHTRACE to find the missing authorization.

  • The Authorization Error Analysis using transaction SU53.

  • System Trace using transaction ST01 executes a trace tool that exists in all ABAP-based systems.

    One function of this tool is acting as a trace for all SAP-provided authorization objects.

  • System Trace using transaction STAUTHTRACE.

    Note

    Analysis Authorizations can only be traced in transaction RSECADMIN.

Authorization Trace with SU53

Users can use transaction SU53 to analyze an access-denied error in their system that just occurred. They can call transaction SU53 in any session, not just the session in which the error occurred.

Display Authorization Data for User R_ADMIN18 Evaluation of the Last Failed Authorization Check screenshot. Analyze which authorizations are missing and pass this information to the Authorization Administrator.

Using SU53, you can analyze which authorizations are missing and pass this information to the authorization administrator.

If there are many active users and many failed authorization checks, the number of checks and the period covered can be decreased for a user.

Note

  • The display is reset if the user logs on again.

  • The display is not refreshed if a new error occurs. It is only updated if transaction SU53 is called again.

The user can also use transaction SU56 to view which authorizations are currently in the buffer.

If a user is unable to perform an action, and the authorization error analysis shows the message "All authorization checks have been successful". Then the issue lies elsewhere, not with authorization.

If transaction SU53 does not provide a satisfactory result, the following further system trace options can be used: ST01 and STAUTHTRACE.

System Trace ST01

The system trace allows you to record internal SAP system activities. The system trace is primarily used when an authorization trace is required. Apart from authorization checks, the following components can be monitored using the system trace: kernel functions, kernel modules, database accesses, table buffers, RFC calls, and lock operations.

For the ST01 system trace, ensure the trace and transaction being traced are on the same application server.

Transaction ST01 steps 1, 2, and 3 are presented in the following text.
Transaction ST01 steps 5, 6, and 7 are presented in the following text.
Transaction ST01 step 8 is presented in the following text. RC (Return Code): 0 - Authorization check successful/ 12 and 4 - Missing authorizations.

Using the ST01 System Trace, you can analyze authorizations as follows:

  1. Choose the Authorization Check trace component.

  2. To restrict the trace function to your own or to another user, choose General Filter.

    Enter the user ID to be traced in the Trace for user only field in the displayed dialog box.

  3. To start the trace, choose Trace on.

  4. The user to be traced executes the relevant system actions.

  5. Choose Analysis.

  6. Maintain the Options for Trace Analysis to narrow the analysis result.

  7. Choose Start Reporting.

  8. Analyse the trace result.

    Analysis highlights successful checks in a darker shade and failed checks in a lighter shade.

    A return code of "0" (dark green) indicates successful checks, while other codes such as "12" and "4" signify errors.

    Double-click on a relevant entry for more details on a specific security check in the trace log.

Once you have completed the analysis, choose Trace off.

System Trace for Authorization Checks (STAUTHTRACE)

The System Trace for Authorization Checks (transaction STAUTHTRACE) provides an optimized user interface to trace authorization checks. It works in the same way as the system trace (transaction ST01) but is solely for performing authorization checks.

STAUTHTRACE tool usage notes:

  • Evaluation of the system trace for authorization checks can be done for the current server.
  • It is also possible to start and stop the system trace for authorization checks on all servers or on selected servers of a system.
  • The system displays an additional server name column when viewing performed authorization checks.
Transaction STAUTHTRACE steps 1, 2, 3, 4, and 5 are presented in the following text.
Transaction STAUTHTRACE step 6 is presented in the following text.

Using the STAUTHTRACE Authorization Checks, you can analyze authorizations as follows:

  1. Enter a value in the Trace for user only field.
  2. Start the trace by choosing Activate Trace.
  3. The user to be traced should execute the application as fully as possible in a separate session on the same application server.
  4. Maintain the Restrictions for the Evaluation to narrow the analysis result.
  5. Choose Evaluate.
  6. Analyse the trace result.

Once you have completed the analysis, deactivate the trace by choosing Deactivate Trace.

The advantages of STAUTHTRACE compared to the ST01 transaction are as follows:

  • STAUTHTRACE: The System Wide Trace option can be activated to get the trace for all application servers. At the same time, you can also fetch and deactivate all server trace from the single point. ST01 – If a system has 3 different application servers, you must login to three servers separately and activate and deactivate the trace in all servers if the user server is unknown. You must also fetch the trace from different servers separately.
  • STAUTHTRACE – We can remove the duplicate traces in the trace report while analyzing the logs. ST01 – Doesn’t have the option to remove duplicate entries before the trace log is downloaded.

    Note

    For more information please refer to SAP NOTE 2577291 - How to get trace of authorization checks using transaction STAUTHTRACE.

User Trace for Authorization Checks: STUSERTRACE

This long-term trace collects client-specific and user-specific authorization data and stores it in the database. During the execution of a program, every authorization check is recorded once for each user with the first time stamp, together with the name and type of the running application, the point in the program, the authorization object, the checked authorization values, and the result.

Trace data aids in maintaining authorization default values and authorizations, especially for users with specific tasks or unique objects like communication users in RFC scenarios.

Note

Refer to SAP Note 2220030 - STUSERTRACE: User trace for authorization checks for more details.

Creating a Role for a Data Load Administrator

In this video, you learn which authorizations are necessary for loading data into a DataStore Object advanced.

Useful Transactions and Tables for Standard Authorizations

Useful Transactions for Standard Authorizations

TransactionsDescription
PFCGRole Maintenance
SU01User Maintenance
SU02Maintain Authorization Profiles
SU03Edit Authorizations in Profiles
SU10User Mass Maintenance
SU21Maintain Authorization Objects
SU24Maintain Authorization Default Values
SU53Evaluate Authorization Check
SU56Analyze User Buffer
SUIMUser Information System
ST01System Trace
STAUTHTRACESystem Trace for Authorization Checks
STUSERTRACEUser Trace for Authorization Checks
SE93Maintain Transaction (List of Transactions)

Useful Tables for Standard Authorizations

TablesDescription
TOBJAuthorization Objects and their Fields
AGR_1251Roles with Authorization Objects and Authorizations
AGR_USERSAssignment of Roles to Users
AGR_PROFProfile Name for Role
AGR_TCODESTransactions in Roles
AGR_*Many more tables for Roles
UST12Profiles with Authorization Objects and Authorizations
TACTActivities which can be protected

Log in to track your progress & complete quizzes