Wednesday, July 19, 2023

Query to get concurrent program assigned to responsibility

  SELECT DISTINCT frt.responsibility_name, frg.request_group_name,
    frgu.request_unit_type,frgu.request_unit_id,
    fcpt.user_concurrent_program_name
    FROM apps.fnd_Responsibility fr, apps.fnd_responsibility_tl frt,
    apps.fnd_request_groups frg, apps.fnd_request_group_units frgu,
    apps.fnd_concurrent_programs_tl fcpt
    WHERE frt.responsibility_id = fr.responsibility_id
    AND frg.request_group_id = fr.request_group_id
    AND frgu.request_group_id = frg.request_group_id
    AND fcpt.concurrent_program_id = frgu.request_unit_id
    AND frt.LANGUAGE = USERENV('LANG')
    AND fcpt.LANGUAGE = USERENV('LANG')
    AND fcpt.user_concurrent_program_name = 'Purge Open Interface Data'
    AND frt.responsibility_name like '%OM%'
    ORDER BY 1,2,3,4;

Query to get concurrent program details

 SELECT distinct fcpt.user_concurrent_program_name ,
  fcp.concurrent_program_name short_name ,
  fat.application_name program_application_name ,
  fet.executable_name ,
  fat1.application_name executable_application_name ,
  flv.meaning execution_method ,
  fet.execution_file_name ,
  fcp.enable_trace
FROM apps.fnd_concurrent_programs_tl fcpt ,
  apps.fnd_concurrent_programs fcp ,
  apps.fnd_application_tl fat ,
  apps.fnd_executables fet ,
  apps.fnd_application_tl fat1 ,
  apps.FND_LOOKUP_VALUES FLV
WHERE 1=1
AND fcpt.user_concurrent_program_name='Program name'
AND fcpt.concurrent_program_id       = fcp.concurrent_program_id
AND fcpt.application_id              = fcp.application_id
AND fcp.application_id               = fat.application_id
AND fcpt.application_id              = fat.application_id
AND fcp.executable_id                = fet.executable_id
AND fcp.executable_application_id    = fet.application_id
AND fet.application_id               = fat1.application_id
AND flv.lookup_code                  = fet.execution_method_code
AND FLV.LOOKUP_TYPE                  ='CP_EXECUTION_METHOD_CODE'
and fat.language = 'US'
and fat1.language = 'US'
and fcpt.language = 'US'
and FLV.language = 'US';

Query to get responsibilities assigned to user

Below is the query to get the responsibilities assigned to user : 


SELECT distinct  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 apps.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 fat.language             =  USERENV('LANG')
  -- AND frt.responsibility_name = 'Application Developer'
   AND UPPER(fu.user_name)      =  UPPER('OPERATIONS')  -- <change it>
   -- AND (furg.end_date IS NULL OR furg.end_date >= TRUNC(SYSDATE))
 ORDER BY frt.responsibility_name;