Sub topic 9
Starting from SAP-delivered business role templates
This chapter assumes you know what a PFCG role is, how a business catalog groups apps, and how a business role combines catalogs with authorization values. It covers how to start a custom role from an SAP template, which parts of the template you can trust, and which parts you must check yourself.
What a business role template is
SAP delivers ready-made business roles for common job functions. Examples are SAP_BR_AP_ACCOUNTANT (accounts payable accountant), SAP_BR_PURCHASER and SAP_BR_BILLING_CLERK. In an on-premise or private cloud system these templates are PFCG roles in the SAP namespace. Each one bundles three things:
- Launchpad content. The role's menu references business catalogs, and in current releases also spaces and pages.
- Authorization data. The authorization objects and values come from the SU24 defaults of the apps in those catalogs.
- A job function scope. SAP decides which apps a typical person in that job needs. It does not know your organization.
The last point is why a template is a starting point and not a finished role. SAP cannot know your company codes, plants or sales organizations. It also does not know which of your people may approve and which may only display.
Why you copy instead of editing or building from scratch
Two choices look attractive and both are wrong most of the time.
| Approach | Problem |
|---|---|
| Assign the SAP template directly | Organizational levels are open or incomplete, and the role often grants more apps than one job needs. |
| Edit the SAP template in place | SAP delivers the role again in upgrades and support packages, so your changes can be overwritten or can conflict. |
| Build a role from scratch | You must pick catalogs, find the right services and maintain every authorization object yourself. This is slow and error-prone. |
| Copy the template into the customer namespace | You keep SAP's app selection and defaults, and you own every change. This is the recommended path. |
Your copy lives in the customer namespace, usually Z* or Y*, for example ZBR_AP_ACCOUNTANT. SAP never overwrites it. The cost is that you now maintain the differences between your copy and later SAP versions.
The working model
Each step has a typical failure, covered below.
Step 1: Find the right template
Search in the SAP Fiori apps reference library, which lists business role templates with their catalogs and apps. You can also list the templates installed in your own system. The report below reads the role header table AGR_DEFINE. The # is the escape character, so the underscores in the pattern match literally and not as single-character wildcards.
REPORT zlist_br_templates.
SELECT agr_name
FROM agr_define
WHERE agr_name LIKE 'SAP#_BR#_%' ESCAPE '#'
ORDER BY agr_name
INTO TABLE @DATA(lt_roles).
cl_demo_output=>display( lt_roles ).Compare the list with what the reference library says for your release. Templates change between releases. A role that exists in one release may be split or renamed in the next.
Step 2: Copy the role
In transaction PFCG, enter the template name, choose the copy function and give the target a customer-namespace name. Decide on a naming convention before the first copy. Many teams use a prefix plus the template name, such as ZBR_ followed by the job function, so that origin and purpose are visible in role lists.
When you copy, the target role receives the menu and the authorization data. It does not receive a link back to the original. If SAP later improves the template, nothing flows into your copy automatically. You compare the two roles yourself, and the SU25 upgrade steps help with changed SU24 defaults.
A copy also does not carry over the user assignments. The copy starts empty, which is what you want.
Step 3: Review the menu
Open the Menu tab. Check each of these:
- Every business catalog and group it references. Remove anything outside the job function.
- Whether the role references spaces and pages. If your launchpad uses spaces, check that the ones in your copy match the layout you want users to see.
- Whether the role contains apps that call services you have not activated. Missing service activation shows up later as an app that opens but fails to load data.
Removing a catalog is safe from a security view, because removing menu entries removes the matching default authorizations at the next adjustment. Adding a catalog from another job function is how roles drift into segregation-of-duties conflicts. Treat each added catalog as a design decision and record why you added it.
Step 4: Review the authorization data
Open the Authorizations tab. You will see authorization objects grouped by status. The important distinctions:
- Objects with the status Standard or Maintained come from SU24 defaults or from earlier edits.
- Objects with the status Changed or Manual differ from the default proposal. In a copied template, these are the edits SAP made on purpose, so keep them unless you understand them.
- Fields that show an empty value or a warning triangle need input before the profile can be generated.
Common template adjustments:
- Change an activity list. For example, remove activity
02(change) from a role that should only display. - Add an authorization object that SU24 does not propose because your custom code performs its own
AUTHORITY-CHECK. - Restrict a field such as a document type or account group.
After any menu change, run the authorization adjustment (the function that merges SU24 proposals into the role). Do not merge blindly. Read what changes, because new proposals may add objects with wide values such as *.
Step 5: Fill in organizational values
Organizational level fields, such as company code (BUKRS), plant (WERKS) or sales organization (VKORG), are shared across many objects in the role. PFCG offers one place to set them: the organizational levels function. A value maintained there is written to every object that uses the field, which is why you maintain it here and not object by object.
A template usually leaves these fields open or empty. Leaving them open grants access to every organizational unit, which is almost never intended. The next chapter covers restrictions in depth. For now, treat an unmaintained organizational level as an unfinished role.
Step 6: Generate the profile and test
Save the role, then generate the profile on the Authorizations tab. Until the profile exists and the user comparison has run for assigned users, the role grants nothing. Assign the role to a test user only, log on as that user and check three things:
- The launchpad shows the expected tiles and no others.
- Each app opens, reads data and performs its main action without an authorization error.
- A forbidden action, such as posting to a company code outside your restriction, is rejected.
The third test is the one teams skip. A role that works is not necessarily a role that blocks.
Common errors
- Editing the SAP template. The change is lost or collides at upgrade. Always copy first.
- Assuming a copy stays in sync. It does not. Schedule a comparison with the SAP template after each release upgrade.
- Skipping the profile generation. The role looks complete in PFCG but the user sees no new tiles or gets authorization errors.
- Adding catalogs without checking segregation of duties. A template covers one job function. A copy with catalogs from two functions may let one person both create and approve.
- Leaving organizational levels open. The user has access to every organizational unit.
- Copying the wrong template. Names are similar, such as accountant versus manager roles. Read the app list, not only the name.
Keeping the copy maintainable
Write down what you changed relative to the template: removed catalogs, added catalogs, changed activities and the organizational values you set. A short note on the role's description tab is enough. Without it, the next person cannot tell a deliberate change from a mistake, and an upgrade comparison takes far longer.
If you need the same job function for several organizations, a single copy with fixed organizational values will not scale. Plan for a master role with derived roles that differ only in organizational values, as the chapter on custom role design explains.
Exercise
Your team assigns the SAP-delivered template SAPBRPURCHASER directly to buyers, and after a support package upgrade some buyers can see new apps they did not have before. Name the cause and give the corrective approach.
Show answer
SAP delivers updated versions of its templates in upgrades and support packages, so a directly assigned template changes under you. The fix is to copy the template to a customer-namespace role such as ZBR_PURCHASER, set the organizational levels, generate the profile and assign the copy to buyers instead. After each upgrade, compare your copy with the new SAP version and take over only the changes you want.
Exercise
You copied a template and the test user can open every app, but can also post in company codes outside the user's own. Which step did you probably skip, and where do you fix it?
Show answer
You did not maintain the organizational values for company code (BUKRS). Open the copied role in PFCG, use the organizational levels function on the Authorizations tab to set the allowed company codes, regenerate the profile and retest with the test user.