Troubleshouting Authorization Checks

Objective

After completing this lesson, you will be able to trace and analyze SAP ABAP authorization checks.

Error Analysis for Authorization Problems

If you cannot find documentation about authorization for a transaction, or if a failed authorization check is always reported when you execute a transaction, there are two ways in which you can determine the required authorizations:

  1. With the authorization error analysis and transaction code SU53.

  2. With the system trace for authorization checks STAUTHTRACE.

Analyzing Authorization Checks

Illustration on Analyzing Authorization Checks.

In the next example, a transaction from the FI area was executed and terminated due to a missing authorization. The system message is: You are not authorized for this function.

To analyze this error, choose the menu path SystemUtilitiesDisplay Authorization Check or enter transaction code SU53 in the command field.

Screenshots showing Authorization Error Analysis (SU53.

You can now analyze the last error in your system that occurred due to a missing authorization. You can call transaction SU53 in any session, not just in the session in which the error occurred.

Example: In the previous figure, the user calls transaction VA07. The message "You are not authorized for transaction VA07" appears.

Then, the user calls transaction SU01 and will display the user data of another user. In this case, the authorization object S_USER_GRP is checked. The authorization object is assigned to the user, but the required authorization values (activity "03" and user group "Training") are not assigned.

To analyze the missing authorization, the user enters transaction code SU53 in the command field and the system displays the authorization object that caused the last failed authorization checks. The system displays the value of the authorization object that the program required.

In the case of missing authorization values for a specific authorization object, you can check which other authorization values are assigned to the user.

Transaction SU53 displays the maximum of 100 failed authorization checks for each user in the upper area. It displays these for the last three hours at most. If there are very many active users and very many failed authorization checks, the number of checks and the period that is covered can also be smaller for a user. In addition, it displays the context in which the check occurred (that is, the transaction, RFC function module, or service). In the lower area, the authorizations of the user are displayed for all of the authorization objects that are displayed.

The system uses a ring buffer in the shared memory of the application server for saving failed authorization checks. Web Dynpro applications can also access this memory area.

The size of the buffer depends on the number of work processes, which is defined by profile parameters. It consists of 100 authorization checks for each work process in the standard system. This number can be changed by setting the profile parameter auth/su53_buffer_entries. The profile parameter can be maintained using transactions RZ11 and RZ10.

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

Hint

If the user was prevented from executing an action, and the authorization error analysis shows: All authorization checks have so far been successful, the problem is not an authorization problem. The problem has another cause.

If transaction SU53 does not provide a satisfactory result, you can still use the system trace for authorization checks (STAUTHTRACE).

System Trace for Authorization Checks

If you do not know the required authorization, you can use the system trace or the authorization error analysis to determine them. You can use the system trace function to record authorization checks in your own and in external sessions using the system trace function : System Trace for Authorization Checks STAUTHTRACE. As an alternative, you can also use the system trace: ToolsAdministrationMonitorTracesSystem Trace (transaction ST01).

The trace records each authorization object that is tested, along with the object's fields and the values tested.

Note

The system trace allows the recording of internal SAP system activities. The system trace is primarily used when an authorization trace is required. Besides 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.

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). However, it only evaluates authorization checks.

The evaluation of the system trace for authorization checks can be performed 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. When you display the authorization checks that were performed, the system displays an additional column containing the name of the server.

Screenshots showing the five steps for System Trace for Authorization Checks (STAUTHTRACE).

You can analyze authorizations using the system trace for authorization checks as follows:

  1. If necessary, set Trace Only for User and start the trace by choosing Activate Trace. The system writes the trace data in the current trace file.

  2. Execute the application as fully as possible in a separate session on the same application server.

  3. Deactivate the trace by choosing Deactivate Trace.

  4. You can optionally restrict the results display with the options under Restrictions.

  5. Choose Evaluate.

The system trace (transaction ST01) offers a variety of tracing options. Among others, you can trace authorization checks. For evaluation of the system trace, it is necessary that the trace and the transaction to be traced are running on the same application server.

Screenshots showing the five steps for System Trace (ST01).

You can analyze authorizations as follows:

  1. Choose ToolsAdministrationMonitorTracesSystem Trace or transaction ST01.

  2. Choose the Authorization Check trace component.

  3. To restrict the trace function to your own sessions, choose EditFilterShared. Enter your user ID in the Trace for user only field in the displayed dialog box.

  4. Start the trace by choosing the Trace on button. The trace is automatically written to the hard disk.

  5. Execute the relevant system actions.

  6. Once you have completed the analysis, choose Trace off.

  7. To display the results of the analysis, choose GotoAnalysis or the Analysis button. Select the desired file and choose Start Reporting.

The results of the authorization check are displayed in the following format (see also the previous figure):

