BUSINESS REQUIREMENT:
It is a very common requirement in almost all implementation where in the Stakeholders are interested to know how many user accounts are there is the system along with the corresponding roles attached to them. While oracle has delivered some seeded Reports which could be run from ‘Application Diagnostic Framework, screenshot below (Troubleshooting -> Run Diagnostic Tests)
ORACLE DELIVERED REPORTS
1) User Roles Display
2) User and Role : Role Details
3) User and Role : User Details
NAVIGATION TO RUN DELIVERED REPORTS
Login to Application -> Run Diagnostic Tests
After Running Reports :
DELIVERED REPORT 1 -> USER ROLES DISPLAY
User Roles Display: (Displays the Roles attached to procurement user)
Input Value : Sachin.Satpute
Output Screenshot :
DELIVERED REPORT 2 -> USER AND ROLE : ROLE DETAILS
User and Role : Role Details
Takes Role Name as input and displays all users who have the role attached to their user account. ( Secured i.e if the individual who is running the Report has access to a specific Data Set individuals belonging to that Data Set would only be displayed).
Input Value : Employee
Output Screenshot :
DELIVERED REPORT 3 -> USER AND ROLE : USER DETAILS
User and Role : User Details
Takes User Name as input and displays all roles attached to the user. (Secured i.e if the individual who is running the Report has access to a User Account being passed as input data would be displayed else no.)
Input value : Sachin.Satpute
Output Screenshot :
NEED FOR A CUSTOM CONSOLIDATED REPORT
But if we need a consolidated report which will list all the users along with all the roles they have neither of the delivered ones help.
So we need a Custom Report (Preferred O/P Format could be RTF, Interactive, Excel,PPT. )
Since we are planning to display a colorful report with Different colour Code Combination ( using Conditional Formatting feature we choose PPT Format for this example)
CUSTOM REPORT NAME -> USER AND ROLE DETAILS REPORT
SQL USED FOR USER AND ROLE DETAILS REPORT
select papf.person_number "PersonNumber",
ppnf_emp.full_name "PersonName",
pu_emp.user_start_date "UserAccountStartDate",
pu_emp.user_end_date "UserAccountEndDate",
pu_emp.is_user_account_active "UserAccountStatus",
pu_emp.username "UserAccountName",
pu_emp.is_user_account_suspended "IsUserAccountSuspended",
pu_emp.user_distinguished_name "UserAccountInternalName",
pur_emp.method_code "RoleProvisioningMethod",
pur_emp.is_user_role_active "IsUserRoleActive",
pur_emp.is_user_role_terminated "IsUserRoleTerminated",
Case
When (pur_emp.is_user_role_active = 'Yes' AND pur_emp.is_user_role_terminated = 'No' ) Then 'Active'
When (pur_emp.is_user_role_active = 'No' AND pur_emp.is_user_role_terminated = 'No') Then 'NeitherActiveNorTerminated'
When (pur_emp.is_user_role_active = 'Yes' AND pur_emp.is_user_role_terminated = 'Yes') Then 'ActiveAndTerminated'
When (pur_emp.is_user_role_active = 'No' AND pur_emp.is_user_role_terminated = 'Yes' ) Then 'InactiveAndNotTerminated'
End as "UserRoleStatus",
pur_emp.role_start_date "UserRoleStartDate",
pur_emp.role_end_date "UserRoleEndDate",
prd_emp.abstract_role "IsRoleAAbstractRole",
prd_emp.job_role "IsRoleAJobRole",
prd_emp.data_role "IsRoleADataRole",
prd_emp.is_role_active "IsRoleActive",
Case
When (prd_emp.abstract_role = 'Y' AND prd_emp.job_role = 'N' AND prd_emp.data_role = 'N' ) Then 'Abstract Role'
When (prd_emp.abstract_role = 'N' AND prd_emp.job_role = 'Y' AND prd_emp.data_role = 'N' ) Then 'Job Role'
When (prd_emp.abstract_role = 'N' AND prd_emp.job_role = 'N' AND prd_emp.data_role = 'Y' ) Then 'Data Role'
When (prd_emp.abstract_role is NULL AND prd_emp.job_role is NULL AND prd_emp.data_role is NULL ) Then '--NA--'
End as "UserRoleType",
prd_emp.role_common_name "RoleCommonName",
prd_emp.multitenancy_common_name "MultitenancyCommonName",
prd_emp.role_distinguished_name "IsRoleDistinguishedName",
prdt_emp.role_name "UserRoleName",
prdt_emp.RoleDescription
FROM per_all_people_f papf
JOIN
(
SELECT ppnf.full_name,
ppnf.person_id
FROM per_person_names_f ppnf
WHERE ppnf.name_type = 'GLOBAL'
AND TRUNC(SYSDATE) BETWEEN ppnf.effective_start_date AND ppnf.effective_end_date
) ppnf_emp
ON (
ppnf_emp.person_id = papf.person_id
AND TRUNC(SYSDATE) BETWEEN papf.effective_start_date AND papf.effective_end_date
)
LEFT OUTER JOIN
(
SELECT pu.person_id,
pu.user_id,
pu.username,
to_char(pu.start_date,'DD-MM-RRRR') user_start_date,
to_char(pu.end_date,'DD-MM-RRRR') user_end_date,
DECODE(pu.active_flag,'N','Inactive','Y','Active') is_user_account_active,
DECODE(pu.suspended,'N','No','Y','Yes') is_user_account_suspended,
pu.user_distinguished_name
FROM per_users pu
) pu_emp
ON(pu_emp.person_id = papf.person_id AND TRUNC(SYSDATE) BETWEEN papf.effective_start_date AND
papf.effective_end_date)
LEFT OUTER JOIN
(
SELECT pur.user_id,
pur.role_id,
pur.role_guid,
DECODE(pur.method_code,'A','Automatic','M','Manually','E','Externally Provisioned') method_code,
DECODE(pur.active_flag,'N','No','Y','Yes') is_user_role_active,
DECODE(pur.terminated_flag,'N','No','Y','Yes') is_user_role_terminated,
to_char(pur.start_date,'DD-MM-RRRR') role_start_date,
to_char(pur.end_date,'DD-MM-RRRR') role_end_date
FROM per_user_roles pur
) pur_emp
ON (pu_emp.user_id = pur_emp.user_id)
JOIN
(
SELECT prd.role_id,
prd.role_guid,
prd.abstract_role,
prd.job_role,
prd.data_role,
DECODE(prd.active_flag,'N','No','Y','Yes') is_role_active,
prd.role_common_name,
prd.multitenancy_common_name,
prd.role_distinguished_name
FROM per_roles_dn prd
) prd_emp
ON (pur_emp.role_id = prd_emp.role_id AND pur_emp.role_guid = prd_emp.role_guid)
JOIN
(
SELECT prdt.role_id, prdt.role_name,
prdt.description RoleDescription,
prdt.source_lang
FROM per_roles_dn_tl prdt
) prdt_emp
ON (prd_emp.role_id = prdt_emp.role_id AND pur_emp.role_id = prdt_emp.role_id AND prdt_emp.source_lang = 'US' )
WHERE papf.person_number = nvl(:pn_person_number, papf.person_number)
AND TRUNC (SYSDATE) BETWEEN papf.effective_start_date AND papf.effective_end_date
CONDITIONAL FORMATTING
The different colour code feature can be added using the Conditional Formatting fields
( Highlight and Manage Formats )
REPORT OUTPUT
SCHEDULING THE REPORT
Scheduling the Report :
SCHEDULED OUTPUT (PPT FORMAT)
ESS JOB CREATION
PARAMETER DEFINITION
RUNNING SCHEDULED JOB
RUNNING SCHEDULED JOB FOR ONE PERSON
Person Number : 10