Sub topic 13
Designing and maintaining custom roles
This chapter covers how to design custom business roles and business catalogs, and how to keep them maintainable over time. It assumes you know what a business catalog, a business role and an authorization object are. It also assumes you have seen PFCG, SU24 and the SAP-delivered role templates from earlier chapters, and that you can assign a role to a business user.
Why custom roles exist
SAP delivers business role templates and business catalogs. They are written for a typical job function, such as an accounts payable accountant. Real organizations rarely match that function exactly. You may need to:
- remove apps that a job function should not open,
- add apps from a second catalog,
- narrow authorization values to your own organizational structure,
- split one broad SAP role into several smaller ones.
You do not edit SAP-delivered objects. You copy them into the customer namespace (names starting with Z or Y) and change the copy. Copying keeps the original available for comparison and keeps your changes safe when SAP delivers updates.
Design principles
Good custom roles share a few properties.
- One role per job function. A role describes what a person in a position does. It should not describe a person.
- Small catalogs, composed in roles. A catalog groups apps that belong together. A role combines catalogs. Avoid one catalog that holds everything a department might use.
- Separate display from change. Put display apps and change apps in different catalogs. Then you can give an auditor the display catalog without granting change access.
- Keep organizational values out of the role design. Use restrictions so one role serves many company codes or plants.
- Name for meaning. A name such as
ZBR_AP_ACCOUNTANT_EUtells you more thanZROLE_017.
A naming convention
Pick a convention before you create the first object, and write it down. The table shows one example.
| Object | Pattern | Example |
|---|---|---|
| Business role | `ZBR_<function>_<scope>` | `ZBR_AP_ACCOUNTANT_EU` |
| Business catalog | `Z_BC_<area>_<activity>` | `Z_BC_AP_PROCESS` |
| Space | `Z_SP_<function>` | `Z_SP_AP` |
| Page | `Z_PG_<function>` | `Z_PG_AP` |
The exact patterns matter less than using them consistently. A consistent pattern lets you search by prefix and find every object for one area.
The custom role lifecycle
A custom role is not finished when you save it. It moves through a cycle.
Step 1: Collect the requirement
Ask the process owner which tasks the job function performs. Ask which tasks it must never perform. The second list is as important as the first, because it feeds segregation of duties checks later.
Step 2: Copy the SAP template
Start from the closest SAP-delivered business role template. Copy it with a new name in your namespace. The copy contains the catalogs and the restriction types that SAP considers typical. This is faster than building from nothing, and the copy already has working authorization defaults.
Step 3: Adjust catalogs and restrictions
Review each catalog in the copy. Remove catalogs that the function does not need. Add custom catalogs for apps that SAP did not include. Then set the restrictions for the organizational values, for example company codes or sales organizations, as covered in the earlier chapter on restrictions.
A catalog is only useful if its apps carry sensible authorization defaults. For apps that run on classic authorization objects, the defaults come from SU24. If you add a custom app, maintain its SU24 entries, or the role will open the app but fail on the first data check.
Step 4: Test with a test user
Create a dedicated test user and assign only the new role. Do not test with your own administrator user, because broad authorizations hide errors. Open each app and perform the key actions. If something fails, use SU53 or the trace, as described in the troubleshooting chapter.
Step 5: Transport and assign
Move the role through your transport landscape to the production system. Do not create or change roles directly in production. Direct changes bypass review and cannot be reproduced in the next system copy.
Step 6: Review periodically
Roles drift. Apps are added for one urgent request and never removed. Schedule a review, for example once or twice a year, and compare each role with what its users actually need.
Maintaining roles after SAP updates
SAP updates its delivered catalogs and templates with each release. When you copy a template, your copy does not follow those changes automatically. After an upgrade, check three things.
- New apps in the original catalog. Compare the SAP catalog with your copy. Decide whether to add the new apps.
- Changed or removed apps. An app that SAP replaced with a successor may disappear from the original catalog but stay in your copy. Users then open an outdated app.
- Changed SU24 defaults. If SAP adds a check to an app, your role may need new authorization values. The symptom is a user who could use an app before the upgrade and now gets an authorization error.
For PFCG-based authorization data, the SU25 transaction compares the new SU24 defaults with your existing roles. Run it after an upgrade, and then follow the adjustment steps for your roles.
Reference or copy
For a catalog you have two choices.
| Approach | Advantage | Risk |
|---|---|---|
| Reference SAP catalogs directly in your role | Receives SAP changes without extra work | Changes arrive unreviewed, and you cannot remove single apps |
| Copy the catalog into a custom catalog | You control exactly which apps it contains | You must compare with SAP after each update |
Referencing suits catalogs you want to use as delivered. Copying suits catalogs where you need to remove or add apps. Many projects reference for read-only roles and copy for sensitive ones.
Common design errors
- Copying one role for every user. This produces hundreds of nearly identical roles. Use restrictions to vary organizational values instead.
- Editing the generated profile. The profile is generated from the authorization data. Manual changes disappear on the next generation. Change the role instead.
- Granting wildcards to make a role work. A value of
*in an authorization field can silence an error and open far too much access. Find the missing value with SU53 and add only that. - No owner. A role without a named owner is never reviewed. Record an owner and a review date.
- Mixing creation and approval. A single role that lets a user both create and release a payment breaks segregation of duties. Split such a role in two.
Documenting a role
Keep a short record for each custom role. Store it where your team already works, such as a wiki page or the role description field. A useful record contains:
- the business purpose,
- the SAP template it was copied from,
- the catalogs it uses,
- the restriction types and who maintains their values,
- the owner and the date of the last review,
- known exceptions.
When an auditor asks why a user can post a document, this record answers the question quickly.
A review checklist
Use this list when you review a custom role, either at creation or in the periodic review.
- Does the name follow the convention?
- Does the role have an owner and a description?
- Is every catalog in the role still needed?
- Do any authorization fields contain
*without a documented reason? - Are restrictions set, and are their values current?
- Does the role combine activities that should be separated?
- Is the role assigned to at least one active user?
- Has the role been compared with SAP changes since the last upgrade?
Exercise
A project copies the SAP role template for accounts payable and changes it directly in the production system to fix an urgent problem. Name two problems this creates and what the team should do instead.
Show answer
The change bypasses review and testing, and it is not reproduced in the development or quality systems, so the next transport or system copy can overwrite or lose it. The team should make the change in development, test it with a dedicated test user, and transport it through the landscape.
Exercise
After an upgrade, users of a custom copy of a SAP catalog report an authorization error in an app that worked before. The original SAP catalog has not changed the app. What is the most likely cause and where do you check first?
Show answer
SAP most likely changed the SU24 defaults for the app, adding an authorization check that the role does not yet contain. Check with SU53 for the failed check, then compare the role against the updated SU24 defaults, for example by running SU25 and adjusting the role in PFCG.
Exercise
Your company has twelve plants and needs one role for each plant's warehouse clerk. How do you keep the number of roles small?
Show answer
Create one role for the warehouse clerk function and use restrictions for the plant value. Each user then gets the same role with a different plant value, or the plant values are maintained per assignment, so you do not copy the role twelve times.