Thursday, February 25, 2010

Navigation Path for a Oracle form

This query can give te responsibility and navigation for an Oracle Application form.


SELECT resp.responsibility_name
, navigation
, form_name
, function_name
, user_function_name
FROM ( SELECT menu_name
, pt prompt
, (SELECT user_menu_name
FROM apps.fnd_menus_vl
WHERE menu_id = menu.sub_menu_id
) "Sub Menu Name"
, user_function_name
, function_name
, function_type
, form_name
, ROWNUM seq
, menu_id
, LEVEL lvl
, entry_sequence
, SYS_CONNECT_BY_PATH(menu_id,' --> ') scbp
, SYS_CONNECT_BY_PATH(pt,'-->') navigation
FROM (SELECT fm.menu_id
, fme.sub_menu_id
, fme.entry_sequence
, fm.menu_name
, fme.function_id
, fme.prompt pt
, func.user_function_name
, func.function_name
, func.type function_type
, DECODE(func.type, 'FORM', frm.form_name
, 'JSP' , WEB_HTML_CALL
, 'WWW' , WEB_HTML_CALL
, NULL
) Form_name
FROM apps.fnd_menu_entries_vl fme
, apps.fnd_menus_vl fm
, apps.fnd_form_functions_vl func
, applsys.fnd_form frm
WHERE fm.menu_id = fme.menu_id
AND fme.menu_id <> NVL(fme.sub_menu_id,-1)
--
-- Above condition is needed to avoid infinite loop
-- Two Oracle contracts menu have a menu as child of itself
--
AND fme.function_id = func.function_id (+)
AND func.form_id = frm.form_id (+)
) menu
CONNECT BY PRIOR sub_menu_id = menu_id
ORDER SIBLINGS BY entry_sequence
) flat_menu
, apps.fnd_responsibility_vl resp
WHERE flat_menu.form_name like 'XX%' /*Change this to desired value*/
AND instr(flat_menu.scbp,resp.menu_id) > 0
ORDER BY form_name, responsibility_name

No comments:

Post a Comment