P_UserRoles

DDL: P_USERROLES Type: view_entity Package: SUSR

User role assignments

P_UserRoles is a CDS View that provides data about "User role assignments" in SAP S/4HANA. It reads from 3 data sources (agr_define, P_USR02, agr_users) and exposes 6 fields with key fields agr_name, uname, from_dat, to_dat. Part of development package SUSR.

Data Sources (3)

SourceAliasJoin Type
agr_define RoleExistence left_outer
P_USR02 UserExistence inner
agr_users UserRoles from

Annotations (7)

NameValueLevelField
AbapCatalog.extensibility.extensible false view
AccessControl.authorizationCheck #CHECK view
EndUserText.label User role assignments view
ObjectModel.usageType.serviceQuality #X view
ObjectModel.usageType.sizeCategory #XL view
ObjectModel.usageType.dataClass #MIXED view
Metadata.allowExtensions false view

Fields (6)

KeyFieldSource TableSource FieldDescription
KEY agr_name agr_users agr_name Role
KEY uname agr_users uname User Name
KEY from_dat agr_users from_dat Start date
KEY to_dat agr_users to_dat End date
col_flagXthenCelseendasorg_flag
class P_USR02 class User Group

Derived SQL interpretation, reconstructed from the parsed view metadata (data sources, associations, and field mappings). SAP annotations are omitted and the structure is reformulated as SQL — this is a functional approximation, not the verbatim SAP source.

-- Derived SQL interpretation of CDS view P_UserRoles.
-- Reconstructed from parsed metadata (data sources, associations, fields).
-- SAP annotations are omitted and the structure is reformulated as SQL;
-- this is a functional approximation, not the verbatim SAP source. Some join
-- conditions may be unavailable and a few CDS constructs are kept as-is.

CREATE VIEW P_UserRoles AS
SELECT
  UserRoles.agr_name AS agr_name,
  UserRoles.uname AS uname,
  UserRoles.from_dat AS from_dat,
  UserRoles.to_dat AS to_dat,
  case when UserRoles.org_flag = 'X' then 'X' when UserRoles.col_flag = 'X' then 'C' else '' end as org_flag AS col_flagXthenCelseendasorg_flag,
  UserExistence.class AS class
FROM agr_users AS UserRoles
LEFT OUTER JOIN agr_define AS RoleExistence ON /* join condition not captured in parsed metadata */
INNER JOIN P_USR02 AS UserExistence ON /* join condition not captured in parsed metadata */
;