Архив

Публикации с меткой ‘fnd_responsibility’

Список полномочий и групп запросов для отчета

15 Апрель 2016 Нет комментариев

Запрос для вывода списка полномочий и групп запросов по коду или имени отчета/параллельной программы:

with params as (
select 'FNDATREP' as short_name
      ,''    as long_name
      ,'RU'  as lang /* RU;US */
from dual
)
select  p1.concurrent_program_name
       ,pt.user_concurrent_program_name
       ,fa.application_short_name as appl_resp
       ,r.responsibility_key
       ,rt.responsibility_name      
       ,fa1.application_short_name as appl_request_group
       ,g.request_group_name
from fnd_request_groups      g,
     fnd_request_group_units u,
     fnd_application    fa,
     fnd_application    fa1,         
     fnd_concurrent_programs_tl pt,
     fnd_concurrent_programs    p1,
     fnd_responsibility    r,
     fnd_responsibility_tl rt,
     params
where 1=1
      and u.application_id = g.application_id
      and u.request_group_id = g.request_group_id
      and (u.request_unit_id = pt.concurrent_program_id
          or u.request_unit_type = 'A')
      and u.unit_application_id = pt.application_id
      and pt.application_id = fa.application_id
      and pt.concurrent_program_id = p1.concurrent_program_id
      and g.application_id = fa1.application_id
      and r.request_group_id = g.request_group_id
      and r.responsibility_id = rt.responsibility_id
      and rt.language = params.lang
      and pt.language  = params.lang
      and (
            (p1.concurrent_program_name like '%'||params.short_name||'%' 
             and params.short_name is not null 
            ) 
            or 
            (pt.user_concurrent_program_name like '%'||params.long_name||'%' 
             and params.long_name is not null and params.short_name is null
            )
          )
order by 1,2;

Список полномочий где используется форма + путь для вызова

15 Апрель 2016 Нет комментариев

Скрипт для вывода списка полномочий, в которых используется форма.
Так же добавлен путь внутри полномочий для вызова формы.
Желаемый язык для вывода данных вынесен в параметры.

with params as (
select 'FNDSCRSP' as form_name
      ,''         as user_form_name
      ,''         as description_form
      ,'RU'       as lang /* RU;US */
from dual
)
select (select rt.responsibility_name from fnd_responsibility_tl rt , params
        where rt.responsibility_id  = r.responsibility_id
              and rt.application_id = r.application_id
              and rt.language = params.lang
       ) as responsibility_name
      ,(select ltrim(sys_connect_by_path(me.prompt, ' --> '),' --> ') 
        from (select b.menu_id,b.entry_sequence,b.sub_menu_id,b.function_id, t.prompt
             from fnd_menu_entries_tl t, fnd_menu_entries b, params
             where b.menu_id = t.menu_id
               and b.entry_sequence = t.entry_sequence
               and t.language = params.lang) me
        where me.prompt is not null 
              and me.function_id = ff1.function_id 
              and rownum=1
        start with me.menu_id = r.menu_id  
        connect by prior me.sub_menu_id = me.menu_id and prior me.prompt is not null
       ) path_to_form
      ,r.application_id
      ,r.responsibility_id
      ,r.responsibility_key 

      ,r.menu_id    
      ,(select mt.user_menu_name from fnd_menus_tl mt, params where mt.menu_id = r.menu_id and mt.language = params.lang) as user_menu_name
      ,ff1.function_id
      ,(select fft.user_function_name from fnd_form_functions_tl fft, params where fft.function_id = ff1.function_id and fft.language = params.lang) as user_function_name
      ,ff1.form_id 
      ,(select ff.form_name from fnd_form ff where ff.form_id = ff1.form_id ) as form_name      
      ,(select ftl.user_form_name from fnd_form_tl ftl, params where ftl.form_id = ff1.form_id  and ftl.language = params.lang) as user_form_name
from fnd_responsibility r
    ,(select ff.function_id, ff.form_id from fnd_form_functions ff 
      where ff.form_id in (select f.form_id 
                           from fnd_form f, fnd_form_tl ft, params
                           where f.form_id = ft.form_id
                                 and (
                                        f.form_name = params.form_name 
                                     or (ft.user_form_name like '%'||params.user_form_name||'%' and params.user_form_name is not null)
                                     or (ft.description like '%'||params.description_form||'%' and params.description_form is not null)
                                     )
                          )
     ) ff1 
where 1=1
      and sysdate between r.start_date and nvl(r.end_date, sysdate+1)
      and r.menu_id in (select me.menu_id from fnd_menu_entries me 
                        start with me.function_id = ff1.function_id
                        connect by prior me.menu_id = me.sub_menu_id 
                       )