Users and Responsibilites in Oracle EBS

1.1 根据用户名查用户所具有的职责

SELECT  FU.USER_ID,
FU.USER_NAME ,
FU.DESCRIPTION ,
--FU.ENCRYPTED_FOUNDATION_PASSWORD,
--FU.ENCRYPTED_USER_PASSWORD,
FUR.RESPONSIBILITY_ID  ,
FRE.RESPONSIBILITY_NAME
FROM  FND_USER FU,
FND_USER_RESP_GROUPS_DIRECT FUR  ,
FND_RESPONSIBILITY_TL FRE
WHERE  FU.USER_ID = FUR.USER_ID
AND  FUR.RESPONSIBILITY_ID = FRE.RESPONSIBILITY_ID
AND  USER_NAME= 'TIANPAN'

1.2 通过User,查找此用户挂的所有职责(Responsibilities)
SELECT   FU.USER_ID  ,
       FU.USER_NAME          USER_NAME  ,
       FR.RESPONSIBILITY_KEY RESPONSIBILITY  ,
       FRT.Responsibility_Name  ,
       FA.APPLICATION_NAME   APPLICATION
   FROM  FND_USER             FU  ,
       FND_USER_RESP_GROUPS FG  ,
       FND_APPLICATION_TL   FA  ,
       FND_RESPONSIBILITY   FR  ,
       FND_RESPONSIBILITY_TL FRT
   WHERE  FG.USER_ID  (+) = FU.USER_ID
    AND  FG.RESPONSIBILITY_APPLICATION_ID  =  FA.APPLICATION_ID
    AND  FA.APPLICATION_ID  =  FR.APPLICATION_ID
    AND  FG.RESPONSIBILITY_ID  =  FR.RESPONSIBILITY_ID
    AND  FR.APPLICATION_ID  =  FRT.Application_Id
    AND  FR.Responsibility_Id  =  FRT.Responsibility_Id
    AND  FU.USER_NAME  LIKE   UPPER  ( '%TIANPAN%')
    AND  FRT.Language  =   'ZHS'
    AND  FA.Language  =   'ZHS'
    AND  FG.END_DATE  IS   NULL
   ORDER   BY  FU.USER_ID ,  FRT.Responsibility_Name ;

2.一个反向脚本,通过Responsibility,反向查找所有绑定此职责的User(及Employee)
SELECT  FU.USER_NAME           "User Login"  ,
       FU.DESCRIPTION         "Role Description"  ,
       FU.START_DATE          "Login Start Date"  ,
       FU.END_DATE            "Login End Date"  ,
       FU.EMAIL_ADDRESS       "E-Mail Associated"  ,
       FU.EMPLOYEE_ID         "Employee Id"  ,
       PPF.EMPLOYEE_NUMBER    "Employee Number"  ,
       PPF.FULL_NAME          "Full Name"  ,
       HOU.NAME               "Business Group"  ,
       FR.RESPONSIBILITY_NAME "Responsibility Associated"  ,
       FUR.START_DATE         "Association Start Date"  ,
       FUR.END_DATE           "Association End Date"
   FROM  APPS.FND_USER                  FU  ,
       APPS.PER_ALL_PEOPLE_F          PPF  ,
       APPS.HR_ALL_ORGANIZATION_UNITS HOU  ,
       APPS.FND_USER_RESP_GROUPS_ALL  FUR  ,
       APPS.FND_RESPONSIBILITY_TL     FR
   WHERE  PPF.PERSON_ID  =  FU.EMPLOYEE_ID
    AND  HOU.ORGANIZATION_ID  =  PPF.BUSINESS_GROUP_ID
    AND  PPF.EFFECTIVE_END_DATE  =  TO_DATE  ( '31/12/4712', 'DD/MM/RRRR' )
    AND  FU.USER_ID  =  FUR.USER_ID
    AND   NVL  ( FUR.END_DATE  , SYSDATE + 1 ) > SYSDATE
    AND  FUR.RESPONSIBILITY_ID  =  FR.RESPONSIBILITY_ID
    AND  FR.RESPONSIBILITY_NAME  LIKE   '%人力资源%'
    AND  FR.LANGUAGE  =   'ZHS'
   ORDER   BY  FU.USER_NAME ,  FR.RESPONSIBILITY_NAME

Users and Responsibilites in Oracle Apps

Source:http://dbnerdz.blogspot.com/2013/09/users-and-responsibilites-in-oracle-apps.html

Script to find all the responsibilities of a user


