Sub topic 3
Restricting Roles by Organizational Values
Assume you know SAP S/4HANA, the Fiori launchpad, user logon, and basic ERP processes. This chapter focuses on how a business role controls both access and scope.
Restricting roles by organizational values
A restriction limits a role to specific organizational values, such as company codes, plants, or sales organizations. For example, a buyer may use the same purchasing apps as other buyers but only for company code 1010.
| Layer | Example | Purpose |
|---|---|---|
| Business role | Purchasing specialist | Groups catalogs and authorizations |
| Authorization object | Company-code purchasing object | Defines the protected operation |
| Organizational value | Company code `1010` | Limits the user's data scope |
Restrictions should match the user's responsibilities. Broad values such as all company codes can expose data or permit actions beyond the user's job.
Assigning roles and diagnosing failures
Assign the business role to the user's business identity in the administration tools used by the S/4HANA deployment. The assignment grants the role's catalogs, app access, and authorization values. After changing a role, regenerate its profile where required and have the user start a new session.
If an app opens but an operation fails, reproduce the action and run transaction SU53 immediately. SU53 displays the most recent failed authorization check. If it does not identify the cause, use the system trace, commonly transaction ST01 or the security audit log, to capture the authorization object and field values checked.
Custom roles and code-level checks
Start a custom role by copying an SAP-delivered business role template. Remove unneeded catalogs, adjust restrictions, test the result, and document ownership. Review custom roles after upgrades because apps and authorization proposals can change.
ABAP can enforce the same authorization model directly:
AUTHORITY-CHECK OBJECT 'F_BKPF_BUK'
ID 'BUKRS' FIELD lv_company_code
ID 'ACTVT' FIELD '03'.
IF sy-subrc <> 0.
MESSAGE e000(00) WITH 'No authorization for company code' lv_company_code.
ENDIF.A CDS access control filters data during a read:
@MappingRole: true
define role ZI_SalesOrderAC {
grant select on ZI_SalesOrder
where ( SalesOrganization ) =
aspect pfcg_auth( V_VBAK_VKO, VKORG, ACTVT = '03' );
}Segregation of duties
Segregation of duties prevents one user from controlling conflicting steps, such as creating a supplier and approving its payment. Review role combinations during assignment and periodically afterward. Record exceptions, approvers, and expiry dates.
Exercise
A user can open a sales-order app but sees no data for sales organization 1000. What should you check first?
Show answer
Check the role's restriction for the relevant sales-organization authorization object, then reproduce the read and inspect SU53 or the system trace.