Sub topic 12
Finding missing authorizations with SU53 and the trace
Prerequisites
This chapter assumes you know what an authorization object, a field and an activity are. It also assumes you know that a business role combines business catalogs with authorization values, and that a business user receives roles through assignment. If any of that is unclear, review the earlier chapters on authorization objects, PFCG roles, business catalogs and role assignment first.
Why missing authorizations are hard to see
A user who lacks an authorization rarely gets a clear explanation. The launchpad may show no tile, an app may open and display an empty list, or a generic message such as "You are not authorized" may appear. Each symptom has a different cause. Before you open any tool, decide which layer is failing.
| Symptom | Likely layer | First tool |
|---|---|---|
| Tile is not on the launchpad | Catalog or role assignment, or the space is not in the role | Role and assignment check |
| Tile is visible, app shows an authorization error | Authorization object check in the backend | SU53 |
| App opens but a list is empty or shorter than expected | CDS access control or organizational restriction | Trace, then role values |
| OData call fails with 403 or 401 | Service not started or not authorized | Service start authorization, trace |
| Works for you, fails for the user | Different roles or different values | Compare with the user's own session |
The key point is that two separate checks protect an app. The first checks whether the user may start the app and its services. The second checks the authorization objects the app evaluates while it runs. A catalog supplies the first. The role's authorization data supplies the second.
Step 1: Confirm the basics
Many tickets end here, so check these before you trace anything.
- The business user exists, is not locked, and its validity dates cover today.
- The business role is assigned to the user, and the assignment's validity dates cover today.
- The role contains the business catalog that holds the app.
- The role has been generated, so its authorization profile is active. In a role that was changed but not regenerated, the new values do not take effect.
- The role's space and page contain the app, if the user is expected to find the tile there.
Step 2: Use SU53 for the last failed check
Transaction SU53 displays the result of the last failed authorization check for the user who runs it. It shows the authorization object, the field values the program asked for, and the values the user actually holds.
The most common mistake is running SU53 yourself. SU53 only shows your own last failure. The affected user must reproduce the error and run SU53 right afterward, in the same session, or send you a screenshot. Administrators can also display another user's data with SU53 by entering the user name, if they have the authorization to do so. Evaluate whether the data is still fresh. Any other failed check made after the one you care about replaces it.
When you read the SU53 screen, look at three things:
- The object name, for example
F_BKPF_BUK. - The values required. For example
BUKRS=1010andACTVT=03. - The values the user holds, shown beside them. A missing field value appears with the requested value and no matching entry.
From there you decide the fix. If the object is missing entirely, the role lacks it, so the app's SU24 defaults or the role's authorization data need review. If the object is present but the value is wrong, the restriction is the problem, such as an organizational value that does not include company code 1010.
What SU53 cannot tell you
- It records only failed checks made in the backend by the
AUTHORITY-CHECKstatement. A missing catalog or service authorization may not appear. - It does not show failures from CDS access controls in the same form. A user who is filtered out by a CDS access control receives fewer rows and no error, so no failed check is recorded.
- It shows only one check, the last one. An app can perform many checks, and the first failure may not be the one shown.
- A check that fails but is handled quietly by the program, such as a check made only to decide whether to hide a button, still records a failure and can mislead you.
Step 3: Use the authorization trace for the full picture
When SU53 is not enough, use the system trace for authorization checks, transaction ST01, or the newer trace in transaction STAUTHTRACE. The trace records every authorization check during a time window, including checks that passed. This lets you see the entire sequence for an app instead of one failure.
A typical procedure follows.
- Start the trace for the affected user name. Trace the user who has the problem, not your own user.
- Ask the user to reproduce the problem once.
- Stop the trace.
- Display the result and filter by return code. A return code other than 0 means the check failed.
- Read each failed entry: the object, the fields and values requested, and the return code.
- Compare the list of failed objects against what the app should need.
Keep the trace window short. A trace that runs for a long time on a busy system produces large volumes and adds load. Start it just before the user acts and stop it right after.
Reading return codes
The return code of an authority check explains how it failed. The following are the values you meet most often.
| sy-subrc | Meaning |
|---|---|
| 0 | The user has the authorization. |
| 4 | The user has the object but not the requested values. |
| 12 | The user has no authorization for the object at all. |
| 24 | A field in the check was not filled correctly in the call. |
Return code 4 points to restrictions in the role. Return code 12 points to a missing object, so the role needs the object added, ideally through the app's SU24 default values. The ABAP statement from the earlier chapters shows how a program sees the same result.
AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
ID 'BUKRS' FIELD lv_company_code
ID 'ACTVT' FIELD '03'.
IF sy-subrc <> 0.
" The user has no display authorization for this company code.
MESSAGE e000(00) WITH 'No authorization for company code' lv_company_code.
ENDIF.If this check returns 4 for company code 1010, the user holds F_BKPF_BUK but not for that company code. The trace shows the same value, so you can read the exact request.
Step 4: Decide where the fix belongs
Once you know the failed object and values, decide where the change belongs. Do not just add the object to the user's role by hand.
- If the object is missing because the app's SU24 default was never applied, update the role's authorization data from the app defaults and regenerate it. The earlier chapter on app authorizations explains how SU24 provides these defaults.
- If the value is wrong, change the organizational restriction in the role or the assigned restriction, not the object itself.
- If many users with the same function fail in the same way, the cause is the shared role or catalog. Fix it once there.
- If only one user fails, check for a missing assignment or an expired validity date before editing a role.
- If the problem is a CDS access control, check the authorization object named in the access control and the values the user holds for it. The access control uses the same PFCG concept, so a role fix applies.
The following diagram shows the decision path.
Common errors in troubleshooting
- Testing with your own user. Your roles differ from the user's, so a test that works for you proves nothing. Reproduce the problem with the affected user, or trace that user.
- Granting SAP_ALL as a test. It hides the problem, adds a security risk, and teaches you nothing about the missing object. Use a trace instead.
- Forgetting to regenerate. A changed role does not give the user new rights until the profile is generated and the user comparison has run.
- Using wildcards to fix a symptom. Setting a field to
*removes the failure but gives access to every value, and may break segregation of duties. - Ignoring the activity field. A user who has
ACTVT03 can display but not change. A failed check on activity 02 means the role needs a change authorization, which may be intentionally withheld. - Missing the service layer. A Fiori app fails with an error even though every authorization object passes if the OData service is not authorized to start. Look for service authorization entries in the trace.
Putting it together
Work from the cheap check to the expensive one. Confirm the user, assignment, catalog and generation. Use SU53 for a single failed check. Use the trace when SU53 shows nothing or when several objects may be missing. Then fix the cause at the level where it lives, which is usually the role, its restriction or the catalog, and not the individual user.
Exercise
A user reports that the Manage Journal Entries app opens but shows no entries for company code 1010. SU53 shows no failed check. The user's colleague sees entries for the same company code. What is the most likely cause, and how do you confirm it?
Show answer
The most likely cause is a CDS access control or an organizational restriction that filters the data, because filtered rows produce no error and so no failed check appears in SU53. Run the authorization trace for the affected user, reproduce the call, and look at the checks for the object named in the access control. Compare the values the user holds, such as the company code field, with those of the colleague. If the value 1010 is missing from the user's restriction, add it in the role's organizational values and regenerate, or assign a role that carries it.
Exercise
An authorization trace shows a failed check on object FBKPFBUK with return code 12. What does this tell you, and what is the preferred fix?
Show answer
Return code 12 means the user has no authorization for the object at all. The preferred fix is to confirm that the app's SU24 default values include the object, update the role's authorization data from those defaults, supply the organizational values, and regenerate the role. Adding the object to the individual user is not preferred.