<authorization object><return code>:::<field>=<tested value>

The return code shows whether or not the authorization code was successful.

Hint

The return code "0" (dark green) means that the check at this point was "successful". Any other result means that an error occurred, which may have various causes, depending on the programming (see SAP Note 209899).

Information Systems for Administrators and Audit

You should not immediately implement the result of a trace or of transaction SU53 as new roles or profiles. First, analyze the system for existing settings. The Information System and the Audit Info System (which is used by auditors) are available to the administrator for this purpose.

You can use the User Information System to obtain an overview of the authorizations and users in your SAP system at any time using search criteria that you specify. In particular, you can display lists of users to which authorizations classified as critical are assigned. You can also use the User Information System to do the following.

Examples from the User Information System

  • Compare roles and users

  • Display change documents for the authorization profile of a user

  • Display the transactions contained in a role

  • Create where-used lists

We recommend that you regularly check the various list that are important for you. Define a monitoring procedure and corresponding checklists to make sure that you continually review your authorization plan. We especially recommend that you determine which authorizations you consider critical and regularly review which users have these authorizations in their profiles.

Screenshots showing the Information System.

You can start the Information System from the SAP Menu by choosing ToolsAdministrationUser MaintenanceInformation System. You can also branch to the Information System authorizations from the User Maintenance transaction (SU01) by choosing the menu path InformationInformation System.

You can find elements of the authorization system using different selection criteria.

The Information System (RSUSR998) and parts of the Information System can be called as executable reports using transaction SA38. Here are a few examples:

  • RSUSR002; Users by complex selection criteria

  • RSUSR008; By critical combinations of authorizations at transaction start

  • RSUSR008_009_NEW; List of users with critical authorizations

  • RSUSR020; Profiles by complex selection criteria

  • RSUSR030; Authorizations by complex selection criteria

  • RSUSR040; Authorization objects by complex selection criteria

  • RSUSR070; Roles by complex selection criteria

  • RSUSR100; Change Documents for Users

  • RSUSR101; Change Documents for Profiles

More detailed analyses can also be started using Reports:

  • RSUSR003; Check the Passwords of Users "SAP*" and "DDIC" in All Clients

  • RSUSR200; List of Users by Logon Data and Password Change

Another way to read information from the system is a special role concept for auditing (previously done using Audit Information System).

The content of the concept has been revised by the auditing and risk management working group of the German-Speaking SAP User Group e.V. (DSAG), in cooperation with customers and partners. This group has considered a wide range of information from external and internal auditors, IT specialists, and consultants who examine SAP applications or whose companies implement SAP software. For more information, see http://www.sap.com/germany/discsap/revis/index.htm.

Illustration listing the checks done by Audit Information System (AIS).

The Audit Information System (AIS) is a checking tool for:

  • System checks

  • Audit (business audit)

  • Tax audits

  • Internal auditing

  • External auditing

The AIS role concept improves the flow and quality of the check.

The Audit Information System is a tool used by auditors to optimize a system and examine any weak points. The old menu-based version (AUDIT area menu) was replaced by a role-based environment. The role concept used now includes the same collections, structuring, and defaults for standard SAP programs, but is easier to scale. The content is defined using the transaction PFCG (ToolsAdministrationUser MaintenanceRole Administration); the old transaction SECR is no longer used.

Hint

For more information about the technology behind the program, see SAP Note 451960. 451960.

The roles are constructed to match the flow of the check for different check fields with default control data/evaluation programs for the area "Business" and "System Audit". The roles can be found in PFCG with the ID "SAP*AUDITOR*".

Screenshot showing the Excerpt from the Search Results SAP*AUDITOR* in Role Maintenance.

The delivered single roles are split into two groups:

  1. Authorization roles

  2. Transaction roles

The authorization roles are easy to identify. The role names always end with the suffix "*_A". This means that all roles that do not end with a simple "A" are the corresponding menu roles.

Accordingly, the following condition applies:

  • The authorization roles contain (manual) authorization values, but do not have a menu (such as SAP_AUDITOR_BA_SD_A).

  • The transaction roles contain a menu, but do not have any authorization values (such as SAP_AUDITOR_BA_SD).

If you are now asking yourself "Why not use a single role with menu and authorizations?", there is a simple explanation.

What happens when you enter a transaction code in the role menu and then display the authorization data? Correct. Default authorization values are displayed for objects and fields. In many cases, however, there are too many defaults for auditing purposes, since the authorization goes far beyond just "Display Authorization". If you were to modify these defaults for your own requirements, the time and effort needed to make changes to the content would be much too high (note: maintenance status "Changed").

Hint

