Sub topic 1
Who needs access: business users and their identity
Prerequisites
This chapter assumes the following:
- You know SAP S/4HANA at a user level and can open apps in the SAP Fiori launchpad.
- You understand what a user ID and a logon are in an SAP system.
- You have a rough idea of a business process such as procure-to-pay or order-to-cash, so that "a buyer" or "an accounts payable clerk" means something to you.
- For the code example, you can run a small ABAP report in a development system.
You don't need to know authorization objects or PFCG yet. The next chapters cover them.
Why identity comes first
Every access decision in S/4HANA starts with the question "who is asking?". Business roles, business catalogs and authorization objects have no effect until they are attached to an identity. A role that nobody holds opens no app and releases no data.
The rest of this tutorial builds the chain below. This chapter covers its first link.
- A person works in a job function.
- The person has an identity in the system, the business user.
- The identity holds business roles.
- Each role gives launchpad content (through catalogs) and authorization values.
If the first link is wrong, the later links cannot compensate. A user created with a mistyped ID, a missing person record or a wrong user type will fail in ways that look like authorization problems but are not.
What a business user is
A business user is a person who works in the system on business tasks: a buyer, a sales clerk, an accountant or a manager approving requests. The term separates this person from a technical user. A technical user is an account that a program or an interface uses, and it has no human behind it.
In current S/4HANA releases a business user is not a single table row. It is a set of linked records that together describe one person:
- A business partner of the category "person". The business partner holds the person's name, address, e-mail and organizational data. It is the master record of the human.
- A user (the logon account). It holds the user ID, the password or single sign-on settings, the validity period, the user type and the roles.
- Optionally an employee or worker link. This connects the identity to a personnel number or to a work agreement, so that applications can find "the employee behind this user".
The user ID answers "who logs on?". The business partner answers "who is this person?". Many apps need the second answer. A workflow that routes an approval to a manager looks up the person and their relationships, not only a user name.
Because the person record is separate from the logon account, one person can hold more than one account, for example a dialog account and a test account in a sandbox. All accounts then point to the same person.
Where you maintain business users
You maintain business users in the Fiori app Maintain Business Users. In on-premise systems you can also use the classic transaction SU01 for the user account and transaction BP for the business partner. The app creates and edits both records in one step. This is the main reason to prefer it: it avoids a user account with no person behind it.
The app lets you set the person's data, the logon data (user ID, validity, lock status), and the assignment of business roles. The role assignment is covered in a later chapter.
The parts of an identity
| Part | Question it answers | Typical content |
|---|---|---|
| User ID | Who logs on? | Unique name such as `JSMITH` |
| Business partner | Who is the person? | Name, e-mail, language, address |
| Logon data | How and when may this person log on? | Password or SSO, valid-from and valid-to dates, lock status |
| User type | What kind of account is this? | Dialog, system, communication, service, reference |
| Roles | What may the person do? | Business roles and generated PFCG roles |
| Employee link | Which worker is this? | Personnel number or work agreement |
The first five rows are required for a working account. The employee link is optional unless an application, such as time recording or approval workflow, needs it.
User types
The user type decides how an account may log on and what it is for. Choosing the wrong type is one of the most common identity errors.
| User type | Typical use | Interactive logon |
|---|---|---|
| Dialog | A person working in the launchpad or SAP GUI | Yes |
| System | Background jobs and internal system processes | No |
| Communication | Calls from external systems through interfaces | No |
| Service | Anonymous or shared access, tightly controlled | Yes, without personal accountability |
| Reference | Holds roles that other users inherit, no logon | No |
Business users are dialog users. Do not give a person a service account to avoid maintaining roles. Actions done under a shared service account cannot be traced to one person, which breaks audit requirements. Use a technical user for interfaces, never a dialog user, because a dialog user's password may expire and stop the integration.
How the pieces fit together
The diagram shows why identity sits at the start. The roles attach to the user account. Everything the person later sees or does is derived from them.
Looking at an identity in the system
You can read a user's logon data and assigned roles with a function module. The following report reads one user and prints the user type, the validity and the assigned roles. The function module is BAPI_USER_GET_DETAIL. Your own user needs display authorization for user master data (object S_USER_GRP) to read other users.
REPORT zdemo_user_info.
PARAMETERS p_user TYPE xubname DEFAULT sy-uname.
DATA: ls_logondata TYPE bapilogond,
ls_address TYPE bapiaddr3,
lt_roles TYPE STANDARD TABLE OF bapiagr,
lt_return TYPE STANDARD TABLE OF bapiret2,
ls_role TYPE bapiagr,
ls_return TYPE bapiret2.
CALL FUNCTION 'BAPI_USER_GET_DETAIL'
EXPORTING
username = p_user
IMPORTING
logondata = ls_logondata
address = ls_address
TABLES
activitygroups = lt_roles
return = lt_return.
LOOP AT lt_return INTO ls_return WHERE type CA 'EA'.
WRITE: / 'Error:', ls_return-message.
RETURN.
ENDLOOP.
WRITE: / 'User: ', p_user,
/ 'Name: ', ls_address-fullname,
/ 'User type: ', ls_logondata-ustyp,
/ 'Valid from:', ls_logondata-gltgv,
/ 'Valid to: ', ls_logondata-gltgb.
SKIP.
WRITE / 'Assigned roles:'.
LOOP AT lt_roles INTO ls_role.
WRITE: / ls_role-agr_name, ls_role-from_dat, ls_role-to_dat.
ENDLOOP.The user type field USTYP holds a one-letter code: A for dialog, B for system, C for communication, S for service and L for reference. The role table lists the PFCG roles that the user holds. For a business role these are the generated roles behind it, which later chapters explain.
Lifecycle of an identity
An identity changes over time, and access has to follow it.
- Joiner. Create the business user, set the validity start, and assign the business roles for the job function.
- Mover. When a person changes department, replace the old roles instead of adding to them. Roles that stay behind accumulate into excessive access.
- Leaver. Set the validity end date and lock the account. Do not delete the user right away. Documents and change logs refer to the user ID, and deleting it makes them harder to read in an audit.
Role assignments carry their own validity dates, so a temporary substitute can receive a role for two weeks and lose it automatically.
Common errors
- User exists, but no person record. The account was created in
SU01only. Apps that need the business partner, such as approval workflows, then fail or show no name. - Wrong user type. An interface runs under a dialog user and stops when the password expires. Or a person receives a communication user and cannot log on.
- Validity dates in the past or future. A new user cannot log on because the valid-from date is tomorrow. Check the dates before looking at roles.
- Locked account. Repeated wrong passwords lock the user. The roles are fine, and no authorization analysis will find a cause.
- Sharing accounts. Two people on one user ID make every audit log useless and violate most access policies.
- Duplicate persons. Two business partners for one human lead to two sets of workflow data. Search before you create.
When a user reports "I have no access", check these identity points first. They take a minute and rule out the cause before you analyze roles and authorization objects.
Exercise
A colleague says a new employee "has no authorizations" because the launchpad rejects the logon. The business roles were assigned correctly in Maintain Business Users. Name three identity-level checks you would make before analyzing authorization objects, and explain why a role problem does not fit the symptom.
Show answer
Check (1) that the account's valid-from date has already started and the valid-to date has not passed, (2) that the account is not locked, and (3) that the user type is dialog, not system, communication or reference. Other acceptable checks are the password or single sign-on setup and whether the user ID matches the one the person enters. A role problem does not fit the symptom because authorizations are checked after logon. A missing authorization lets the user in and then hides apps or denies actions. A rejected logon happens earlier, at the identity level.