SQL Query to get Oracle Menus Functions

本文提供了一系列Oracle数据库查询脚本,用于获取菜单结构、子菜单、功能及权限等信息。通过这些脚本,你可以详细了解特定责任菜单下的所有层级,包括功能名称、描述、子菜单名及其描述,以及所关联的责任名称。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

               

Script that queries the Menu structure

SELECT     LPAD (' ', 6 * (LEVEL - 1)) || menu_entry.entry_sequence SEQUENCE,           LPAD (' ', 6 * (LEVEL - 1)) || menu_entry.prompt prompt,           menu_entry.grant_flag grant_flag,           DECODE (menu_entry.sub_menu_id,                   NULL, 'FUNCTION',                   DECODE (menu_entry.function_id, NULL, 'SUBMENU', 'BOTH')                  ) TYPE,           menu2.user_menu_name, func2.user_function_name      FROM fnd_menu_entries_vl menu_entry,           fnd_menus_tl menu,           fnd_form_functions_tl func,           fnd_form_functions_tl func2,           fnd_menus_tl menu2     WHERE menu_entry.sub_menu_id = menu.menu_id(+)       AND menu_entry.function_id = func.function_id(+)       AND menu_entry.sub_menu_id = menu2.menu_id(+)       AND menu_entry.function_id = func2.function_id(+)       AND grant_flag = 'Y'START WITH menu_entry.menu_id =                     (SELECT menu_id                        FROM fnd_menus_tl menu2                       WHERE menu2.user_menu_name = 'INV_TRANSACTIONS')    --Your Menu Name Here(Parent_Menu_User_Name)CONNECT BY menu_entry.menu_id = PRIOR menu_entry.sub_menu_id  ORDER SIBLINGS BY menu_entry.entry_sequence;
Output:


The query gives you one level of sub menus for any responsibility specified

SELECT  FMEV.ENTRY_SEQUENCE,       FMEV.PROMPT,       FMEV.DESCRIPTION,       SUB_MENU_FMEV.USER_MENU_NAME SUB_MENU_NAME,       SUB_MENU_FMEV.DESCRIPTION SUB_MENU_DESCRIPTION,        FFFT.USER_FUNCTION_NAME,        FMEV.GRANT_FLAGFROM apps.FND_MENU_ENTRIES_VL FMEV,      apps.FND_MENUS_TL SUB_MENU_FMEV,      APPS.FND_FORM_FUNCTIONS_TL FFFT,      apps.FND_RESPONSIBILITY_VL FRVWHERE FRV.MENU_ID = FMEV.menu_idAND   SUB_MENU_FMEV.MENU_ID(+) = FMEV.SUB_menu_idAND   SUB_MENU_FMEV.LANGUAGE(+) = 'US'AND   FFFT.FUNCTION_ID(+) = FMEV.FUNCTION_IDAND   FFFT.LANGUAGE(+) = 'US'AND   FRV.responsibility_name = 'Manufacturing and Distribution Manager' --Your Responsibility NameORDER BY FMEV.entry_sequence;

Output:



This QUERY will retrieve the Function(s) and Submenu(s) which those all are attached to the given input responsibility.

SELECT NVL2 (fme.sub_menu_id, '+', '-')|| LPAD (NVL ((SELECT promptFROM apps.fnd_menu_entries_vlWHERE menu_id = fme.menu_idAND sub_menu_id = fme.sub_menu_idAND fme.function_id IS NULL),(SELECT promptFROM apps.fnd_menu_entries_vlWHERE menu_id = fme.menu_idAND function_id = fme.function_idAND fme.sub_menu_id IS NULL)),LENGTH (NVL ((SELECT promptFROM apps.fnd_menu_entries_vlWHERE menu_id = fme.menu_idAND sub_menu_id = fme.sub_menu_idAND fme.function_id IS NULL),(SELECT promptFROM apps.fnd_menu_entries_vlWHERE menu_id = fme.menu_idAND function_id = fme.function_idAND fme.sub_menu_id IS NULL)))+ (LEVEL * 5),'-') tree_structureFROM apps.fnd_menu_entries fmeSTART WITH fme.menu_id =(SELECT menu_idFROM apps.fnd_responsibility fr, apps.fnd_responsibility_tl frtWHERE fr.responsibility_id = frt.responsibility_idAND frt.responsibility_name = '&responsibility_name') -- 'Application Developer'CONNECT BY PRIOR fme.sub_menu_id = fme.menu_id;
Output:

TREE_STRUCTURE
+-----Flexfield
+----------Key
----------------Register
----------------Segments
----------------Aliases
----------------CrossValidation
----------------Values
----------------Groups
----------------Accounts
+----------Descriptive
----------------Register
----------------Segments
----------------Values
-----------Flexfield Test
+-----Concurrent
-----------Program
-----------Executable
-----------Library
+-----Application
-----------Register
-----------Form
-----------Function
-----------Menu
-----------Messages
+----------Database
----------------Table
----------------Sequence
----------------View
+----------Lookups
----------------Application Object Library
----------------Common
----------------CE lookups
----------------GCS Lookups
----------------IA Lookups
----------------igi lookups
----------------XLA Lookups
----------------XLE Lookups
----------------FUN Lookups
----------------Service Lookups
+----------Validation
----------------Set
----------------Values
------Profile
+-----Attachments
-----------Document Entities
-----------Document Categories
-----------Attachment Functions
-----------Repositories
+-----Other
+----------Requests
----------------Run
----------------View
----------------Set
-----------Profile
-----------Concurrent
-----------Change Organization
-----------Running Jobs
+----------EDI
----------------EDI Setup
----------------EDI Data

             