Finally, note again the following: As an administrator, remain focused on your authorization concept every time you receive a new request from the user departments.

  • Avoid an unnecessarily large number of roles or profiles.

  • Not every error that is displayed is connected to authorizations.

  • When you receive requests, first search for authorizations to see if they have already been created.

  • Clarify whether these can be reused.

  • Only create something new in response to a requested authorization if nothing suitable already exists.

Users with Critical Authorizations

The purpose is to demonstrate how to use trans S_BCE_68002111 to define critical authorizations.

Steps

  1. Execute transaction S_BCE_68002111.

  2. On the initial screen, choose Critical Authorizations. In change mode, double-click the second critical authorization folder and choose the New Entries button.

  3. Enter the Authorization ID, that is, ZID_00. Also, enter text in the text column and choose a color in the color field. Leave the transaction code field empty. Save your entries.

  4. Select the entry that you just created and double-click the authorization data.

  5. Choose Continue to confirm the pop up Individual entries not added to the change request, then choose New Entries.

  6. In the GROUP column, enter A001 in the first three rows. In the GROUP column, enter A002 in the next two rows, and A003 in the next row.

  7. In the OBJECT column, enter S_TCODE in the first three rows. In the OBJECT column, enter S_DEVELOP in the next three rows.

  8. In the FIELD NAME column, enter TCD in the first three rows. In FIELD NAME column, enter objtype in the next two rows. Enter ACTVT in the next row.

  9. Enter the following values in the FROM column, one value per row: SE80, SE37, SE38, PROG, FUGR, and 02. Leave the To column blank.

  10. In the AND/OR column, enter the OR operand in all rows. Save you entries.

  11. Now, create a variant by double-clicking the folder Variants for Critical Authorizations. Choose New Entries.

  12. Enter ZVAR00 as the variant name, then enter a description. Save your entries.

  13. Assign the ID of the critical authorizations to the variant that you just created.

  14. Select the variant you just created. Now, choose the Critical Authorizations folder right below the Variants for Critical Authorizations folder. Choose New Entries.

  15. Use the input help to choose the ID ZID_00. Save your entries.

  16. On the initial screen of transaction S_BCE_68002111, choose the option for Critical Authorizations.

  17. Use the input help to select the variant ZVAR00, then choose Execute.

    Result

    The list of users with critical authorizations is displayed.

Practice System Exercise: Troubleshoot and Administer Aids

Note

If you have access to a practice system, you can now execute this exercise.

Business Example

During your daily work as an administrator, you will regularly search for special settings, authorization values, roles, and other important things. You can find these in the user information system.

Task 1: Compare the Settings of the Authorizations Between Two Users

You are authorization administrator and are in the consolidation phase after the start of production.

Steps

  1. Compare the settings of the authorizations between user GR##-ADM and user GR##-FI1.

    Are there differences?

    __________________________________________________________

    1. Navigate to the User Information System in the SAP Menu.

      SAP Menu:ToolsAdministrationUser MaintenanceInformation System

    2. Expand the structure for the Comparisons node, and select the report - Of Users by double-clicking it.

    3. Enter GR##-ADM in the User A field.

    4. Enter GR##-FI1 in the User B field.

    5. Choose Execute (F8).

    Result

    Any authorization values that are not the same are indicated by a red light. Navigate in the detail view by double-clicking and look at the different authorization values.

  2. Find out which users may execute transaction MB1C.

    1. Navigate to the User Information System in the SAP Menu.

      SAP Menu:ToolsAdministrationUser MaintenanceInformation System

    2. Expand the structure for the UserUsers by Complex Selection Criteria node, and select the report - By Authorization Values by double-clicking it.

    3. Enter S_TCODE in the Authorization Object field.

    4. Choose Input Values.

    5. Enter MB1C in the Value field.

    6. Choose Execute (F8).

    Result

    The resulting list shows the users who may execute transaction MB1C.

  3. Display all the users assigned to the role GR##_MM_MAT_ANZ.

    1. Navigate to the User Information System in the SAP Menu.

      SAP Menu:ToolsAdministrationUser MaintenanceInformation System

    2. Expand the structure for the UserUsers by Complex Selection Criteria node, and select the report - By Role by double-clicking it.

    3. Enter GR##_MM_MAT_ANZ in the Role field.

    4. Choose Execute (F8).

    Result

    The resulting list shows the users assigned to the role GR##_MM_MAT_ANZ.

  4. Display an overview of all the users you created (GR##*) with their assigned roles.

    1. Navigate to the User Information System in the SAP Menu.

      SAP Menu:ToolsAdministrationUser MaintenanceInformation System

    2. Expand the structure for the RolesRoles by Complex Selection Criteria node, and select the report - By User Assignment by double-clicking it.

    3. Enter GR##* in the User(s) field.

    4. Choose Execute (F8).

    Result

    The resulting list shows the roles that are assigned to users GR##* .

Log in to track your progress & complete quizzes