Lesson 1 of 6
Why role testing is separate
8 min
Listen to this lesson
Most SAP functional testing is done with users that have broad access. Testers need to get through a scenario without stopping for every missing authorization, so they often run with wide test roles or even a copy of a superuser profile. That is a sensible way to test whether the process works. It says nothing about whether the people who will run the process in production can do it.
Role testing closes that gap. It answers two questions for each business role: can a user with exactly this role do every step of their job (a positive test), and are they stopped from doing what they should not (a negative test)? These are different questions from "does the process work", so they need their own test cases, test users and evidence.
What an authorization check actually checks
In SAP S/4HANA's ABAP stack, access is granted through roles maintained in the role maintenance transaction PFCG. A role generates an authorization profile containing authorization objects, each with fields and permitted values. When a program runs, it checks objects such as the sales document type and activity, the sales organization, the purchasing organization or the company code. Activity values distinguish create (01), change (02) and display (03). If the user's profiles do not contain a matching value, the check fails.
For SAP Fiori apps, the same backend checks apply, plus two more layers in front of them: the app must be in a business catalog assigned to the user's role so the tile appears, and the user must be allowed to call the app's OData service. A user can therefore see a tile and still fail when the app loads data, or have all backend authorizations and never see the tile. In SAP S/4HANA Cloud Public Edition, roles are built from business role templates and business catalogs in the Maintain Business Roles app, with restrictions for read and write access, but the testing questions are the same.
Go-live symptoms of untested roles
- On day one, warehouse staff in Chicago cannot post goods issue because their role has plant 1710 but not 1720.
- Accounts payable clerks see the Manage Supplier Invoices tile but get an error when the list loads.
- A buyer can approve her own purchase orders because a role change copied an approval authorization.
- The service desk is flooded with access tickets, and emergency access is handed out widely, which auditors later flag.
Each of these is a defect that broad-access functional testing cannot see. They are also expensive in production: emergency fixes to roles are rushed, poorly tested, and tend to grant too much.
Where role testing fits in the plan
On Contoso's program, Priya schedules role work in three places. Security unit-tests each role as it is built. A dedicated role test cycle runs after integration testing, using test users with the planned production assignments. User acceptance testing then runs with those same users, so key users like Maria experience the system exactly as they will on day one. Each step finds different defects, and skipping the dedicated cycle pushes all of them into UAT, where they block business testers who have limited time.
- BuildSecurity unit testEach role is checked as it is built: it generates, and its core transactions and apps start.
- Integration testProcess testing with broad accessProves the processes work end to end; says nothing about roles.
- After integrationDedicated role test cyclePositive and negative tests with test users holding the planned production assignments.
- UATBusiness testing with real rolesKey users such as Maria work exactly as they will on day one.
What would you do?
Contoso's integration test cycle passed with all testers using a broad test role. Grace, the PMO lead, asks whether the business roles are ready for go-live. What is the most accurate answer from Priya, the test lead?
- Functional tests with broad access prove processes, not roles.
- Role tests ask two questions: can the user do their job, and are they stopped from what they should not do?
- Access passes through launchpad visibility, start authorization, object and activity checks, and org-level checks.
- Untested roles cause day-one access failures and over-granted emergency fixes.
Check your understanding · not graded
Lesson check
1. Why do functional tests run with broad access miss authorization defects?
2. Which activity value commonly means display in an authorization object?
3. A user sees a Fiori tile but the app fails when loading data. Which layer is the likely problem?
4. Which transaction is used to maintain roles in the ABAP stack?