SELECT fu.user_name "User Name",
frt.responsibility_name "Responsibility Name",
furg.start_date "Start Date",
furg.end_date "End Date",
fr.responsibility_key "Responsibility Key",
fa.application_short_name "Application Short Name"
FROM fnd_user_resp_groups_direct furg,
applsys.fnd_user fu,
applsys.fnd_responsibility_tl frt,
applsys.fnd_responsibility fr,
applsys.fnd_application_tl fat,
applsys.fnd_application fa
WHERE furg.user_id = fu.user_id
AND furg.responsibility_id = frt.responsibility_id
AND fr.responsibility_id = frt.responsibility_id
AND fa.application_id = fat.application_id
AND fr.application_id = fat.application_id
AND frt.language = USERENV('LANG')
AND UPPER(fu.user_name) = UPPER('SYSADMIN') -- <change it>
-- AND (furg.end_date IS NULL OR furg.end_date >= TRUNC(SYSDATE))
ORDER BY frt.responsibility_name;


Script to check Responsibilities assigned to particular user or users assigned for particular resposibility or all users and their responsibilities


SELECT fu.user_id, fu.user_name, fur.responsibility_id,
fr.responsibility_name
FROM fnd_user fu, fnd_user_resp_groups fur, fnd_responsibility_vl fr
WHERE fu.user_id = fur.user_id
AND fr.application_id = fur.responsibility_application_id
AND fr.responsibility_id = fur.responsibility_id
AND TRUNC (SYSDATE) BETWEEN TRUNC (fr.start_date)
AND TRUNC (NVL ((fr.end_date - 1), SYSDATE))
AND TRUNC (SYSDATE) BETWEEN TRUNC (fur.start_date)
AND TRUNC (NVL ((fur.end_date - 1), SYSDATE))
and user_name like 'SYSADMIN' --- for all user or for a particular user
-- AND fur.responsibility_application_id = 1 -- to check users for particular responsibility
order by user_name


List Of Responsibilities Assigned To All Users


SELECT FURGA.USER_ID
, FU.USER_NAME
, FURGA.RESPONSIBILITY_ID
, FRTL.RESPONSIBILITY_NAME
, FURGA.RESPONSIBILITY_APPLICATION_ID
, FA.APPLICATION_SHORT_NAME
, FURGA.SECURITY_GROUP_ID
, FSG.SECURITY_GROUP_KEY
, FURGA.START_DATE
, FURGA.END_DATE
, FURGA.CREATED_BY
, FUCB.USER_NAME
, FURGA.CREATION_DATE
, FURGA.LAST_UPDATED_BY
, FULUB.USER_NAME
, FURGA.LAST_UPDATE_DATE
, FURGA.LAST_UPDATE_LOGIN
, FULUL.USER_NAME
FROM
FND_USER_RESP_GROUPS_ALL FURGA,
FND_USER FU,
FND_USER FUCB,
FND_USER FULUB,
FND_USER FULUL,
FND_APPLICATION FA,
FND_RESPONSIBILITY_TL FRTL,
FND_SECURITY_GROUPS FSG
WHERE
FURGA.USER_ID = FU.USER_ID (+)
AND FURGA.CREATED_BY = FUCB.USER_ID (+)
AND FURGA.LAST_UPDATED_BY = FULUB.USER_ID (+)
AND FURGA.LAST_UPDATE_LOGIN = FULUL.USER_ID (+)
AND FURGA.RESPONSIBILITY_APPLICATION_ID = FA.APPLICATION_ID (+)
AND FURGA.RESPONSIBILITY_ID = FRTL.RESPONSIBILITY_ID (+)
AND FRTL.LANGUAGE = 'US'
AND FURGA.SECURITY_GROUP_ID = FSG.SECURITY_GROUP_ID (+)
ORDER BY START_DATE;

Query to list Active Responsibilities of an Active User

SELECT fu.user_name, frv.responsibility_name, frv.responsibility_key, TO_CHAR (furgd.start_date, 'DD-MON-YYYY') "START_DATE", TO_CHAR (furgd.end_date, 'DD-MON-YYYY') "END_DATE"FROM fnd_user fu, fnd_user_resp_groups_direct furgd, fnd_responsibility_vl frvWHERE fu.user_id = furgd.user_idAND furgd.responsibility_id = frv.responsibility_idAND furgd.end_date IS NULLAND fu.user_name = '&user_name'AND furgd.start_date <= sysdateAND NVL(furgd.end_date, sysdate + 1) > sysdateAND fu.start_date <= sysdateAND NVL(fu.end_date, sysdate + 1) > sysdateAND frv.start_date <= sysdateAND NVL(frv.end_date, sysdate + 1) > sysdate;



你可能感兴趣的:(Users and Responsibilites in Oracle EBS)