–取物料入库的价格
apps.xxcus_sr_bpa_price_pkg.get_rcv_transaction_price(p_transaction_id => rct.transaction_id,
p_transaction_uom => rct.unit_of_measure)
–人员工号姓名
(select DISTINCT PPF.FULL_NAME
from per_people_f ppf, fnd_user fu
where FU.EMPLOYEE_ID = PPF.PERSON_ID
AND FU.USER_ID = H.CREATED_BY ) CREATE_NAME
------获取组织CODE
get_org_code(H.ORGANIZATION_ID)
–库存会计期是否打开
l_inv_flag := apps.XXCUS_MTL_COMMON_PKG.check_inv_period(c_detail.transaction_date,l_organization_id);
IF l_inv_flag=‘N’ THEN
l_error_msg := ‘请检查事务处理时间所在库存会计期间是否打开!’;
RAISE e_exception;
END IF;
–个性化:记录是否保留原单价更新历史
select * from xxcus.xxcus_po_hold_update_log_t --apps.xxcus_sourcing_init_pkg.insert_hold_log
–查询未关闭的工单
SELECT we.wip_entity_name 工单号,wdj.status_type,fl.MEANING 工单状态,wdj.creation_date 创建时间 FROM apps.FND_LOOKUP_VALUES_VL fl
,WIP.WIP_DISCRETE_JOBS WDJ
,apps.wip_entities we
WHERE fl.LOOKUP_TYPE = ‘WIP_JOB_STATUS’
AND fl.LOOKUP_CODE = wdj.status_type
AND we.wip_entity_id = wdj.wip_entity_id
AND wdj.status_type NOT IN (‘7’,‘12’)
AND wdj.organization_id = 1079
ORDER BY 创建时间 desc–fl.MEANING
–XXIMS 是苏州盘古mes,HFMES_QUERY是巢湖mes,SUMES_LINK是苏州哥瑞利mes
–取车联的组织
select MIO.ORGANIZATION_ID,mio.*
from MSC_INSTANCE_ORGS MIO
where 1 = 1
AND MIO.ORG_GROUP = ‘VNW’
AND MIO.ENABLED_FLAG = 1
–Oracle将某张表授权给用户查询权限
grant select on XXCUS_INTERFACE_BILL_V TO HFMES_QUERY
–分析函数
–值相同 排名相同 序号跳跃
SELECT RANK() OVER(PARTITION BY ‘列名’ ORDER BY ‘列名’ DESC) FROM dual
–值相同 排名相同 序号连续
SELECT dense_rank() OVER(PARTITION BY ‘列名’ ORDER BY ‘列名’ DESC) FROM dual
–序号连续 不管值是否相同
SELECT row_number() OVER(PARTITION BY ‘列名’ ORDER BY usernum DESC) FROM daul
–查看组织是否是VMI组织
SELECT * FROM apps.HR_ALL_ORGANIZATION_UNITS hou
WHERE hou.attribute11 = ‘Y’
–通用上传文件表
SELECT aa.field_01 FROM xxcus.XXCUS_FILE_UPLOAD_L_T aa
WHERE aa.import_id = 582452
AND aa.line_no>1
–查看表的授权信息
SELECT * FROM dba_tab_privs db
WHERE db.table_name = ‘XXIMS_MATRIAL_INTERFACE_HF_T’
–查看包的授权信息
SELECT * FROM dba_role_privs dr WHERE dr.GRANTEE = ‘XXMES’
SELECT * FROM All_Db_Links ad --查询DBLINK
WHERE ad.DB_LINK LIKE ‘%QIS%’
SELECT * FROM all_sequences seq --查询序列
SELECT * FROM all_constraints ac WHERE ac.TABLE_NAME = ‘OFM_XXMES_BOM_BILL_HF’
–发票接收人ID
select t.employee_id,t.full_name ,t.* from APPS.HR_EMPLOYEES t where t.full_name like ‘李倩倩%’;
– CUX_ISP_INVOICE_RECEVIVER
–查找用户的工号
select * from apps.fnd_user fu
where fu.description like ‘邹洪玲’
–查询用户登录OR账号的时间
SELECT * FROM apps.fnd_logins fl
----自动完工、完工到已发放程序包
apps.xxcus_wip_job_close_pkg.xxcus_job_close_req
–查询人员信息
Select aa.* From Ofnchr.Empinfo_Onpost_V2@Ehrdb aa
WHERE aa.psnname LIKE ‘’
AND aa.PSNCODE LIKE ‘N83%’
–委外工单导入申请错误接口表
SELECT i.rowid,i.*
FROM APPS.PO_INTERFACE_ERRORS I–错误接口表
WHERE /TRUNC(I.CREATION_DATE) = TRUNC(SYSDATE)/
/and/ i.interface_transaction_id in (24,25)
AND I.INTERFACE_TYPE = ‘REQIMPORT’
SELECT ri.rowid,ri.*
FROM APPS.PO_REQUISITIONS_INTERFACE_ALL RI—先看这个接口表,通过TRANSACTION_ID 找上面错误 的接口表
WHERE RI.TRANSACTION_ID in (24,25)
–供应商及密码
SELECT APPS.XXCUS_FND_WEB_SEC.GET_USER_PASS(‘109769-3’, ‘admin’)
FROM DUAL;
–集团下子公司
select * from apps.xle_firstparty_information_v xf
WHERE xf.name LIKE ‘%苏州%’
–通过主体代码来查询公司名称
SELECT * FROM apps.hr_operating_units hou
,apps.xle_firstparty_information_v xf
WHERE hou.default_legal_context_id(+) = xf.legal_entity_id
AND hou.short_code LIKE ‘%32%’
–查看配置文件(有权限人员)
SELECT fu.user_name,fu.description FROM
apps.fnd_profile_option_values po
,apps.fnd_user fu
,apps.fnd_profile_options f
WHERE f.profile_option_name = ‘OF_CHANGE_PR_CREATOR’
AND po.profile_option_id = f.profile_option_id–12707
AND fu.user_id = po.level_value
AND nvl(fu.end_date,SYSDATE+1) >SYSDATE
–BOM点位上传程序包
APPS.OFM_BOM_DIAN_IMP_PKG
–工单历史组件信息
SELECT * FROM xxcus.xxcus_requirement_his x
–工单数量历史表
SELECT * FROM apps.XXCUS_WIP_JOBS_QTY_HIS_T a
WHERE a.wip_entity_id = 7088998
SELECT * FROM apps.fnd_user fu WHERE fu.user_id = 5596
SELECT * FROM apps.fnd_user fu WHERE fu.user_id = 34422
SELECT * FROM apps.WIP_DISCRETE_JOBS_V
SELECT * from apps.WIP_ENTITIES we WHERE we.wip_entity_id =6786571
–通过工单号查询组织
select ood.ORGANIZATION_CODE
from apps.org_organization_definitions ood
where ood.ORGANIZATION_ID = ( select we.organization_id from apps.WIP_ENTITIES we
where we.wip_entity_name = ‘MNL1S007260706’)
–通过组织号查找主体
select ou.NAME , ood.*
from apps.org_organization_definitions ood ,apps.hr_operating_units ou
where ood.ORGANIZATION_CODE = ‘318’ and
ood.LEGAL_ENTITY = ou.default_legal_context_id
select * from apps.hr_operating_units ou
–条码发料报错
CUX_WS_WIP_ISSUE_PKG.WIP_TRANS_VALIDATE
–条码建单未审单 97报废
select “ORGID”,“MONAME”,“QTY” from v_wip_undonebillqty@wmsprod a
WHERE A.orgid = 1662
AND A.moname = ‘MNA11619AL122052332’
–用户组视图查询
SELECT USER_ID,PARTY_ID,REL_PARTY_ID,PARTY_NUMBER,PERSON_NAME,GROUP_NAME,
VALIDATED_FLAG,RELATIONSHIP_ID,SUBJECT_ID,OBJECT_ID,USER_NAME,PERSON_LAST_NAME,PERSON_FIRST_NAME,STATUS,LAST_UPDATE_DATE
FROM apps.QA_USER_GROUP_V
WHERE party_id = ‘599346’ and (OBJECT_ID=599346) order by USER_NAME
–wip 领退料修改行状态
apps.XXCUS_MTL_TRANS_SET_STATUS_PKG
–查询请求提交的信息
select * from apps.FND_CONC_REQ_SUMMARY_V fc
where fc.PROGRAM = ‘填写员工层次结构’
and fc.REQUEST_DATE > to_date(‘2022-10-04’,‘YYYY-MM-DD’)
and fc.REQUEST_DATE < to_date(‘2022-10-10’,‘YYYY-MM-DD’)
–六大表单取消未产生事务处理的行
update xxcus.xxcus_iv_trans_lines_t xi
set xi.line_status=‘CANCEL’
where xi.trans_header_id =‘5951405’ and xi.trans_line_id=‘16398918’;
–查找请求对应的程序
select cp.USER_CONCURRENT_PROGRAM_NAME
,ef.EXECUTABLE_NAME
,ef.EXECUTION_FILE_NAME
from APPS.FND_CONCURRENT_PROGRAMS_VL cp,
APPS.FND_EXECUTABLES_FORM_V ef
where 1=1
and cp.EXECUTABLE_ID = ef.EXECUTABLE_ID
–and upper(ef.EXECUTION_FILE_NAME) like ‘%XXMES_G_SYNCHRONOUS_HF_PKG%’
and cp.USER_CONCURRENT_PROGRAM_NAME like ‘%Ofilm BOM结构导出明细列表%’ --ofilm 完成状态工单自动改成完成不计费状态(NEW)
apps.XXCUS_INSIT_BALANCE.XXCUS_INSIT_BALANCE_MAIN
apps.XXCUS_BPA_QUO_PRICE_UPDATE_PKG.XXCUS_Adoption_Share
apps.XXCUS_PO_ASN_UPDATE_PKG.release_ship_quantity
apps.XXCUS_BOM_OUT_DETAIL_PKG.rpt01
–CUX:H01 客供料入库定时程序
–查找请求对应的职责
select f.RESPONSIBILITY_NAME,g.request_group_name,t.*
from APPLSYS.FND_REQUEST_GROUP_UNITS t,
apps.FND_REQUEST_GROUPS g,
apps.FND_RESPONSIBILITY_VL f
where t.request_unit_id = 63429
and t.request_group_id = g.request_group_id
and g.request_group_id = f.REQUEST_GROUP_ID
AND f.RESPONSIBILITY_NAME LIKE ‘%73%’
–查询使用过该表的程序包
select * from DBA_DEPENDENCIES d
where d.referenced_name like ‘%XXMES_G_WO_HEADER_INT_HF_T%’
apps.CUX_MES_KGL_RCV_PKG
–查询此信息所在的所有程序包
SELECT *
FROM ALL_SOURCE
WHERE UPPER(TEXT) LIKE ‘%XXCUS_VNW_FCST_LIST%’
AND TYPE = ‘PACKAGE BODY’
apps.XXCUS_OM_REPORT_EMAIL_PKG
apps.XXCUS_OM_REPORT_EMAIL_PKG2
–物料是否检验判断程序包
APPS.XXCUS_ITEM_INSPECTION_PUB
–委外工单导入申请错误接口表
SELECT i.rowid,i.*
FROM APPS.PO_INTERFACE_ERRORS I–错误接口表
WHERE /TRUNC(I.CREATION_DATE) = TRUNC(SYSDATE)/
/and/ i.interface_transaction_id in (24,25)
AND I.INTERFACE_TYPE = ‘REQIMPORT’
SELECT ri.rowid,ri.*
FROM APPS.PO_REQUISITIONS_INTERFACE_ALL RI—先看这个接口表,通过TRANSACTION_ID 找上面错误 的接口表
WHERE RI.TRANSACTION_ID in (24,25)
–OA调用自动生成物料编码
APPS.ofm_auto_item_number
select apps.ofm_auto_item_number(‘原材料’, ‘A’) from dual
–工时BI接口(工时系统)
apps.xxcus_gs_synchronous_pkg
select * from ods.ods_gs_query_work_time_table_v@BIDB --明细表
select * from ods.gs_or_machine@BIDB --oms对应表
select * from ods.gs_ccm_or_mach_totaltime@BIDB --CCM汇总表
–BOM 批量导入程序包
apps.XXCUS_BOM_IMP_PKG
–工序移动异常需修改移动表和工序表
select * from apps.wip_move_transactions t where t.wip_entity_id=6223874 and t.transaction_id=432014286
delete from apps.wip_move_transactions t where t.wip_entity_id=6223874 and t.transaction_id=432014286;
update apps.WIP_OPERATIONS t set t.quantity_completed = 0 where t.wip_entity_id=6223874 and t.operation_seq_num=160
–最小发料套数程序包:
apps.xxcus_ascp_calculation_public.get_min_issue(wdj.wip_entity_id)
SELECT apps.xxcus_ascp_calculation_public.get_min_issue(6847837) FROM dual;
–可完工数量程序包:
apps.xxcus_ascp_calculation_public.get_qty_available(wdj.wip_entity_id)
–工单关闭OA审批完抛给OR中间表
select * from xxoa.XXOA_Modify_JOB_STATUS xmjs
–工单完成及发放程序包
apps.XXCUS_WIP_JOB_CLOSE_PKG.XXCUS_JOB_CLOSE_REQ
–工单退料数量(条码)
select apps.ofm_wip_job_issue_pkg.wip_valid_ret_qty(p_wip_entity_id => 6483474,
p_item_id => 5543676,
p_opera_num => 20) from dual;
–自动完工到自动发放逻辑修改待确认
1、wdj.date_completed>=上线当天日期
AND WDJ.Date_Completed >= to_date(‘2021-07-15’,‘yyyy-mm-dd’) --ADD by jsh 20210715
2、 wdj.last_updated_by in ()
AND WDJ.Last_Updated_By in (1140,16650,16800,18110,18197,18252 )
3、计划数量=完成+报废
–工单领退料异常,更新头表状态
UPDATE xxcus.XXCUS_WP_ITEM_TRANSACTION_H_t xwi
SET XWI.STATUS= ‘APPROVED’ --TRANSED
where xwi.transaction_order_no=‘LL211000574’
–OR抛给条码工单可领数量
–valid_issue_qty 实际用量 QUANTITY_ISSUED 实际发料
select t.valid_issue_qty,t.quantity_issued,t.* FROM XXCUS_WIP_REQUIREMENT_V t
WHERE wip_entity_id=6536632
and ITEM_CODE = ‘YC028800612900’
–OR 抛给条码的可发料数量
select apps.cux_ws_wip_issue_pkg.WIP_ITEM_VALID_IN_QTY(p_organization_id=>2018,
P_WIP_ID=>6536632 ,
P_ITEM_ID=>1577385)from dual;
–OA完成工单改为完成不计费
SELECT t.trans_header_id,t.trans_number,t.status,m.locator_id,t.attribute6
,t.attribute6
,t.trans_type_id
,t.organization_id
FROM xxcus.xxcus_iv_trans_header_t t
,ccmmesprd.CCM_SHIP_LINE_CANCEL_V@ccmmes m
WHERE t.attribute6 = m.locator_id
– and t.creation_date>=sysdate-100
and t.trans_header_id=5364448
– AND t.status NOT IN (‘GT’, ‘CA’);
–查看成本
SELECT nvl(apps.XXCUS_WIP_CLOSE_MAIL_PKG.GET_WIP_diffpercent(6286268),0) from dual
–成本大于10%
nvl(apps.XXCUS_WIP_CLOSE_MAIL_PKG.GET_WIP_diffpercent(WDJ.WIP_ENTITY_ID),0) > 0.1
6286268为查看工单后,查询出的“WIP_ENTITY_ID”
–取物料大类
SELECT distinct mic.category_concat_segs, mc.description
/INTO l_r1
,l_r2/
FROM apps.mtl_item_categories_v mic, apps.mtl_categories mc
WHERE mic.category_id = mc.category_id
AND mic.enabled_flag = ‘Y’
AND mc.enabled_flag = ‘Y’
AND mic.category_set_id = 1100000041
–查询物料有没有启用内部请购
SELECT msib.internal_order_flag,msib.segment1,msib.organization_id FROM apps.mtl_system_items_b msib
WHERE msib.organization_id IN (88,2029,1079)
–AND msib.internal_order_flag = ‘N’
AND msib.inventory_item_status_code = ‘Active’
AND msib.segment1 IN (
‘DZ26033383’,
‘DZ518802207900’,
‘DZ518803020500’,
‘GB700100025800’,
‘LB530100083700’,
‘WX731002746800’,
‘YC021400000700’,
‘DZ010107982400’,
‘DZ5103040217000’,
‘WX731002963800’,
‘WX731004176300’,
‘WX731004248400’,
‘WX731004944400’
)
ORDER BY msib.organization_id
–子库货位
select hou.organization_id ou_org_id, --org_id
hou.name ou_name, --ou名称
ood.organization_id org_org_id, --库存组织id
ood.organization_code org_org_code, --库存组织代码
msi.secondary_inventory_name, --子库存名称
msi.description, --子库存描述
MIL.SEGMENT1, --货位名称
MIL.DESCRIPTION --货位描述
from APPS.hr_organization_information hoi, --组织分类表
APPS.hr_operating_units hou, --ou视图
APPS.org_organization_definitions ood, --库存组织定义视图
APPS.mtl_secondary_inventories msi, --子库存信息表
apps.MTL_ITEM_LOCATIONS mil
where hoi.org_information1 = ‘OPERATING_UNIT’
and hoi.organization_id = hou.organization_id
and ood.operating_unit = hoi.organization_id
and ood.organization_id = msi.organization_id
AND MSI.SECONDARY_INVENTORY_NAME = MIL.SUBINVENTORY_CODE(+)
and msi.organization_id = mil.organization_id(+)
–AND MSI.SECONDARY_INVENTORY_NAME = ‘C112’
AND OOD.ORGANIZATION_CODE = ‘113’
and msi.status_id =1
and mil.status_id =1
order by msi.secondary_inventory_name
and (msi.description like ‘%CCM%’ or msi.description like ‘%发出%’)
–查库存
SELECT Ood.Organization_Code 组织
–,Ood.Organization_Name
,t.Subinventory_Code 仓库编码
,b.Description 仓库名称
,Mil.Segment1 货位
,Mil.Description 货位名称
–,t.Inventory_Item_Id
,Mtlss.Segment1 存货编码
,Mtlss.Description 存货名称
,SUM(t.Transaction_Quantity) 结存数量–Onhand_Quantity
FROM Apps.Mtl_Onhand_Quantities t
,Apps.Mtl_Secondary_Inventories b
,Apps.Mtl_System_Items_b Mtlss
,Apps.Org_Organization_Definitions Ood
,Apps.Mtl_Item_Locations Mil
WHERE t.Organization_Id = b.Organization_Id
AND b.Secondary_Inventory_Name = t.Subinventory_Code
AND Mtlss.Inventory_Item_Id = t.Inventory_Item_Id
AND t.Organization_Id = Ood.Organization_Id
AND Mtlss.Organization_Id = t.Organization_Id
AND t.Locator_Id = Mil.Inventory_Location_Id(+)
AND t.Organization_Id = Mil.Organization_Id(+)
AND t.Subinventory_Code = Mil.Subinventory_Code(+)
AND b.Description LIKE ‘%发出商品仓%’–子库名称
AND (Ood.Operating_Unit NOT IN (1958
,1171
,1173
,964
,1973
,1956
,1945
,1576) OR
Ood.Organization_Code NOT IN (‘227’
,‘881’))
GROUP BY Ood.Organization_Code
–,Ood.Organization_Name
,t.Subinventory_Code
,b.Description
,Mil.Segment1
,Mil.Description
–,t.Inventory_Item_Id
,Mtlss.Segment1
,Mtlss.Description;
–物料事务处理请求对应程序包
apps.XXCUS_INV_MMT_ALL_PKG.MAIN
–物料事务处理表
select * from inv.mtl_material_transactions
–物料事务处理类型表
select * from inv.mtl_transaction_types t where TRANSACTION_TYPE_NAME like ‘%121%’ --TRANSACTION_TYPE_ID = ‘1’
–通用文件导入表
xxcus.xxcus_file_upload_l_t
–XXCUS:订单执行表
XXCUS_OM_REP_PKG.OM_ORDER_PRINT_ALL
–XXCUS_发货单列表
XXCUS_OM_SHIPLIST_PKG.MAIN
–查看制造件卷积成本
SELECT t.*
FROM apps.cst_item_cost_details_v t
,inv.mtl_system_items_b msi
WHERE 1 = 1
AND t.inventory_item_id = msi.inventory_item_id
AND t.organization_id = msi.organization_id
AND msi.organization_id = 1342
and msi.segment1 = ‘BL16AF5020’
AND t.cost_type_id = 1
select * from inv.mtl_transaction_accounts t where t.transaction_id = 577832451
–OFM_INV_材料采购余额表
apps.XXCUS_MTL_PROCUREMENT_BALANCE.MP_MAIN
–个性化信息查询
select f.function_name,
f.description,
t.message_text
,f.*
from applsys.fnd_form_custom_actions t,
applsys.fnd_form_custom_rules f
where /t.message_text like ‘%您没有权限修改工单需求%’ --个性化提示包含内容
and/ t.rule_id = f.id
and t.MESSAGE_TEXT LIKE ‘%工艺路线缺少人工资源%’ --个性化说明
–AND f.function_name = ‘RCV_RCVRCERC’
AND f.enabled = ‘Y’
–个性化查询
SELECT function_name,
form_name,
created_by,
creation_date,
description , – 个性化的描述
trigger_event, – 触发器类型
trigger_object, – 触发对象
condition – 触发条件
FROM apps.fnd_form_custom_rules
WHERE 1 = 1
–AND function_name = ‘PO_POXRQERQ’
–OR form_name = ‘POXRQERQ’
–值集表
select *–V.FLEX_VALUE, V.DESCRIPTION
from apps.FND_FLEX_VALUES_VL V
where V.FLEX_VALUE_SET_ID = 1014892
and v.ENABLED_FLAG = ‘Y’
–and V.DESCRIPTION is not null
–and length(V.FLEX_VALUE)=4
order by V.FLEX_VALUE
–查询含有这字段的所有表
select table_name from user_tab_columns where column_name=‘VENDOR_ID’
–OU限制,看不了标准视图,先运行如下,再查对应视图
begin
mo_global.set_policy_context(‘S’, 83);
end;
–oracle 常用配置文件
SELECT fnd_profile.value(‘MFG_ORGANIZATION_ID’),
fnd_profile.value(‘ORG_ID’),
fnd_profile.value(‘LOGIN_ID’),
fnd_profile.value(‘USER_ID’),
fnd_profile.value(‘USERNAME’),
fnd_profile.value(‘GL_SET_OF_BKS_ID’),
fnd_profile.value(‘SO_ORGANIZATION_ID’),
fnd_profile.value(‘RESP_NAME’),
fnd_profile.value(‘RESP_ID’)
FROM DUAL;
–配置文件表
select * from apps.fnd_profile_options_vl t
select * from apps.fnd_profile_options_vl t
where t.PROFILE_OPTION_NAME in (‘MFG_ORGANIZATION_ID’,‘ORG_ID’,‘LOGIN_ID’,‘USER_ID’,‘USERNAME’
,‘GL_SET_OF_BKS_ID’,‘SO_ORGANIZATION_ID’,‘RESP_NAME’,‘RESP_ID’)
–找出对应的配置文件,存在如下表中:
select * from FND_PROFILE_OPTIONS_VL t where t.PROFILE_OPTION_NAME=‘OF_OPEN_PO_STATUS’
–通过以下功能 获取值 :
select fnd_profile.VALUE(‘OF_OPEN_PO_STATUS’) from dual;
–请求打印去掉科学计数法参考
xxcus_fa_gb_deprn_pkg.Main_Detail_Rp
–查看lookup属于哪个模块
select t.APPLICATION_ID,t.APPLICATION_SHORT_NAME,t.APPLICATION_NAME,v.LOOKUP_TYPE,v.LOOKUP_CODE,v.MEANING,v.DESCRIPTION
from apps.fnd_application_vl t,
apps.Fnd_Lookup_Values_Vl v
where t.APPLICATION_ID = v.VIEW_APPLICATION_ID
and v.LOOKUP_TYPE like ‘%ITEM_TYPE%’
–根据职责查找菜单名
select Ft.Responsibility_Name 责任名,
mb.menu_name 菜单名
FROM apps.FND_RESPONSIBILITY_TL FT,
apps.FND_RESPONSIBILITY FB,
apps.FND_MENUS MB
WHERE FB.RESPONSIBILITY_ID = FT.RESPONSIBILITY_ID
AND FB.APPLICATION_ID = FT.APPLICATION_ID
AND MB.MENU_ID = FB.MENU_ID
AND FT.LANGUAGE = USERENV(‘LANG’)
and Ft.Responsibility_Name like ‘%11_CST_深圳欧菲光_成本会计%’
–根据菜单名查找功能名
select mt.user_menu_name 用户菜单名,
mb.menu_name 菜单,
B.ENTRY_SEQUENCE 序号,
t.prompt 提示,
(select mb1.menu_name from apps.FND_MENUS MB1 where mb1.menu_id = b.sub_menu_id ) 子菜单,
(select ff.FUNCTION_NAME from apps.fnd_form_functions_vl ff where ff.FUNCTION_ID = b.function_id ) 功能,
(select ff.USER_FUNCTION_NAME from apps.fnd_form_functions_vl ff where ff.FUNCTION_ID = b.function_id ) 用户功能名,
t.description 说明
FROM apps.FND_MENUS_TL MT,
apps.FND_MENUS MB,
apps.FND_MENU_ENTRIES_TL T,
apps.FND_MENU_ENTRIES B
where mB.MENU_ID = mT.MENU_ID
AND mT.LANGUAGE = USERENV(‘LANG’)
and mt.user_menu_name like ‘%OF_CST_ACCOUNTING%’
and mb.menu_id = b.menu_id
and B.MENU_ID = T.MENU_ID
AND B.ENTRY_SEQUENCE = T.ENTRY_SEQUENCE
AND T.LANGUAGE = USERENV(‘LANG’)
order by B.ENTRY_SEQUENCE
–查看人员分配了那些职责
select distinct f.user_name 工号,f.description 姓名, fr.responsibility_name 职责
from apps.fnd_user_resp_groups_direct t,
applsys.fnd_user f,
applsys.fnd_responsibility_tl fr
where f.user_id = t.user_id
and fr.responsibility_id = t.RESPONSIBILITY_ID
and (fr.responsibility_name like ‘28%仓管用户%’ OR fr.responsibility_name like ‘28%发运人员%’)
and t.END_DATE is null
and f.end_date is null
order by f.description
–查询会计科目
SELECT Gcc.Segment2,
Gcc.Code_Combination_Id,
Gcc.Concatenated_Segments,
apps.Gl_Flexfields_Pkg.Get_Concat_Description(Gcc.Chart_Of_Accounts_Id,
Gcc.Code_Combination_Id,
‘N’) Acc_Desc --账户说明
FROM apps.Gl_Code_Combinations_Kfv Gcc
WHERE 1 = 1
and Gcc.Code_Combination_Id in
(select distinct msi.sales_account
from apps.Mtl_System_Items_b msi,
apps.MTL_ITEM_CATEGORIES_V mic,
apps.MTL_CATEGORIES_V mc
where 1 = 1
and msi.organization_id = 111
and msi.organization_id = mic.ORGANIZATION_ID
and msi.inventory_item_id = mic.INVENTORY_ITEM_ID
and mc.STRUCTURE_ID = 101
and mic.CATEGORY_ID = mc.CATEGORY_ID
and mic.CATEGORY_SET_ID = 1100000041
and (mc.CATEGORY_CONCAT_SEGS like ‘30%’ OR
mc.CATEGORY_CONCAT_SEGS like ‘20%’)
and msi.inventory_item_status_code = ‘Active’)
–查询职位分配
select f.employee_number,f.full_name,jp.name postion_name,A.EFFECTIVE_START_DATE,A.EFFECTIVE_END_DATE, a.person_id from
apps.PER_ALL_PEOPLE_F f,apps.PER_ALL_ASSIGNMENTS_F a ,apps.PER_JOBS j,PER_POSITIONS_V jp
where f.person_id = a.person_id
and a.job_id = j.job_id
and a.position_id = jp.position_id
and jp.job_id = j.job_id
–and f.employee_number = ‘N708807’
–and f.full_name like ‘%黄锦新%’
AND JP.NAME like ‘PO采购员.采购调达4’
and sysdate between f.EFFECTIVE_START_DATE and f.EFFECTIVE_END_DATE
and sysdate between a.EFFECTIVE_START_DATE and a.EFFECTIVE_END_DATE
–数据库修改列名
1、在oracle数据库中: ALTER TABLE 表名 RENAME COLUMN 列名 TO 新列名。
2、在sqlserver数据库中:exec sp_rename ‘[表名].[列名]‘,’[表名].[新列名]’。
3、在mysql数据库中:ALTER TABLE 表名 CHANGE 列名 新列名 列类型。
删除列;alter table 表名 drop column 列名
delete from xxcus_respon_temp;
insert into xxcus_respon_temp (USER_NAME,res_name) values(‘OSPUR101’,‘00_PO_南昌欧讯_采购开发’) ;
insert into xxcus_respon_temp (USER_NAME,res_name) values(‘OSPUR102’,‘11_PO_南昌欧迅微电子_请购员’) ;
insert into xxcus_respon_temp (USER_NAME,res_name) values(‘O1006’,‘11_PO_南昌欧迅微电子_采购查询’) ;
commit;
----物流费用计算方式
apps.XXCUS_INV_LOGI_PKG
–请购单跟采购单相连的表
select distinct msib.segment1 物料,
rh.segment1 申请号,
rl.line_num 申请行号,
rl.quantity 申请数量,
rl.unit_meas_lookup_code 申请单位,
ph.segment1 采购单号,
ood.ORGANIZATION_CODE 收货组织,
pl.line_num 采购行号,
pl.quantity 采购数量,
pl.unit_meas_lookup_code 采购单位,
pl.item_description,
rl.item_description,
pda.destination_subinventory
from po.po_lines_all pl,
inv.mtl_system_items_b msib,
po.po_headers_all ph,
apps.org_organization_definitions ood,
po.po_line_locations_all pll,
po.po_requisition_headers_all rh,
po.po_requisition_lines_all rl,
po.po_distributions_all pda
where 1 = 1
and msib.inventory_item_id = pl.item_id
and msib.inventory_item_id = rl.item_id
AND msib.organization_id = ood.ORGANIZATION_ID
and rh.requisition_header_id = rl.requisition_header_id
and pll.line_location_id = rl.line_location_id
and pll.po_line_id = pl.po_line_id
and pda.line_location_id =pll.line_location_id
and pda.po_line_id = pll.po_line_id
and pda.po_header_id = pll.po_header_id
/* and rl.source_req_line_id is not null*/
and ph.segment1 = ‘86400021488’
–and rh.segment1 = ‘53100107547’
/* and rl.org_id = 1601*/
and ph.po_header_id = pl.po_header_id
and ood.organization_id = pll.ship_to_organization_id
–条码调用webService 接口数据
SELECT vl.flex_value
,vl.flex_value_meaning
,vl.description
,vl.attribute1
,vl.attribute2
FROM apps.fnd_flex_values_vl vl
,apps.fnd_flex_value_sets vs
WHERE vs.flex_value_set_id = vl.flex_value_set_id
AND vs.flex_value_set_name = ‘CUX_WS_INTERFACE_CODE’
ORDER BY vl.CREATION_DATE DESC
–工艺路线缺少人工资源或制费资源
apps.XXCUS_CHECK_WIP_RESOURCES
–配置文件查询用户层值
SELECT V.USER_PROFILE_OPTION_NAME,
‘用户层’ 层级,
C.LEVEL_VALUE,
FU.USER_NAME,
C.PROFILE_OPTION_VALUE
FROM APPS.FND_PROFILE_OPTIONS_VL V,
APPS.FND_PROFILE_OPTION_VALUES C,
APPS.FND_USER FU
WHERE V.USER_PROFILE_OPTION_NAME LIKE ‘XXCUS_OA_DEPT%’
AND C.PROFILE_OPTION_ID = V.PROFILE_OPTION_ID
AND FU.USER_ID = C.LEVEL_VALUE
AND C.LEVEL_ID = 10004 --1000职责层ID
UNION ALL
SELECT v.user_profile_option_name
,‘职责层’ 层级
,c.level_value
,fv.responsibility_name
,c.profile_option_value
FROM fnd_profile_options_vl v
,fnd_profile_option_values c
,fnd_responsibility_vl fv
WHERE v.user_profile_option_name LIKE ‘MO%业务实体%’
AND c.profile_option_id = v.profile_option_id
AND fv.responsibility_id = c.level_value
AND c.level_id = 10003
299




被折叠的 条评论
为什么被折叠?