From Function to Menu(Basic Queries)

SELECT * FROM FND_FORM_FUNCTIONS_TL WHERE user_function_name LIKE '%Define Material Status%';                                 

SELECT * FROM FND_MENU_ENTRIES_VL WHERE function_id = 1006916; --Get Menu_id

SELECT * FROM FND_MENU_ENTRIES_VL WHERE menu_id = 67607 --同一Level都有哪些其他功能
 
SELECT * FROM FND_MENUS WHERE menu_id = 67607 --查看上层的Menu,Menu_Name:INV_SETUP_TRANSACTIONS

SELECT * FROM FND_MENU_ENTRIES WHERE sub_menu_id = 67607 --上层Menu_id:67579

SELECT * FROM FND_MENUS WHERE menu_id = 67579 --查看上层的Menu_Name:INV_SETUP

SELECT * FROM FND_MENU_ENTRIES WHERE sub_menu_id = 67579 --上层Menu_id:67579

SELECT * FROM FND_MENUS WHERE  menu_id IN  (SELECT menu_id FROM FND_MENU_ENTRIES WHERE sub_menu_id = 67579)


SELECT fmt.description,fm.*
FROM FND_MENUS fm,FND_MENUS_TL fmt WHERE fmt.LANGUAGE = 'US' AND fm.menu_id = fmt.menu_id
AND fm.menu_id IN
(SELECT menu_id FROM FND_MENU_ENTRIES_VL WHERE function_id IN
(SELECT function_id FROM FND_FORM_FUNCTIONS_TL WHERE user_function_name LIKE '%Define Material Status%'))  





           

再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.youkuaiyun.com/jiangjunshow

内容概要:本文详细介绍了900W或1Kw,20V-90V 10A双管正激可调电源充电机的研发过程和技术细节。首先阐述了项目背景,强调了充电机在电动汽车和可再生能源领域的重要地位。接着深入探讨了硬件设计方面,包括PCB设计、磁性器件的选择及其对高功率因数的影响。随后介绍了软件实现,特别是程序代码中关键的保护功能如过流保护的具体实现方法。此外,文中还提到了充电机所具备的各种保护机制,如短路保护、欠压保护、电池反接保护、过流保护和过温度保护,确保设备的安全性和可靠性。通讯功能方面,支持RS232隔离通讯,采用自定义协议实现远程监控和控制。最后讨论了散热设计的重要性,以及为满足量产需求所做的准备工作,包括提供详细的PCB图、程序代码、BOM清单、磁性器件和散热片规格书等源文件。 适合人群:从事电力电子产品研发的技术人员,尤其是关注电动汽车充电解决方案的专业人士。 使用场景及目标:适用于需要高效、可靠充电解决方案的企业和个人开发者,旨在帮助他们快速理解和应用双管正激充电机的设计理念和技术要点,从而加速产品开发进程。 其他说明:本文不仅涵盖了理论知识,还包括具体的工程实践案例,对于想要深入了解充电机内部构造和工作原理的人来说是非常有价值的参考资料。
To add custom functions to the NX menu, you can use the NXOpen.MenuBar class in NXOpen.NET API. Here is an example code that demonstrates how to add a custom function to the NX menu: ```vb Imports System Imports NXOpen Module Module1 Sub Main() ' Get the NX session Dim theSession As Session = Session.GetSession() ' Get the UI work part Dim theUI As UI = theSession.UI Dim lw As ListingWindow = theSession.ListingWindow ' Get the menu bar Dim menuBar As MenuBar = theUI.MenuBar ' Get the File menu Dim fileMenu As Menu = menuBar.GetMenu("File") ' Add a separator to the File menu fileMenu.AddSeparator() ' Add a custom function to the File menu Dim menuItem As MenuItem = fileMenu.AddMenuItem("Custom Function", AddressOf CustomFunction) ' Show a message box when the custom function is clicked Sub CustomFunction(ByVal item As MenuItem) lw.Open() lw.WriteLine("Custom function is clicked!") lw.Close() End Sub ' Start the NX message loop to display the menu theUI.NXMessageBox.Show("Menu Example", NXMessageBox.DialogType.Information, "Click OK to display the menu") theUI.NXMessageBox.GetMessage() ' Remove the custom function from the menu fileMenu.RemoveMenuItem(menuItem) End Sub End Module ``` In the above code, we first obtain the NX session and UI work part. Then, we get the MenuBar object using `theUI.MenuBar`. Next, we retrieve the desired menu (e.g., "File") using `GetMenu()` method. We can add a separator using `AddSeparator()` method and add a custom function using `AddMenuItem()` method, specifying the function to be called when the menu item is clicked. In the example above, the `CustomFunction` is a sub that will be executed when the custom function menu item is clicked. You can customize the behavior of this function to perform your desired actions. After adding the custom function, we start the NX message loop using `theUI.NXMessageBox.Show()` and `theUI.NXMessageBox.GetMessage()` to display the menu. Finally, we remove the custom function from the menu using `RemoveMenuItem()` method. Please note that above code is just an example, and you may need to adjust it based on your specific requirements and menu structure in NX.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值