EBS常用表_Dictionary
生活随笔
收集整理的這篇文章主要介紹了
EBS常用表_Dictionary
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
EBS常用表:轉載于?https://blog.csdn.net/xiariqingcao/article/details/8775827
1. OU、庫存組織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 --子庫存描述 FROM hr_organization_information hoi, --組織分類表 hr_operating_units hou, --ou視圖 org_organization_definitions ood, --庫存組織定義視圖 mtl_secondary_inventories msi --子庫存信息表 WHERE hoi.org_information1 = 'OPERATING_UNIT' ANDhoi.organization_id =hou.organization_id ANDood.operating_unit =hoi.organization_id ANDood.organization_id =msi.organization_id--獲取系統(tǒng)ID call fnd_global.APPS_INITIALIZE(1318,50583,401)select fnd_profile.VALUE('ORG_ID') FROM DUALselect * from hr_operating_units hou where hou.organization_id=204 2. 用戶、責任及HR--系統(tǒng)責任定義VIEW(FROM FND_RESPONSIBILITY_TL,FND_RESPONSIBILITY)SELECT APPLICATION_ID,RESPONSIBILITY_ID,RESPONSIBILITY_KEY,END_DATE,RESPONSIBILITY_NAME,DESCRIPTIONFROM FND_RESPONSIBILITY_VL;--用戶責任關系SELECT USER_ID, RESPONSIBILITY_ID FROM FND_USER_RESP_GROUPS;--用戶表SELECT USER_ID, USER_NAME, EMPLOYEE_ID,PERSON_PARTY_ID, END_DATEFROM FND_USER;--人員表VIEWSELECT PERSON_ID,START_DATE,DATE_OF_BIRTH,EMPLOYEE_NUMBER,NATIONAL_IDENTIFIER,SEX,FULL_NAMEFROM per_people_f;--綜合查詢SELECT USER_NAME, FULL_NAME,RESPONSIBILITY_NAME, CC.DESCRIPTIONFROM FND_USER AA,FND_USER_RESP_GROUPS BB,FND_RESPONSIBILITY_VL CC,per_people_f DDWHERE AA.USER_ID = BB.USER_IDANDBB.RESPONSIBILITY_ID = CC.RESPONSIBILITY_IDANDAA.EMPLOYEE_ID = DD.PERSON_IDAND RESPONSIBILITY_NAMElike '%供應處%'ORDER BY USER_NAME;--綜合查詢--人員狀況基本信息表SELECT PAF.PERSON_ID 系統(tǒng)ID,PAF.FULL_NAME 姓名,PAF.DATE_OF_BIRTH 出生日期,PAF.REGION_OF_BIRTH 出生地區(qū),PAF.NATIONAL_IDENTIFIER 身份證號,PAF.ATTRIBUTE1 招工來源,PAF.ATTRIBUTE3 員工類型,PAF.ATTRIBUTE11 集團合同號,PAF.original_date_of_hire 參加工作日期,PAF.PER_INFORMATION17 省份,DECODE(PAF.SEX,'M','男','F','女','NULL') 性別, --decode 適合和同一值做比較有多種結果,不適合和多種值比較有多種結果CASE PAF.SEXWHEN 'M' THEN '男'WHEN 'F' THEN '女'ELSE 'NULL'END 性別1, --case 用法一CASE WHEN TO_CHAR(PAF.DATE_OF_BIRTH, 'YYYY') < '1960' THEN '50年代'WHEN TO_CHAR(PAF.DATE_OF_BIRTH, 'YYYY') < '1970' THEN '60年代'WHEN TO_CHAR(PAF.DATE_OF_BIRTH, 'YYYY') < '1980' THEN '70年代'WHEN TO_CHAR(PAF.DATE_OF_BIRTH, 'YYYY') < '1990' THEN '80年代'WHEN TO_CHAR(PAF.DATE_OF_BIRTH, 'YYYY') < '2000' THEN '90年代'ELSE '21世紀' --case 用法二END 出生年代FROM PER_ALL_PEOPLE_F PAF3. 供應商VENDOR--供應商主表數(shù)據(jù):SELECT ass.vendor_id vendor_id,ass.party_id party_id,ass.segment1 vendor_code,ass.vendor_name vendor_name,ass.vendor_name vendor_short_name,ass.vendor_type_lookup_code vendor_type,flv.meaning vendor_type_meaning,hp.tax_reference tax_registered_name,ass.payment_method_lookup_codepayment_method,att.name term_name,att.enabled_flag enabled_flag,att.end_date_active end_date_active,ass.creation_date creation_date,ass.created_by created_by,ass.last_update_date last_update_date,ass.last_updated_by last_updated_by,ass.last_update_login last_update_loginFROM ap_suppliers ass,fnd_lookup_values flv,hz_parties hp,ap_terms_tl attWHERE ass.vendor_type_lookup_code = flv.lookup_code(+)ANDflv.lookup_type(+) = 'VENDORTYPE'ANDflv.language(+) = userenv('LANG')ANDass.party_id = hp.party_idANDatt.language = userenv('LANG')ANDass.terms_id = att.term_id(+)--供應商銀行信息SELECT ass.vendor_id vendor_id,ass.party_id party_id,bank.party_id bank_id,bank.party_name bank_name,branch.party_id branch_id,branch.party_name bank_branch_name,ieba.bank_account_num bank_account_numFROM ap_suppliers ass,hz_parties hp,iby_account_owners iao,iby_ext_bank_accounts ieba,hz_parties bank,hz_parties branchWHERE ass.party_id = hp.party_idANDhp.party_id = iao.account_owner_party_id(+)ANDiao.ext_bank_account_id = ieba.ext_bank_account_id(+)ANDieba.bank_id = bank.party_id(+)ANDieba.branch_id = branch.party_id(+)ORDER BY ieba.creation_date;--供應商開戶行地址信息SELECT hps.party_id party_id,hps.party_site_id party_site_id,hl.location_id location_id,hl.country country,hl.province province,hl.city city,hl.address1 address1,hl.address2 address2,hl.address3 address3,hl.address4 address4FROM hz_party_sites hps, hz_locations hlWHERE hps.location_id = hl.location_idORDER BY hps.creation_date--供應商聯(lián)系人信息SELECT hr.subject_id subject_id,hr.object_id object_id,hr.party_id party_id,hp.person_last_name || ' ' || hp.person_middle_name || ' ' ||hp.person_first_name contact_person,hcpp.phone_area_code phone_area_code,hcpp.phone_number phone_number,hcpp.phone_extension phone_extension,hcpf.phone_area_codefax_phone_area_code,hcpf.phone_number fax_phone_number,hcpe.email_address email_addressFROM hz_relationships hr,hz_contact_points hcpp,hz_contact_points hcpf,hz_contact_points hcpe,hz_parties hpWHERE hr.object_id = hp.party_idANDhcpp.owner_table_id(+) = hr.party_idANDhcpf.owner_table_id(+) = hr.party_idANDhcpe.owner_table_id(+) = hr.party_idANDhr.object_type = 'PERSON'ANDhr.relationship_code(+) = 'CONTACT'ANDhcpp.owner_table_name(+) = 'HZ_PARTIES'ANDhcpf.owner_table_name(+) = 'HZ_PARTIES'ANDhcpe.owner_table_name(+) = 'HZ_PARTIES'ANDhcpp.contact_point_type(+) = 'PHONE'ANDhcpp.phone_line_type(+) = 'GEN'ANDhcpf.contact_point_type(+) = 'PHONE'ANDhcpf.phone_line_type(+) = 'FAX'ANDhcpe.contact_point_type(+) = 'EMAIL'ANDhcpe.phone_line_type IS NULLORDER BY hr.creation_date;--供應商地址主信息SELECT assa.vendor_site_id vendor_site_id,assa.vendor_id vendor_id,assa.vendor_site_code vendor_code,assa.vendor_site_code address_short_name,assa.address_line1 address_line1,assa.address_line2 address_line2,assa.address_line3 address_line3,assa.address_line4 address_line4,assa.org_id org_id,assa.country country,assa.province province,assa.city city,assa.county county,assa.zip zip,assa.pay_site_flag pay_site_flag,assa.purchasing_site_flagpurchasing_site_flag,assa.inactive_date inactive_date,assa.creation_date creation_date,assa.created_by created_by,assa.last_update_date last_update_date,assa.last_updated_by last_updated_by,assa.last_update_login last_update_loginFROM ap_suppliers ass, ap_supplier_sites_all assaWHERE assa.vendor_id = ass.vendor_id;--供應商地址聯(lián)系人信息:phone、fax和EmailSELECT hcpp.phone_area_codephone_area_code,hcpp.phone_number phone_number,hcpp.phone_extension phone_extension,hcpf.phone_area_codefax_phone_area_code,hcpf.phone_number fax_phone_number,hcpe.email_address email_addressFROM ap_supplier_sites_all assa,hz_contact_points hcpp,hz_contact_points hcpf,hz_contact_points hcpe,hz_party_sites hpsWHERE assa.party_site_id = hps.party_site_idANDhcpp.owner_table_id(+) = assa.party_site_idANDhcpf.owner_table_id(+) = assa.party_site_idANDhcpe.owner_table_id(+) = assa.party_site_idANDhcpp.owner_table_name(+) = 'HZ_PARTY_SITES'ANDhcpf.owner_table_name(+) = 'HZ_PARTY_SITES'ANDhcpe.owner_table_name(+) = 'HZ_PARTY_SITES'ANDhcpp.contact_point_type(+) = 'PHONE'ANDhcpp.phone_line_type(+) = 'GEN'ANDhcpf.contact_point_type(+) = 'PHONE'ANDhcpf.phone_line_type(+) = 'FAX'ANDhcpe.contact_point_type(+) = 'EMAIL'ANDhcpe.phone_line_type IS NULL;--供應商地址收件人信息SELECT assa.party_site_idFROM ap_supplier_sites_all assa--根據(jù)party_site_id得到供應商地址的收件人名稱 SELECT hps.addressee FROM hz_party_sites hps;--供應商銀行帳戶分配層次關系SELECT * FROM iby_pmt_instr_uses_all;--供應商銀行帳戶分配層次關系明細(不包括供應商層的分配信息):SELECT * FROM iby_external_payees_all;4. 客戶CUSTOMER--SQL 查詢--客戶賬戶表 以許繼1063 電網(wǎng)客戶為例-->>PARTY_ID = 21302SELECT * FROM hz_cust_accounts AA WHERE AA.CUST_ACCOUNT_ID = 1063;--客戶名稱及地址全局信息表 -->> PARTY_NUMBER = 19316SELECT * FROM hz_parties AA WHERE AA.PARTY_ID = 21302;--客戶地點賬戶主文件SELECT * FROM hz_cust_acct_sites_all WHERE CUST_ACCOUNT_ID = 1063;--客戶地點 (關聯(lián)hz_cust_acct_sites_all)SELECT * FROM HZ_PARTY_SITES WHERE PARTY_ID = 21302;--地點地址名稱 (關聯(lián)hz_cust_acct_sites_all)SELECT AA.ADDRESS1, AA.ADDRESS_KEYFROM HZ_LOCATIONS AA, HZ_PARTY_SITES BBWHERE AA.LOCATION_ID = BB.LOCATION_IDANDBB.PARTY_ID = 21302;--客戶地點業(yè)務目的 (關聯(lián)hz_cust_acct_sites_all 用CUST_ACCT_SITE_ID)SELECT * FROM HZ_CUST_SITE_USES_ALL;--客戶地點詳細信息表,以供應處OU的身份 ORG_ID = 119SELECT AA.PARTY_SITE_ID 客戶組織地點ID,AA.PARTY_ID 客戶組織ID,AA.LOCATION_ID 地點ID,AA.PARTY_SITE_NUMBER 地點編號,AA.IDENTIFYING_ADDRESS_FLAG 地址標示,AA.STATUS 有效否,AA.PARTY_SITE_NAME,BB.ORG_ID 業(yè)務實體,BB.bill_to_flag 收單標示,BB.ship_to_flag 收貨標示,CC.ADDRESS1 地點名稱,DD.SITE_USE_ID,DD.SITE_USE_CODE,DD.PRIMARY_FLAG,DD.STATUS,DD.LOCATION 業(yè)務目的,DD.BILL_TO_SITE_USE_ID 收單地ID,DD.TAX_CODEFROM hz_party_sites AA,hz_cust_acct_sites_all BB,hz_locations CC,HZ_CUST_SITE_USES_ALL DDWHERE AA.PARTY_SITE_ID = BB.PARTY_SITE_IDANDBB.CUST_ACCOUNT_ID = 1063ANDBB.ORG_ID = 119ANDAA.STATUS = 'A'ANDAA.LOCATION_ID = CC.LOCATION_IDANDBB.CUST_ACCT_SITE_ID(+) = DD.CUST_ACCT_SITE_IDANDDD.STATUS <> 'I';--*************綜合查詢************----客戶主數(shù)據(jù)SELECT hca.cust_account_id customer_id,hp.party_number customer_number,hp.party_name customer_name,hp.party_name customer_short_name,hca.customer_type customer_type,alt.meaning customer_type_meaning,hca.customer_class_code customer_class,alc.meaning customer_class_meaning,hp.tax_reference tax_registered_name,rt.name term_name,hca.creation_date creation_date,hca.created_by created_by,hca.last_update_date last_update_date,hca.last_updated_by last_updated_by,hca.last_update_login last_update_loginFROM hz_parties hp,hz_cust_accounts hca,ar_lookups alt,ar_lookups alc,hz_customer_profiles hcp,ra_terms rtWHERE hp.party_id = hca.party_idANDhca.customer_type = alt.lookup_code(+)ANDalt.lookup_type = 'CUSTOMER_TYPE'ANDhca.customer_class_code = alc.lookup_code(+)ANDalc.lookup_type(+) = 'CUSTOMERCLASS'ANDhca.cust_account_id = hcp.cust_account_id(+)ANDhcp.standard_terms = rt.term_id(+)--客戶收款方法SQLSELECT arm.name receipt_method_nameFROM hz_cust_accounts hca,ra_cust_receipt_methods rcrm,ar_receipt_methods armWHERE hca.cust_account_id =rcrm.customer_idANDrcrm.receipt_method_id = arm.receipt_method_idORDER BYrcrm.creation_date;--客戶賬戶層銀行賬戶信息SQLSELECT hca.cust_account_id cust_account_id,hp.party_id party_id,bank.party_id bank_id,bank.party_name bank_name,branch.party_id branch_id,branch.party_name bank_branch_name,ieba.bank_account_num bank_account_numFROM hz_cust_accounts hca,hz_parties hp,iby_account_owners iao,iby_ext_bank_accounts ieba,hz_parties bank,hz_parties branchWHERE hca.party_id = hp.party_idANDhp.party_id = iao.account_owner_party_id(+)ANDiao.ext_bank_account_id = ieba.ext_bank_account_id(+)ANDieba.bank_id = bank.party_id(+)ANDieba.branch_id = branch.party_id(+)ORDER BY ieba.creation_date;--客戶開戶行地址信息SQLSELECT hl.country || '-' || hl.province || '-' || hl.city || '-' ||hl.address1 || '-' || hl.address2 || '-' || hl.address3 || '-' ||hl.address4 bank_addressFROM hz_party_sites hps, hz_locations hlWHERE hps.location_id = hl.location_idORDER BYhps.creation_date;--客戶賬戶層聯(lián)系人信息:聯(lián)系人、電話、手機和Email SQLSELECT hr.party_id party_id,hcar.cust_account_id cust_account_id,hcar.cust_acct_site_idcust_acct_site_id,hp.person_last_name || ' ' || hp.person_middle_name || ' ' ||hp.person_first_name contact_person,hcpp.phone_area_code phone_area_code,hcpp.phone_number phone_number,hcpp.phone_extension phone_extension,hcpm.phone_area_codemobile_phone_area_code,hcpm.phone_number mobile_phone_number,hcpe.email_address email_addressFROM hz_relationships hr,hz_cust_account_roles hcar,hz_org_contacts hoc,hz_contact_points hcpp,hz_contact_points hcpm,hz_contact_points hcpe,hz_parties hp,hz_cust_accounts hcaWHERE hr.object_id = hp.party_idANDhr.party_id = hcar.party_idANDhr.relationship_id = hoc.party_relationship_id(+)ANDhcpp.owner_table_id(+) = hr.party_idANDhcpm.owner_table_id(+) = hr.party_idANDhcpe.owner_table_id(+) = hr.party_idANDhr.object_type = 'PERSON'ANDhr.relationship_code(+) = 'CONTACT'ANDhcpp.owner_table_name(+) = 'HZ_PARTIES'ANDhcpm.owner_table_name(+) = 'HZ_PARTIES'ANDhcpe.owner_table_name(+) = 'HZ_PARTIES'ANDhcpp.contact_point_type(+) = 'PHONE'ANDhcpp.phone_line_type(+) = 'GEN'ANDhcpm.contact_point_type(+) = 'PHONE'ANDhcpm.phone_line_type(+) = 'MOBILE'ANDhcpe.contact_point_type(+) = 'EMAIL'ANDhcpe.phone_line_type IS NULLANDhr.subject_id = hca.party_idANDhcar.cust_acct_site_id IS NULLORDER BY hr.creation_date;--客戶地址SELECT hcasa.cust_acct_site_idcustomer_site_id,hcasa.cust_account_id customer_id,hps.party_site_number customer_site_code,hps.party_site_name customer_site_name,hl.address1 address_line1,hl.address2 address_line2,hl.address3 address_line3,hl.address4 address_line4,hcasa.org_id org_id,hl.country country,hl.province province,hl.city city,hl.county county,hl.postal_code zip,hcasa.bill_to_flag bill_to_flag,hcasa.ship_to_flag ship_to_flag,hca.creation_date creation_date,hca.created_by created_by,hca.last_update_date last_update_date,hca.last_updated_by last_updated_by,hca.last_update_login last_update_loginFROM hz_cust_accounts hca,hz_cust_acct_sites_all hcasa,hz_party_sites hps,hz_locations hlWHERE hca.cust_account_id = hcasa.cust_account_idANDhcasa.party_site_id = hps.party_site_idANDhps.location_id = hl.location_id;--客戶賬戶層地址contact person信息:phone,mobile,emailSELECT hr.party_id party_id,hcar.cust_account_id cust_account_id,hcar.cust_acct_site_idcust_acct_site_id,hp.person_last_name || ' ' || hp.person_middle_name || ' ' ||hp.person_first_name contact_person,hcpp.phone_area_code phone_area_code,hcpp.phone_number phone_number,hcpp.phone_extension phone_extension,hcpm.phone_area_codemobile_phone_area_code,hcpm.phone_number mobile_phone_number,hcpe.email_address email_addressFROM hz_relationships hr,hz_cust_account_roles hcar,hz_org_contacts hoc,hz_contact_points hcpp,hz_contact_points hcpm,hz_contact_points hcpe,hz_parties hp,hz_cust_accounts hcaWHERE hr.object_id = hp.party_idANDhr.party_id = hcar.party_idANDhr.relationship_id = hoc.party_relationship_id(+)ANDhcpp.owner_table_id(+) = hr.party_idANDhcpm.owner_table_id(+) = hr.party_idANDhcpe.owner_table_id(+) = hr.party_idANDhr.object_type = 'PERSON'ANDhr.relationship_code(+) = 'CONTACT'ANDhcpp.owner_table_name(+) = 'HZ_PARTIES'ANDhcpm.owner_table_name(+) = 'HZ_PARTIES'ANDhcpe.owner_table_name(+) = 'HZ_PARTIES'ANDhcpp.contact_point_type(+) = 'PHONE'ANDhcpp.phone_line_type(+) = 'GEN'ANDhcpm.contact_point_type(+) = 'PHONE'ANDhcpm.phone_line_type(+) = 'MOBILE'ANDhcpe.contact_point_type(+) = 'EMAIL'ANDhcpe.phone_line_type IS NULLANDhr.subject_id = hca.party_idANDhca.cust_account_id = hcar.cust_account_idORDER BY hr.creation_date;--客戶賬戶地點地址SELECT hp.party_id,hca.cust_account_id,hcasa.cust_acct_site_id,hcasa.bill_to_flag,hcasa.ship_to_flag,hcsua.site_use_id,hcasa.party_site_id,hcsua.site_use_code,hcsua.primary_flag,hcsua.location,hcsua.org_idFROM hz_parties hp,hz_cust_accounts hca,hz_party_sites hps,hz_cust_acct_sites_all hcasa,hz_cust_site_uses_all hcsuaWHERE hp.party_id = hca.party_idANDhca.cust_account_id = hcasa.cust_account_idANDhcasa.party_site_id = hps.party_site_idANDhcsua.cust_acct_site_id = hcasa.cust_acct_site_id--客戶主配置文件SELECT * FROM hz_cust_profile_classes;SELECT * FROM hz_customer_profiles;SELECT * FROM hz_cust_prof_class_amts;SELECT * FROM hz_cust_profile_amts;5. 訂單OE-- select * from oe_order_headers_all 銷售頭select * from oe_order_lines_all 銷售行select * from wsh_new_deliveries 發(fā)送select * from wsh_delivery_detailsselect * from wsh_delivery_assignments--綜合查詢1-未結銷售訂單SELECT H.ORDER_NUMBER 銷售訂單,h.cust_po_number 客戶PO,cust.account_number 客戶編碼,hp.party_name 客戶名稱,ship_use.location 收貨地,bill_use.location 收單地,h.ordered_date 訂單日期,H.ATTRIBUTE1 合同號,h.attribute2 屏號,h.attribute3 來源編碼,l.line_number 行號,l.ordered_item 物料,msi.description 物料說明,l.order_quantity_uom 訂購單位,l.ordered_quantity 訂購數(shù)量,l.cancelled_quantity 取消數(shù)量,l.shipped_quantity 發(fā)運數(shù)量,l.schedule_ship_date 計劃發(fā)運日期,l.booked_flag 登記標記,ol.MEANING 工作流狀態(tài),l.cancelled_flag 取消標記FROM OE_ORDER_HEADERS_ALL H,OE_ORDER_LINES_ALL L,HZ_CUST_ACCOUNTS CUST,hz_parties hp,hz_cust_site_uses_all ship_use,hz_cust_site_uses_all bill_use,mtl_system_items_b msi,oe_lookups olWHERE 1 = 1ANDH.HEADER_ID = L.HEADER_IDANDH.SOLD_TO_ORG_ID = CUST.CUST_ACCOUNT_IDandcust.party_id = hp.party_idandh.ship_to_org_id = ship_use.site_use_idandh.invoice_to_org_id = bill_use.site_use_idandl.flow_status_code not in ('CLOSED', 'CANCELLED')andl.inventory_item_id = msi.inventory_item_idandmsi.organization_id = 141andl.flow_status_code = ol.LOOKUP_CODEandol.LOOKUP_TYPE = 'LINE_FLOW_STATUS'ANDCUST.ACCOUNT_NUMBER IN ('91010072', '91010067', '91010036')order by party_name,收貨地,銷售訂單; 6. 采購申請PR--申請單頭 (以電網(wǎng)組織ORG_ID=112 內部申請 =14140002781 為例SELECT PRH.REQUISITION_HEADER_ID 申請單頭ID,PRH.PREPARER_ID,PRH.Org_Id OU_ID,PRH.SEGMENT1 申請單編號,PRH.Creation_Date 創(chuàng)建日期,PRH.Created_By 編制人ID,FU.USER_NAME 用戶名稱,PP.FULL_NAME 用戶姓名,PRH.Approved_Date 批準日期,PRH.Description 說明,PRH.Authorization_Status 狀態(tài),PRH.Type_Lookup_Code 類型,PRH.Transferred_To_Oe_Flag 傳遞標示FROM PO_REQUISITION_HEADERS_ALL PRH, FND_USER FU, per_people_f PPWHERE PRH.CREATED_BY = FU.USER_IDANDFU.EMPLOYEE_ID = PP.PERSON_IDANDPRH.ORG_ID = 112ANDPRH.SEGMENT1 = '14140002781';-->>內部申請 =14140002781 申請單頭ID = 3379 --申請單行明細SELECT PRL.REQUISITION_HEADER_ID 申請單ID,PRL.REQUISITION_LINE_ID 行ID,PRL.LINE_NUM 行號,PRL.CATEGORY_ID 分類ID,PRL.ITEM_ID 物料ID,ITEM.SEGMENT1 物料編碼,PRL.ITEM_DESCRIPTION 物料說明,PRL.Quantity 需求數(shù),PRL.Quantity_Delivered 送貨數(shù),PRL.Quantity_Cancelled 取消數(shù),PRL.Unit_Meas_Lookup_Code 單位,PRL.Unit_Price 參考價,PRL.Need_By_Date 需求日期,PRL.Source_Type_Code 來源類型,PRL.Org_Id OU_ID,PRL.Source_Organization_Id 對方組織ID,PRL.Destination_Organization_Id 本方組織IDfrom PO_REQUISITION_LINES_ALL PRL,MTL_SYSTEM_ITEMS ITEMWHERE PRL.ORG_ID = 112ANDPRL.ITEM_ID = ITEM.INVENTORY_ITEM_IDANDPRL.Destination_Organization_Id = ITEM.ORGANIZATION_IDANDPRL.REQUISITION_HEADER_ID = 3379;--申請單頭 (加對方訂單編號)SELECT PRH.REQUISITION_HEADER_ID 申請單頭ID,PRH.PREPARER_ID,PRH.Org_Id OU_ID,PRH.SEGMENT1 申請單編號,PRH.Creation_Date 創(chuàng)建日期,PRH.Created_By 編制人ID,FU.USER_NAME 用戶名稱,PP.FULL_NAME 用戶姓名,PRH.Approved_Date 批準日期,PRH.Description 說明,PRH.Authorization_Status 狀態(tài),PRH.Type_Lookup_Code 類型,PRH.Transferred_To_Oe_Flag 傳遞標示,OEH.ORDER_NUMBER 對方CO編號FROM PO_REQUISITION_HEADERS_ALL PRH, FND_USER FU, per_people_fPP,OE_ORDER_HEADERS_ALL OEHWHERE PRH.CREATED_BY = FU.USER_IDANDFU.EMPLOYEE_ID = PP.PERSON_IDANDPRH.REQUISITION_HEADER_ID = OEH.SOURCE_DOCUMENT_ID(+)ANDPRH.ORG_ID = 112ANDPRH.SEGMENT1 = '14140002781';--(銷售訂單記錄有對方 OU_ID,申請單關鍵字SOURCE_DOCUMENT_ID 申請單號SOURCE_DOCEMENT_REF)*******************綜合查詢類*******************--申請單頭綜合查詢 (進限制只能查詢 --電網(wǎng)組織ORG_ID=112)SELECT PRH.REQUISITION_HEADER_ID 申請單頭ID,PRH.Org_Id 組織ID,PRH.SEGMENT1 申請單編號,PRH.Creation_Date 創(chuàng)建日期,PRH.Created_By 編制人ID,FU.USER_NAME 用戶名稱,PP.FULL_NAME 用戶姓名,PRH.Approved_Date 批準日期,PRH.Description 說明,PRH.Authorization_Status 狀態(tài),PRH.Type_Lookup_Code 類型,PRH.Transferred_To_Oe_Flag 傳遞標示,PRL.REQUISITION_LINE_ID 行ID,PRL.LINE_NUM 行號,PRL.CATEGORY_ID 分類ID,PRL.ITEM_ID 物料ID,ITEM.SEGMENT1 物料編碼,PRL.ITEM_DESCRIPTION 物料說明,PRL.Quantity 需求數(shù),PRL.Quantity_Delivered 送貨數(shù),PRL.Quantity_Cancelled 取消數(shù),PRL.Unit_Meas_Lookup_Code 單位,PRL.Unit_Price 參考價,PRL.Need_By_Date 需求日期,PRL.Source_Type_Code 來源類型,PRL.Source_Organization_Id 對方組織ID,PRL.Destination_Organization_Id 本方組織IDFROM PO_REQUISITION_HEADERS_ALL PRH,FND_USER FU,per_people_f PP,PO_REQUISITION_LINES_ALL PRL,MTL_SYSTEM_ITEMS ITEMWHERE PRH.CREATED_BY = FU.USER_IDANDFU.EMPLOYEE_ID = PP.PERSON_IDANDPRH.REQUISITION_HEADER_ID = PRL.REQUISITION_HEADER_IDANDPRH.Org_Id = PRL.ORG_IDANDPRL.ITEM_ID = ITEM.INVENTORY_ITEM_IDANDPRL.Destination_Organization_Id = ITEM.ORGANIZATION_IDANDPRH.ORG_ID = 112;--若需創(chuàng)建視圖只需在 SELECT 語句前加上CREATE OR REPLACE VIEW CUX_INV_PR112 AS 7. 采購訂單PO--采購單頭信息 TYPE_LOOKUP_CODE='STANDARD' (以供應處OU ORG_ID=119 采購單='' 為例)--類型說明 TYPE_LOOKUP_CODE='STANDARD'為采購單 TYPE_LOOKUP_CODE='BLANKET'為采購協(xié)議SELECT POH.ORG_ID OU_ID,POH.PO_HEADER_ID 采購單頭ID,POH.TYPE_LOOKUP_CODE 類型,POH.AUTHORIZATION_STATUS 狀態(tài),POH.VENDOR_ID 供應商ID,VENDOR.VENDOR_NAME 供應商名,POH.VENDOR_SITE_ID 供應商地址ID,POH.VENDOR_CONTACT_ID 供應商聯(lián)系人ID,POH.SHIP_TO_LOCATION_ID 本方收貨地ID,POH.BILL_TO_LOCATION_ID 本方收單地ID,POH.CREATION_DATE 創(chuàng)建日期,POH.APPROVED_FLAG 審批YN,POH.APPROVED_DATE 審批日期,POH.COMMENTS 采購單說明,POH.TERMS_ID 條款ID,POH.AGENT_ID 采購員ID,AGT_PP.LAST_NAME 采購員, POH.CREATED_BY 創(chuàng)建者ID,FU.USER_NAME 創(chuàng)建用戶,PP.FULL_NAME 用戶姓名FROM PO_HEADERS_ALL POH, FND_USER FU, per_people_f PP,PER_ALL_PEOPLE_FAGT_PP,ap_suppliers VENDORWHERE POH.CREATED_BY = FU.USER_IDANDFU.EMPLOYEE_ID = PP.PERSON_IDANDPOH.AGENT_ID = AGT_PP.PERSON_IDANDPOH.VENDOR_ID=VENDOR.VENDOR_IDANDPOH.ORG_ID = 119ANDPOH.TYPE_LOOKUP_CODE = 'STANDARD'ANDPOH.SEGMENT1 = '14730005436';/*FND_USER FU, per_people_f PP 用戶相關表po_agents_name_v 采購員視圖 ----> PO_AGENTS.AGENT_ID =PER_ALL_PEOPLE_F.PERSON_ID 采購員相關表ap_suppliers 供應商主表*/-->>POH.SEGMENT1 = '14730005436' PO_HEADER_ID = 10068--采購單行信息SELECT POL.ORG_ID OU_ID,POL.PO_HEADER_ID 采購單頭ID,POL.PO_LINE_ID 行ID,POL.LINE_NUM 行號,POL.ITEM_ID 物料ID,ITEM.SEGMENT1 物料編碼,POL.ITEM_DESCRIPTION 物料說明,POL.UNIT_MEAS_LOOKUP_CODE 單位,POL.UNIT_PRICE 單價,PO_LCT.QUANTITY 訂購數(shù),PO_LCT.QUANTITY_RECEIVED 驗收數(shù),PO_LCT.QUANTITY_ACCEPTED 接收數(shù),PO_LCT.QUANTITY_REJECTED 拒絕數(shù),PO_LCT.QUANTITY_CANCELLED 取消數(shù),PO_LCT.QUANTITY_BILLED 到票數(shù),PO_LCT.PROMISED_DATE 承諾日期,PO_LCT.NEED_BY_DATE 需求日期FROM PO_LINES_ALL POL,Po_Line_Locations_all PO_LCT,MTL_SYSTEM_ITEMS ITEMWHERE POL.ORG_ID = PO_LCT.ORG_IDANDPOL.PO_LINE_ID = PO_LCT.PO_LINE_IDANDPOL.ITEM_ID = ITEM.INVENTORY_ITEM_IDANDITEM.ORGANIZATION_ID = 142ANDPOL.Org_Id = 119ANDPOL.PO_HEADER_ID = 10068;--說明:Po_Line_Locations_all 系“發(fā)運表”--綜合查詢1,所分配給供應處組織的物料,存在采購協(xié)議,但缺失采購員或缺失倉庫;select MSIF.Segment1 物料編碼,MSIF.Description 物料描述,MSIF.LONG_DESCRIPTION 物料詳細描述,--MSIF.primary_unit_of_measure 計量單位, PRF.LAST_NAME 采購員,MISD.subinventory_code 默認接收庫存,PLA.unit_price 未稅價,round(PLA.unit_price * (1 + ZRB.percentage_rate / 100), 2) 含稅價,PV.VENDOR_NAME 供應商名稱from apps.PO_HEADERS_ALL PHA,apps.PO_LINES_ALL PLA,apps.MTL_SYSTEM_ITEMS_FVL MSIF,apps.MTL_ITEM_SUB_DEFAULTS MISD,apps.PER_PEOPLE_F PRF,apps.PO_VENDORS PV,apps.PO_VENDOR_SITES_ALL PVSA,apps.ZX_RATES_B ZRBwhere PHA.Type_Lookup_Code = 'BLANKET' and PHA.Org_Id = 119 andPHA.PO_HEADER_ID = PLA.Po_Header_Id andPHA.Global_Agreement_Flag = 'Y' andPHA.Approved_Flag in ('Y', 'R') andNVL(PHA.end_Date,sysdate) >= sysdate andNVL(PLA.Expiration_Date,sysdate) >= sysdate andPLA.Cancel_Flag = 'N' andPLA.Item_Id = MSIF.INVENTORY_ITEM_ID andMSIF.ORGANIZATION_ID = 142 andMSIF.INVENTORY_ITEM_ID =MISD.INVENTORY_ITEM_ID(+) andMISD.ORGANIZATION_ID(+) = 142 andMISD.default_type(+) = 2 andMSIF.BUYER_ID = PRF.PERSON_ID(+) andPRF.EFFECTIVE_END_DATE(+) = to_date('4712-12-31', 'YYYY-MM-DD') andPHA.VENDOR_ID = PV.VENDOR_ID andPHA.Vendor_Site_Id = PVSA.VENDOR_SITE_IDandPVSA.VAT_CODE = ZRB.tax_rate_code and(MISD.subinventory_code is null orPRF.LAST_NAME is null)--采購其他相關表select * from po_distributions_all 分配select * from po_releases_allselect * from rcv_shipment_headers 采購接收頭select * from rcv_shipment_lines 采購接收行select * from rcv_transactions 接收事務處理select * from po_agentsselect * from po_vendorsselect * from po_vendor_sites_all8. 庫存INV--物料主表select MSI.ORGANIZATION_ID 組織ID,MSI.INVENTORY_ITEM_ID 物料ID,MSI.SEGMENT1 物料編碼,MSI.DESCRIPTION 物料說明,MSI.ITEM_TYPE 項目類型,MSI.PLANNING_MAKE_BUY_CODE 制造或購買,MSI.PRIMARY_UNIT_OF_MEASURE 基本度量單位,MSI.BOM_ENABLED_FLAG BOM標志,MSI.INVENTORY_ASSET_FLAG 庫存資產否,MSI.BUYER_ID 采購員ID,MSI.PURCHASING_ENABLED_FLAG 可采購否,MSI.PURCHASING_ITEM_FLAG 采購項目,MSI.UNIT_OF_ISSUE 單位,MSI.INVENTORY_ITEM_FLAG 是否為庫存,MSI.LOT_CONTROL_CODE 是否批量,MSI.RESERVABLE_TYPE 是否要預留,MSI.STOCK_ENABLED_FLAG 能否庫存,MSI.FIXED_DAYS_SUPPLY 固定提前期,MSI.FIXED_LOT_MULTIPLIER 固定批量大小,MSI.INVENTORY_PLANNING_CODE 庫存計劃方法,MSI.MAXIMUM_ORDER_QUANTITY 最大定單數(shù),MSI.MINIMUM_ORDER_QUANTITY 最小定單數(shù),MSI.FULL_LEAD_TIME 固定提前期,MSI.PLANNER_CODE 計劃員碼,MISD.SUBINVENTORY_CODE 接收子倉庫,MSI.SOURCE_SUBINVENTORY 來源子倉庫,MSI.WIP_SUPPLY_SUBINVENTORY 供應子倉庫,MSI.ATTRIBUTE12 老編碼,MSI.INVENTORY_ITEM_STATUS_CODE 物料狀態(tài),MSS.SAFETY_STOCK_QUANTITY 安全庫存量 from mtl_system_items MSI, MTL_ITEM_SUB_DEFAULTS MISD,mtl_safety_stocks MSSwhere MSI.ORGANIZATION_ID = MISD.ORGANIZATION_ID(+)andMSI.INVENTORY_ITEM_ID = MISD.INVENTORY_ITEM_ID(+)andMSI.ORGANIZATION_ID = MSS.ORGANIZATION_ID(+)andMSI.INVENTORY_ITEM_ID = MSS.INVENTORY_ITEM_ID(+)andMSI.ORGANIZATION_ID = 1155andMSI.SEGMENT1 = '18020200012'--物料庫存數(shù)量SELECT MOQ.ORGANIZATION_ID,MOQ.INVENTORY_ITEM_ID,MOQ.SUBINVENTORY_CODE,SUM(MOQ.TRANSACTION_QUANTITY)QTYFROM mtl_onhand_quantities MOQWHERE MOQ.INVENTORY_ITEM_ID = 12781ANDMOQ.ORGANIZATION_ID = 1155GROUP BY MOQ.ORGANIZATION_ID,MOQ.INVENTORY_ITEM_ID, MOQ.SUBINVENTORY_CODE;--移動平均成本SELECT CST.INVENTORY_ITEM_ID ITEM_ID,CST.ORGANIZATION_ID ORG_ID,CST.COST_TYPE_ID 成本類型,CST.ITEM_COST 單位成本,CST.MATERIAL_COST 材料成本,CST.MATERIAL_OVERHEAD_COST 間接費,CST.Resource_Cost 人工費,CST.OUTSIDE_PROCESSING_COST 外協(xié)費,CST.OVERHEAD_COST 制造費FROM CST_ITEM_COSTS CSTWHERE CST.COST_TYPE_ID = 2AND CST.INVENTORY_ITEM_ID = 12781ANDCST.ORGANIZATION_ID = 1155;--綜合查詢-庫存數(shù)量及成本SELECT MSI.ORGANIZATION_ID 組織ID,MSI.INVENTORY_ITEM_ID 物料ID,MSI.SEGMENT1 物料編碼,MSI.DESCRIPTION 物料說明,MSI.PLANNING_MAKE_BUY_CODE M1P2,MOQV.SUBINVENTORY_CODE 子庫存,MOQV.QTY 當前庫存量,CST.ITEM_COST 單位成本,CST.MATERIAL_COST 材料成本,CST.MATERIAL_OVERHEAD_COST 間接費,CST.Resource_Cost 人工費,CST.OUTSIDE_PROCESSING_COST 外協(xié)費,CST.OVERHEAD_COST 制造費FROM MTL_SYSTEM_ITEMS MSI,CST_ITEM_COSTS CST,(SELECT MOQ.ORGANIZATION_ID,MOQ.INVENTORY_ITEM_ID,MOQ.SUBINVENTORY_CODE,SUM(MOQ.TRANSACTION_QUANTITY) QTYFROM mtl_onhand_quantities MOQWHERE MOQ.ORGANIZATION_ID = 1155GROUP BY MOQ.ORGANIZATION_ID,MOQ.INVENTORY_ITEM_ID,MOQ.SUBINVENTORY_CODE) MOQVWHERE MSI.ORGANIZATION_ID = CST.ORGANIZATION_ID(+)ANDMSI.INVENTORY_ITEM_ID = CST.INVENTORY_ITEM_ID(+)ANDMSI.ORGANIZATION_ID = MOQV.ORGANIZATION_ID(+)ANDMSI.INVENTORY_ITEM_ID = MOQV.INVENTORY_ITEM_ID(+)ANDCST.COST_TYPE_ID = 2ANDMSI.ORGANIZATION_ID = 1155ANDMSI.SEGMENT1 = '18020200012'--子庫存列表SELECT * FROM mtl_secondary_inventories;--貨位列表 SELECT ORGANIZATION_ID 組織代碼,INVENTORY_LOCATION_ID 貨位內碼,SUBINVENTORY_CODE 子庫名稱,SEGMENT1 貨位編碼FROM mtl_item_locations;--計劃員表 SELECT PLANNER_CODE 計劃員代碼,ORGANIZATION_ID 組織代碼,DESCRIPTION 計劃員描述,MP.EMPLOYEE_ID 員工ID,DISABLE_DATE 失效日期FROM mtl_planners MP;--科目設置等參數(shù)select * from MTL_PARAMETERS MP9. 物料清單BOM--BOM主表bom_bill_of_materialsselect AA.BILL_SEQUENCE_ID 清單序號,AA.ASSEMBLY_ITEM_ID 裝配件內碼,AA.ORGANIZATION_ID 組織代碼,BB.SEGMENT1 物料編碼,BB.DESCRIPTION 物料說明,AA.ASSEMBLY_TYPE 裝配類別from bom_bill_of_materials AA,mtl_system_items BBwhere AA.ASSEMBLY_ITEM_ID = BB.INVENTORY_ITEM_IDandAA.ORGANIZATION_ID = BB.ORGANIZATION_ID;--BOM明細表bom_inventory_componentsselect BILL_SEQUENCE_ID 清單序號,COMPONENT_SEQUENCE_ID 構件序號,ITEM_NUM 項目序列,OPERATION_SEQ_NUM 操作序列號,COMPONENT_ITEM_ID 子物料內碼,COMPONENT_QUANTITY 構件數(shù)量,DISABLE_DATE 失效日期,supply_subinventory 供應子庫存,BOM_ITEM_TYPEfrom bom_inventory_components;--BOM明細綜合查詢 ( 組織 限定供應處142 裝配件 = '5XJ061988')SELECT VBOM.BID 清單序號,VBOM.F_ITEMID 裝配件內碼,BB.SEGMENT1 物料編碼,BB.DESCRIPTION 物料說明,VBOM.OGT_ID 組織內碼,VBOM.CID 操作ID,VBOM.ITEM_NUM 物料序號,VBOM.OPID 工序,VBOM.C_ITEMID 子物料內碼,CC.SEGMENT1 物料編碼,CC.DESCRIPTION 物料說明,VBOM.QTY 構件數(shù)量,CC.PRIMARY_UOM_CODE 子計量單位碼,CC.PRIMARY_UNIT_OF_MEASURE 子計量單位名,VBOM.WHSE 供應子倉庫FROM (select AA.BILL_SEQUENCE_ID BID,BB.ASSEMBLY_ITEM_ID F_ITEMID,BB.ORGANIZATION_ID OGT_ID,AA.COMPONENT_SEQUENCE_ID CID,AA.ITEM_NUM ITEM_NUM,AA.OPERATION_SEQ_NUM OPID,AA.COMPONENT_ITEM_ID C_ITEMID,AA.COMPONENT_QUANTITY QTY,AA.supply_subinventory WHSEfrom bom_inventory_components AA, bom_bill_of_materials BBwhere AA.BILL_SEQUENCE_ID = BB.BILL_SEQUENCE_ID) VBOM,mtl_system_items BB,mtl_system_items CCWHERE VBOM.F_ITEMID = BB.INVENTORY_ITEM_IDandVBOM.OGT_ID = BB.ORGANIZATION_IDandVBOM.C_ITEMID = CC.INVENTORY_ITEM_IDandVBOM.OGT_ID = CC.ORGANIZATION_IDandVBOM.OGT_ID = 142andBB.SEGMENT1 = '5XJ061988'ORDER BY VBOM.ITEM_NUM;--單層BOM成本查詢(需系統(tǒng)提交請求計算后)select inventory_item_id, organization_id,item_cost, program_update_datefrom bom.cst_item_costswhere inventory_item_id = 23760andorganization_id = 142;select inventory_item_id, organization_id,item_cost, program_update_datefrom cst_item_cost_detailswhere inventory_item_id = 23760andorganization_id = 142;10. 作業(yè)任務WIP說明: 查詢作業(yè)任務頭以及作業(yè)任務工序和BOM情況--作業(yè)任務頭信息表--(以直流 OU_ID=117;ORGANIZATION_ID=1155; 及任務WIP_ENTITY_NAME='XJ39562'; 裝配件編碼SEGMENT1 = '07D9202.92742'為例)SELECT AA.WIP_ENTITY_ID 任務令ID,AA.ORGANIZATION_ID 組織ID,AA.WIP_ENTITY_NAME 任務名稱,AA.ENTITY_TYPE 任務類型,AA.CREATION_DATE 創(chuàng)建日期,AA.CREATED_BY 創(chuàng)建者ID,AA.DESCRIPTION 說明,AA.PRIMARY_ITEM_ID 裝配件ID,BB.SEGMENT1 物料編碼,BB.DESCRIPTION 物料說明FROM wip_entities AA, mtl_system_items BBWHERE AA.PRIMARY_ITEM_ID = BB.INVENTORY_ITEM_IDandAA.ORGANIZATION_ID = BB.ORGANIZATION_IDandAA.ORGANIZATION_ID = 1155andAA.WIP_ENTITY_NAME = 'XJ39562';--=>WIP_ENTITY_ID = 48825--離散作業(yè)任務詳細主信息表--用途 1)作業(yè)任務下達及完成情況查詢--說明 1)此表包括wip_entities表大部分信息 2)重復作業(yè)任務表為 wip_repetitive_items,wip_repetitive_schedulesselect AA.WIP_ENTITY_ID 任務令ID,BB.WIP_ENTITY_NAME 任務名稱,AA.ORGANIZATION_ID 組織ID,AA.SOURCE_LINE_ID 行ID,AA.STATUS_TYPE 狀態(tài)TYPE,AA.PRIMARY_ITEM_ID 裝配件ID,CC.SEGMENT1 物料編碼,CC.DESCRIPTION 物料說明,AA.FIRM_PLANNED_FLAG,AA.JOB_TYPE 作業(yè)類型,AA.WIP_SUPPLY_TYPE 供應TYPE,AA.CLASS_CODE 任務類別,AA.SCHEDULED_START_DATE 起始時間,AA.DATE_RELEASED 下達時間,AA.SCHEDULED_COMPLETION_DATE 完工時間,AA.DATE_COMPLETED 完工時間,AA.DATE_CLOSED 關門時間,AA.START_QUANTITY 計劃數(shù),AA.QUANTITY_COMPLETED 完工數(shù),AA.QUANTITY_SCRAPPED 報廢數(shù),AA.NET_QUANTITY MRP凈值,AA.COMPLETION_SUBINVENTORY 接收子庫,AA.COMPLETION_LOCATOR_ID 貨位from wip_discrete_jobs AA, wip.wip_entities BB, mtl_system_items CCwhere AA.WIP_ENTITY_ID = BB.WIP_ENTITY_IDandAA.PRIMARY_ITEM_ID = CC.INVENTORY_ITEM_IDandAA.ORGANIZATION_ID = CC.ORGANIZATION_IDandAA.organization_id = 1155andBB.WIP_ENTITY_NAME = 'XJ39562';/*1)任務狀態(tài)TYPE值說明:STATUS_TYPE =1 未發(fā)放的-收費不允許STATUS_TYPE =3 發(fā)入-收費允許STATUS_TYPE =4 完成-允許收費STATUS_TYPE =5 完成-不允許收費STATUS_TYPE =6 暫掛-不允許收費STATUS_TYPE =7 已取消-不允許收費STATUS_TYPE =8 等待物料單加載STATUS_TYPE =9 失敗的物料單加載STATUS_TYPE =10 等待路線加載STATUS_TYPE =11 失敗的路線加載STATUS_TYPE =12 關閉-不可收費STATUS_TYPE =13 等待-成批加載STATUS_TYPE =14 等待關閉STATUS_TYPE =15 關閉失敗2)供應類型TYPE值說明: WIP_SUPPLY_TYPE =1 推式WIP_SUPPLY_TYPE =2 裝配拉式WIP_SUPPLY_TYPE =3 操作拉式WIP_SUPPLY_TYPE =4 大量WIP_SUPPLY_TYPE =5 供應商WIP_SUPPLY_TYPE =6 虛擬WIP_SUPPLY_TYPE =7 以帳單為基礎*/--離散作業(yè)任務工序狀況表select AA.ORGANIZATION_ID 組織ID,AA.WIP_ENTITY_ID 任務令ID,BB.WIP_ENTITY_NAME 任務名稱,AA.OPERATION_SEQ_NUM 工序號,AA.DESCRIPTION 工序描述,AA.DEPARTMENT_ID 部門ID,AA.SCHEDULED_QUANTITY 計劃數(shù)量,AA.QUANTITY_IN_QUEUE 排隊數(shù)量,AA.QUANTITY_RUNNING 運行數(shù)量,AA.QUANTITY_WAITING_TO_MOVE 待移動數(shù)量,AA.QUANTITY_REJECTED 故障品數(shù)量,AA.QUANTITY_SCRAPPED 報廢品數(shù)量,AA.QUANTITY_COMPLETED 完工數(shù)量,AA.FIRST_UNIT_START_DATE 最早一個單位上線時間,AA.FIRST_UNIT_COMPLETION_DATE 最早一個單位完成時間,AA.LAST_UNIT_START_DATE 最后一個單位上線時間,AA.LAST_UNIT_COMPLETION_DATE 最后一個單位完工時間,AA.PREVIOUS_OPERATION_SEQ_NUM 前一工序序號,AA.NEXT_OPERATION_SEQ_NUM 下一工序序號,AA.COUNT_POINT_TYPE 是否自動計費,AA.BACKFLUSH_FLAG 倒沖否,AA.MINIMUM_TRANSFER_QUANTITY 最小傳送數(shù)量,AA.DATE_LAST_MOVED 最后移動時間from wip_operations AA,wip_entities BBwhere AA.WIP_ENTITY_ID = BB.WIP_ENTITY_IDand BB.WIP_ENTITY_NAME = 'XJ39562';--離散作業(yè)任務子查詢———工單工序狀況查詢(不單獨使用)select WDJ.ORGANIZATION_ID,WDJ.WIP_ENTITY_ID,COUNT(1) COUNT_OPER,max(decode(wo.quantity_completed, 1, wo.operation_seq_num, 10)) OPERfrom WIP_DISCRETE_JOBS WDJ, WIP_OPERATIONS WOwhere 1 = 1ANDWDJ.WIP_ENTITY_ID = WO.WIP_ENTITY_IDANDWDJ.wip_entity_id = '48825'group byWDJ.ORGANIZATION_ID,WDJ.WIP_ENTITY_ID;--離散作業(yè)任務BOM (無材料費)SELECT WOP.ORGANIZATION_ID 組織ID,WOP.WIP_ENTITY_ID 任務令ID,BB.WIP_ENTITY_NAME 裝配件名稱,BB.PRIMARY_ITEM_ID 裝配件ID,CC.SEGMENT1 裝配件物料編碼,CC.DESCRIPTION 裝配件說明,WOP.OPERATION_SEQ_NUM 工序號,WOP.DEPARTMENT_ID 部門ID,WOP.WIP_SUPPLY_TYPE 供應類型,WOP.DATE_REQUIRED 要求日期,WOP.INVENTORY_ITEM_ID 子物料ID,DD.SEGMENT1 子物料編碼,DD.DESCRIPTION 子物料說明,WOP.QUANTITY_PER_ASSEMBLY 單位需量,WOP.REQUIRED_QUANTITY 總需求量,WOP.QUANTITY_ISSUED 已發(fā)放量,WOP.COMMENTS 注釋,WOP.SUPPLY_SUBINVENTORY 供應子庫FROM wip_requirement_operations WOP,wip_entities BB,mtl_system_items CC,mtl_system_items DDWHERE WOP.WIP_ENTITY_ID = BB.WIP_ENTITY_IDandBB.PRIMARY_ITEM_ID = CC.INVENTORY_ITEM_IDandBB.ORGANIZATION_ID = CC.ORGANIZATION_IDandWOP.INVENTORY_ITEM_ID = DD.INVENTORY_ITEM_IDandWOP.ORGANIZATION_ID = DD.ORGANIZATION_IDandWOP.ORGANIZATION_ID = 1155andBB.WIP_ENTITY_NAME = 'XJ39562';--作業(yè)任務已發(fā)放材料處理記錄清單0101(最詳細) (內碼為48825為例)--用途 1)查詢工單發(fā)料詳細明細,包括發(fā)料類型、時間、用戶等select MTL.TRANSACTION_ID 交易ID,MTL.INVENTORY_ITEM_ID 項目ID,CC.SEGMENT1 物料編碼,CC.DESCRIPTION 物料說明,MTL.ORGANIZATION_ID 組織ID,MTL.SUBINVENTORY_CODE 子庫名稱,MTL.TRANSACTION_TYPE_ID 交易類型ID,BB.TRANSACTION_TYPE_NAME 交易類型名稱,MTL.TRANSACTION_QUANTITY 交易數(shù)量,MTL.TRANSACTION_UOM 單位,MTL.TRANSACTION_DATE 交易日期,MTL.TRANSACTION_REFERENCE 交易參考,MTL.TRANSACTION_SOURCE_ID 參考源ID,FF.WIP_ENTITY_NAME 任務名稱,MTL.DEPARTMENT_ID 部門ID,MTL.OPERATION_SEQ_NUM 工序號,ROUND(MTL.PRIOR_COST, 2) 原來成本,ROUND(MTL.NEW_COST, 2) 新成本,MTL.TRANSACTION_QUANTITY * ROUND(MTL.PRIOR_COST, 2) 交易金額,DD.USER_NAME 用戶名稱,EE.FULL_NAME 用戶姓名from mtl_material_transactions MTL,mtl_transaction_types BB,mtl_system_items CC,FND_USER DD,per_people_f EE,wip_entities FFwhere MTL.TRANSACTION_TYPE_ID = BB.TRANSACTION_TYPE_IDandMTL.CREATED_BY = DD.USER_IDandMTL.INVENTORY_ITEM_ID = CC.INVENTORY_ITEM_IDandMTL.ORGANIZATION_ID = CC.ORGANIZATION_IDandDD.EMPLOYEE_ID = EE.PERSON_IDandMTL.TRANSACTION_SOURCE_ID = FF.WIP_ENTITY_IDand MTL.Transaction_Type_Idin (35, 38, 43, 48)andMTL.ORGANIZATION_ID = 1155andMTL.TRANSACTION_SOURCE_ID = 48825;--按工單的材料費匯總(不單獨使用)select MTL.ORGANIZATION_ID,MTL.TRANSACTION_SOURCE_ID WIP_ENTITY_ID,ABS(round(SUM(MTL.TRANSACTION_QUANTITY* MTL.PRIOR_COST),2)) AMTfrom mtl_material_transactions MTLwhere MTL.Transaction_Type_Id in (35, 38, 43, 48)andMTL.ORGANIZATION_ID = 1155andMTL.TRANSACTION_SOURCE_ID = 48825group by MTL.ORGANIZATION_ID,MTL.TRANSACTION_SOURCE_ID;--離散作業(yè)任務子查詢01———材料消耗狀況及材料費綜合查詢 --用途 1)查詢發(fā)料狀況 2)查詢材料費物料小計SELECT WOP.ORGANIZATION_ID 組織ID,WOP.WIP_ENTITY_ID 任務令ID,BB.WIP_ENTITY_NAME 裝配件名稱,BB.PRIMARY_ITEM_ID 裝配件ID,CC.SEGMENT1 裝配件物料編碼,CC.DESCRIPTION 裝配件說明,WOP.OPERATION_SEQ_NUM 工序號,WOP.DEPARTMENT_ID 部門ID,WOP.WIP_SUPPLY_TYPE 供應類型,WOP.DATE_REQUIRED 要求日期,WOP.INVENTORY_ITEM_ID 子物料ID,DD.SEGMENT1 子物料編碼,DD.DESCRIPTION 子物料說明,WOP.QUANTITY_PER_ASSEMBLY 單位需量,WOP.REQUIRED_QUANTITY 總需求量,WOP.QUANTITY_ISSUED 已發(fā)放量,CST.AMT 已發(fā)生材料費,WOP.COMMENTS 注釋,WOP.SUPPLY_SUBINVENTORY 供應子庫FROM wip_requirement_operations WOP,wip_entities BB,mtl_system_items CC,mtl_system_items DD,(select MTL.ORGANIZATION_ID orgID,MTL.TRANSACTION_SOURCE_ID wipID,MTL.OPERATION_SEQ_NUM oprID,MTL.INVENTORY_ITEM_ID itemID,sum(MTL.TRANSACTION_QUANTITY * ROUND(MTL.actual_cost, 2)) amtfrom mtl_material_transactions MTLwhere MTL.Transaction_Type_Id in (35, 38, 43, 48)andMTL.ORGANIZATION_ID = 1155andMTL.TRANSACTION_SOURCE_ID = 48825group by MTL.ORGANIZATION_ID,MTL.TRANSACTION_SOURCE_ID,MTL.OPERATION_SEQ_NUM,MTL.INVENTORY_ITEM_ID) CSTWHERE WOP.WIP_ENTITY_ID = BB.WIP_ENTITY_IDandBB.PRIMARY_ITEM_ID = CC.INVENTORY_ITEM_IDandBB.ORGANIZATION_ID = CC.ORGANIZATION_IDandWOP.INVENTORY_ITEM_ID = DD.INVENTORY_ITEM_IDandWOP.ORGANIZATION_ID = DD.ORGANIZATION_IDandWOP.ORGANIZATION_ID = CST.orgIDandWOP.WIP_ENTITY_ID = CST.wipIDandWOP.OPERATION_SEQ_NUM = CST.oprIDandWOP.INVENTORY_ITEM_ID = CST.itemIDandWOP.ORGANIZATION_ID = 1155andBB.WIP_ENTITY_NAME = 'XJ39562';--離散作業(yè)任務子查詢0201———作業(yè)資源報工明細表SELECT WTA.ORGANIZATION_ID 組織代碼,WTA.TRANSACTION_ID 交易代碼,WTA.REFERENCE_ACCOUNT 參考科目,WTA.TRANSACTION_DATE 報工日期,WTA.WIP_ENTITY_ID 任務令內碼,WTA.ACCOUNTING_LINE_TYPE 會計欄類型,WTA.BASE_TRANSACTION_VALUE 費用額,WTA.CONTRA_SET_ID 反方集代碼,WTA.PRIMARY_QUANTITY 基本數(shù)量,WTA.RATE_OR_AMOUNT 率或金額,WTA.BASIS_TYPE 基本類型,WTA.RESOURCE_ID 資源代碼,WTA.COST_ELEMENT_ID 成本要素ID,WTA.ACCOUNTING_LINE_TYPE 成本類型ID,WTA.OVERHEAD_BASIS_FACTOR 費用因子,WTA.BASIS_RESOURCE_ID 基本資源ID,WTA.CREATED_BY 錄入人ID,DD.USER_NAME 用戶名稱,EE.FULL_NAME 用戶姓名FROM wip_transaction_accounts WTA, FND_USER DD, per_people_f EEWHERE WTA.CREATED_BY = DD.USER_IDandDD.EMPLOYEE_ID = EE.PERSON_IDandWTA.BASE_TRANSACTION_VALUE <> 0andWTA.ORGANIZATION_ID = 1155andWTA.WIP_ENTITY_ID = 48839;--成本類型ID ACCOUNTING_LINE_TYPESELECT * FROM MFG_LOOKUPS MLWHERE ML.LOOKUP_TYPE LIKE 'CST_ACCOUNTING_LINE_TYPE'ORDER BYML.LOOKUP_CODE;--成本要素ID COST_ELEMENT_ID--(待補充--------------------------------------------------------------------------?)--統(tǒng)計人工費與制造費(不單獨應用)SELECT ORGANIZATION_ID, WIP_ENTITY_ID, SUM(HR_FEE) HR_FEE, SUM(MD_FEE) MD_FEEFROM (Select WTA.ORGANIZATION_ID,WTA.WIP_ENTITY_ID,decode(COST_ELEMENT_ID, 3, WTA.BASE_TRANSACTION_VALUE, 0) HR_FEE,decode(COST_ELEMENT_ID, 5,WTA.BASE_TRANSACTION_VALUE, 0) MD_FEEfrom WIP_TRANSACTION_ACCOUNTS WTAwhere WTA.ACCOUNTING_LINE_TYPE = 7and WTA.BASE_TRANSACTION_VALUE<> 0) WTA_COSTWHERE WTA_COST.ORGANIZATION_ID = 1155ANDWTA_COST.WIP_ENTITY_ID = '48839'GROUP BYWTA_COST.ORGANIZATION_ID,WTA_COST.WIP_ENTITY_ID;--工單進度及費用信息綜合查詢(未下達及下達零發(fā)料和報工的看不到)select WE.WIP_ENTITY_NAME 任務名稱,MSI.SEGMENT1 物料,MSI.DESCRIPTION 物料描述,MSI.PRIMARY_UNIT_OF_MEASURE 單位,WDJ.SCHEDULED_START_DATE 計劃開始時間,WDJ.SCHEDULED_COMPLETION_DATE 計劃完成時間,WDJ.START_QUANTITY 工單數(shù)量,WDJ.QUANTITY_COMPLETED 完成數(shù)量,WDJ.DATE_RELEASED 實際開始時間,WDJ.DATE_COMPLETED 時間完成時間,WDJ.DESCRIPTION 工單備注,PP.SEGMENT1 項目號,PP.DESCRIPTION 項目描述,PT.TASK_NUMBER 任務號,PT.DESCRIPTION 任務描述,WO.COUNT_OPER 工序數(shù),WO1.OPERATION_SEQ_NUM 當前工序,WO1.DESCRIPTION 當前工序描述,MTA.MT_FEE 材料費,WCT.HR_FEE 人工費,WCT.MD_FEE 制造費,WE.WIP_ENTITY_ID,WE.ORGANIZATION_ID,WDJ.PRIMARY_ITEM_ID,WDJ.PROJECT_ID,WDJ.TASK_IDfrom WIP_ENTITIES WE,WIP_OPERATIONS WO1,WIP_DISCRETE_JOBS WDJ,MTL_SYSTEM_ITEMS_B MSI,PA_PROJECTS_ALL PP,PA_TASKS PT,(select WDJ.ORGANIZATION_ID,WDJ.WIP_ENTITY_ID,COUNT(1) COUNT_OPER,max(decode(wo.quantity_completed, 1, wo.operation_seq_num, 10)) OPERfrom WIP_DISCRETE_JOBS WDJ, WIP_OPERATIONS WOwhere WDJ.WIP_ENTITY_ID = WO.WIP_ENTITY_IDgroup by WDJ.ORGANIZATION_ID, WDJ.WIP_ENTITY_ID)WO, --工序進度 (select MTL.ORGANIZATION_ID,MTL.TRANSACTION_SOURCE_IDWIP_ENTITY_ID,ABS(SUM(MTL.TRANSACTION_QUANTITY *MTL.actual_cost)) MT_FEEfrom mtl_material_transactions MTLwhere MTL.Transaction_Type_Id in (35, 38, 43, 48)group by MTL.ORGANIZATION_ID,MTL.TRANSACTION_SOURCE_ID) MTA, --材料費 (select WTA_COST.ORGANIZATION_ID,WTA_COST.WIP_ENTITY_ID,SUM(WTA_COST.HR_FEE1) HR_FEE,SUM(WTA_COST.MD_FEE1)MD_FEEfrom (select WTA.ORGANIZATION_ID,WTA.WIP_ENTITY_ID,decode(COST_ELEMENT_ID,3,WTA.BASE_TRANSACTION_VALUE,0) HR_FEE1,decode(COST_ELEMENT_ID,5,WTA.BASE_TRANSACTION_VALUE,0) MD_FEE1from WIP_TRANSACTION_ACCOUNTS WTAwhere WTA.ACCOUNTING_LINE_TYPE = 7and WTA.BASE_TRANSACTION_VALUE <> 0) WTA_COSTgroup by WTA_COST.ORGANIZATION_ID,WTA_COST.WIP_ENTITY_ID) WCT --人工與制造WHERE 1 = 1ANDWE.ORGANIZATION_ID = WDJ.ORGANIZATION_IDANDWE.WIP_ENTITY_ID = WDJ.WIP_ENTITY_IDANDWDJ.ORGANIZATION_ID = MSI.ORGANIZATION_IDANDWDJ.PRIMARY_ITEM_ID = MSI.INVENTORY_ITEM_IDANDWE.WIP_ENTITY_ID = WO.WIP_ENTITY_IDANDWO1.WIP_ENTITY_ID = WO.WIP_ENTITY_IDAND WO.OPER= WO1.OPERATION_SEQ_NUMANDWE.ORGANIZATION_ID = MTA.ORGANIZATION_IDANDWE.WIP_ENTITY_ID = MTA.WIP_ENTITY_ID(+)ANDWE.ORGANIZATION_ID = WCT.ORGANIZATION_IDANDWE.WIP_ENTITY_ID = WCT.WIP_ENTITY_ID(+)ANDWDJ.PROJECT_ID = PP.PROJECT_ID(+)ANDWDJ.TASK_ID = PT.TASK_ID(+)andwe.organization_id = 1155andwe.wip_entity_id = '48825';--工單進度及費用信息綜合查詢(不論是否下達和發(fā)料都能看到)SELECT WDJ.WIP_ENTITY_ID 任務令ID,WE.WIP_ENTITY_NAME 任務名稱,WDJ.ORGANIZATION_ID 組織ID,WDJ.STATUS_TYPE 狀態(tài),WDJ.PRIMARY_ITEM_ID 裝配件ID,MSI.SEGMENT1 物料編碼,MSI.DESCRIPTION 物料說明,WDJ.FIRM_PLANNED_FLAG 任務類型,WDJ.JOB_TYPE 作業(yè)類型,WDJ.WIP_SUPPLY_TYPE 供應類型,WDJ.CLASS_CODE 任務類別,WDJ.SCHEDULED_START_DATE 起始時間,WDJ.DATE_RELEASED 下達時間,WDJ.DATE_COMPLETED 完工時間,WDJ.DATE_CLOSED 關閉時間,WDJ.START_QUANTITY 計劃數(shù),WDJ.QUANTITY_COMPLETED 完工數(shù),WDJ.QUANTITY_SCRAPPED 報廢數(shù),WDJ.NET_QUANTITY MRP凈值,WDJ.DESCRIPTION 工單備注,WDJ.COMPLETION_SUBINVENTORY 接收子庫,WDJ.COMPLETION_LOCATOR_ID 貨位ID,WDJ.PROJECT_ID 項目ID,WDJ.TASK_ID 項目任務ID,PP.SEGMENT1 項目號,PP.DESCRIPTION 項目描述,PT.TASK_NUMBER 任務號,PT.DESCRIPTION 任務描述,WPF.COUNT_OPER 工序數(shù),WPF.CUR_OPER 當前工序,WPF.CUR_OPERNAME 工序名,WPF.MT_FEE 材料費,WPF.HR_FEE 人工費,WPF.MD_FEE 制造費FROM wip_discrete_jobs WDJ,wip.wip_entities WE,mtl_system_items MSI,PA_PROJECTS_ALL PP,PA_TASKS PT,(select WDJ1.WIP_ENTITY_ID,WDJ1.ORGANIZATION_ID,WO.COUNT_OPER,WO1.OPERATION_SEQ_NUM CUR_OPER,WO1.DESCRIPTION CUR_OPERNAME,MTA.MT_FEE,WCT.HR_FEE,WCT.MD_FEEfrom WIP_OPERATIONS WO1,WIP_DISCRETE_JOBS WDJ1,(select WDJ.ORGANIZATION_ID,WDJ.WIP_ENTITY_ID,COUNT(1)COUNT_OPER,max(decode(wo.quantity_completed,1,wo.operation_seq_num,10)) OPERfrom WIP_DISCRETE_JOBS WDJ, WIP_OPERATIONS WOwhere WDJ.WIP_ENTITY_ID = WO.WIP_ENTITY_IDgroup by WDJ.ORGANIZATION_ID,WDJ.WIP_ENTITY_ID) WO, --工序進度 (select MTL.ORGANIZATION_ID,MTL.TRANSACTION_SOURCE_ID WIP_ENTITY_ID,ABS(SUM(MTL.TRANSACTION_QUANTITY* MTL.actual_cost)) MT_FEEfrom mtl_material_transactions MTLwhere MTL.Transaction_Type_Id in (35, 38, 43, 48)group by MTL.ORGANIZATION_ID,MTL.TRANSACTION_SOURCE_ID) MTA, --材料費 (select WTA_COST.ORGANIZATION_ID,WTA_COST.WIP_ENTITY_ID,SUM(WTA_COST.HR_FEE1) HR_FEE,SUM(WTA_COST.MD_FEE1) MD_FEEfrom (selectWTA.ORGANIZATION_ID,WTA.WIP_ENTITY_ID,decode(COST_ELEMENT_ID,3,WTA.BASE_TRANSACTION_VALUE,0) HR_FEE1,decode(COST_ELEMENT_ID,5,WTA.BASE_TRANSACTION_VALUE,0) MD_FEE1from WIP_TRANSACTION_ACCOUNTS WTAwhere WTA.ACCOUNTING_LINE_TYPE = 7and WTA.BASE_TRANSACTION_VALUE <> 0) WTA_COSTgroup by WTA_COST.ORGANIZATION_ID,WTA_COST.WIP_ENTITY_ID) WCT --人工與制造WHERE 1 = 1ANDWDJ1.WIP_ENTITY_ID = WO.WIP_ENTITY_ID(+)ANDWO1.WIP_ENTITY_ID = WO.WIP_ENTITY_IDAND WO.OPER= WO1.OPERATION_SEQ_NUMANDWDJ1.ORGANIZATION_ID = MTA.ORGANIZATION_IDANDWDJ1.WIP_ENTITY_ID = MTA.WIP_ENTITY_ID(+)ANDWDJ1.ORGANIZATION_ID = WCT.ORGANIZATION_IDANDWDJ1.WIP_ENTITY_ID = WCT.WIP_ENTITY_ID(+)) WPFWHERE WDJ.WIP_ENTITY_ID = WE.WIP_ENTITY_IDANDWDJ.ORGANIZATION_ID = WE.ORGANIZATION_IDANDWDJ.PRIMARY_ITEM_ID = MSI.INVENTORY_ITEM_IDANDWDJ.ORGANIZATION_ID = MSI.ORGANIZATION_IDANDWDJ.PROJECT_ID = PP.PROJECT_ID(+)ANDWDJ.TASK_ID = PT.TASK_ID(+)ANDWDJ.ORGANIZATION_ID = WPF.ORGANIZATION_ID(+)ANDWDJ.WIP_ENTITY_ID = WPF.WIP_ENTITY_ID(+)ANDWDJ.organization_id = 1155andPP.SEGMENT1 = '07D9202';11. MRP相關查詢12. 總賬GLselect *from gl_sets_of_books 總帳select *from gl_code_combinationsgcc where gcc.summary_flag='Y' 科目組合select *from gl_balances 科目余額select *from gl_je_batches 憑證批select *from gl_je_headers 憑證頭select *from gl_je_lines 憑證行select *from gl_je_categories 憑證分類select *from gl_je_sources 憑證來源select *fromgl_summary_templates 科目匯總模板select *from gl_account_hierarchies科目匯總模板層次 13. 應收ARselect * from ar_batches_all 事務處理批select * from ra_customer_trx_all 發(fā)票頭select * from ra_customer_trx_lines_all 發(fā)票行select * from ra_cust_trx_line_gl_dist_all 發(fā)票分配select * from ar_cash_receipts_all 收款select * from ar_receivable_applications_all 核銷select * from ar_payment_schedules_all 發(fā)票調整select * from ar_adjustments_all 會計分錄select * from ar_distributions_all 付款計劃 14. 應付APselect * from ap_invoices_all 發(fā)票頭select * from ap_invoice_distributions_all 發(fā)票行select * from ap_payment_schedules_all 付款計劃select * from ap_check_stocks_all 單據(jù)select * from ap_checks_all 付款select * from ap_bank_branches 銀行select * from ap_bank_accounts_all 銀行帳號select * from ap_invoice_payments_all 核銷15. 應用、值集、彈性域--fndselect * from fnd_applicationselect * from fnd_application_tl where application_id=101select * from fnd_application_vl where application_id = 101--值集select * from fnd_flex_value_setsselect * from fnd_flex_valuesselect * from fnd_flex_values_vl--彈性域select * from fnd_id_flexsselect * from fnd_id_flex_structures where id_flex_code='GL#'select * from fnd_id_flex_segments where id_flex_code='GL#' andid_flex_num=50671select * from fnd_profile_options_vlselect * from fnd_concurrent_programs 程序表select * from fnd_concurrent_requests 請求表select * from fnd_concurrent_processes 進程表 16. 許繼配送管理相關表---為了實現(xiàn)系統(tǒng)內方便的配送發(fā)貨模式而開發(fā)--配送關系 (以供應處角度ORGANIZATION_ID = 142)SELECT AA.CUSTOMER_RELATION_ID 配送關系ID,AA.ORGANIZATION_ID 組織ID,AA.CUST_ACCOUNT_ID 客戶ID,CC.PARTY_NAME 客戶名稱,AA.CUST_ACCT_SITE_ID 配送地ID,DD.LOCATION 客戶地點,DD.STATUS A有效,AA.DELIVERY_BY_SO_FLAG 源于CO,AA.OUTBOUND_TRX_TYPE_ID 出庫類型,AA.OUTBOUND_RET_TRX_TYPE_ID 出庫R類型,AA.OUTBOUND_COST_CCID 出庫賬戶ID,EE.concatenated_segments 出庫賬戶,AA.CUST_ORG_ID 客戶庫存組織ID,AA.INBOUND_TRX_TYPE_ID 入庫類型,AA.INBOUND_RET_TRX_TYPE_ID 入庫R類型,AA.INBOUND_CONFIRM_FLAG 入庫確認,AA.INBOUND_COST_CCID 入庫賬戶ID,FF.concatenated_segments 入庫賬戶,AA.MANAGE_CHARGE 加價率,AA.SETTLE_MODE 結算模式,AA.INBOUND_SUBIN_CODE 接收子倉庫,AA.OUTBOUND_SUBIN_CODE 配送子庫存,AA.ATTRIBUTE1 直接生產發(fā)料,AA.Creation_Date 創(chuàng)建日期,AA.CREATED_BY 創(chuàng)建者,AA.LAST_UPDATED_BY 更新者,AA.LAST_UPDATE_DATE 更新日期FROM CUX_INV_CUSTOMER_RELATION_ALL AA,hz_cust_accounts BB,hz_parties CC,HZ_CUST_SITE_USES_ALL DD,gl_code_combinations_kfv EE,gl_code_combinations_kfv FFWHERE AA.ORGANIZATION_ID = 142ANDAA.CUST_ACCOUNT_ID = BB.CUST_ACCOUNT_IDANDBB.PARTY_ID = CC.PARTY_IDANDAA.Cust_Acct_Site_Id = DD.Site_Use_IdANDDD.STATUS = 'A'ANDAA.OUTBOUND_COST_CCID = EE.code_combination_idANDAA.INBOUND_COST_CCID =FF.code_combination_idandCC.PARTY_NAME = '許繼電氣電網(wǎng)保護自動化公司';--配送單頭SELECT AA.DN_HEADER_ID 配送單ID,AA.DN_NUMBER 配送單編號,AA.DN_STATUS_CODE 狀態(tài),AA.CUST_ACCOUNT_ID 客戶ID,CC.PARTY_NAME 客戶名稱,AA.CUST_ACCT_SITE_ID 配送地址ID,DD.LOCATION 客戶地點,AA.DELIVERY_ORG_ID 配送方組織ID,AA.CUST_ORG_ID 客戶組織ID,AA.MANAGE_CHARGE 費率,AA.INBOUND_CONFIRM_FLAG 入庫確認否,AA.SO_HEADER_ID 銷售訂單ID,EE.ORDER_NUMBER 銷售訂單,EE.CUST_PO_NUMBER 客戶PO,ee.attribute1,ee.attribute2,AA.PROCESS_FLAG,AA.COMMENTS 配送單說明FROM CUX_INV_DN_HEADERS_ALL AA, hz_cust_accounts BB, hz_parties CC,HZ_CUST_SITE_USES_ALL DD,OE_ORDER_HEADERS_ALL EEWHERE AA.DELIVERY_ORG_ID = 142ANDAA.CUST_ACCOUNT_ID = BB.CUST_ACCOUNT_IDANDBB.PARTY_ID = CC.PARTY_IDANDAA.Cust_Acct_Site_Id = DD.Site_Use_IdANDDD.STATUS = 'A'ANDAA.SO_HEADER_ID = EE.HEADER_IDANDAA.DN_NUMBER = '14780016022';--配送單明細SELECT AA.DN_HEADER_ID,AA.DN_LINE_ID,AA.SO_LINE_ID,LL.LINE_NUMBER SO行號,AA.INVENTORY_ITEM_ID 物料ID,CC.SEGMENT1 物料編碼,CC.DESCRIPTION 物料說明,AA.OUTBOUND_SUBIN_CODE 發(fā)出倉,AA.OUTBOUND_LOCATOR_ID 發(fā)出貨位,AA.REQUIRE_DATE 需求日期,AA.REQUIRE_QTY 需求數(shù),AA.OUTBOUND_QTY 已出庫,AA.INBOUND_QTY 已接收,AA.ATTRIBUTE1 最近確認接收數(shù),AA.INBOUND_SUBIN_CODE 入庫倉,AA.INBOUND_LOCATOR_ID 入庫貨位,AA.RETURN_NO_RECEIVE_QTY 退回數(shù),AA.OUTING_QTY,AA.INING_QTY,AA.REQUEST_ID 最近打印請求IDFROM CUX_INV_DN_LINES_ALL AA, CUX_INV_DN_HEADERS_ALL BB,mtl_system_itemsCC,OE_ORDER_LINES_ALL LLWHERE AA.DN_HEADER_ID = BB.DN_HEADER_IDANDAA.INVENTORY_ITEM_ID = CC.INVENTORY_ITEM_IDANDBB.DELIVERY_ORG_ID = CC.ORGANIZATION_IDANDAA.SO_LINE_ID = LL.LINE_IDANDBB.DN_NUMBER = '14780016022';99-其他相關表 1) 會計科目組合表--查詢會計科目分段信息select * fromgl_code_combinations;--查詢會計科目組合信息select * from gl_code_combinations_kfv; 2) 查詢自定義的客戶化相關表和視圖-- 靜態(tài)數(shù)據(jù)字典中的視圖分為三類,它們分別由三個前綴夠成:user_*、 all_*、 dba_*-- user_* 該視圖存儲了關于當前用戶所擁有的對象的信息。(即所有在該用戶模式下的對象)-- all_* 該視圖存儲了當前用戶能夠訪問的對象的信息。(與user_*相比,all_* 并不需要擁有該對象,只需要具有訪問該對象的權限即可)-- dba_* 該視圖存儲了數(shù)據(jù)庫中所有對象的信息。(前提是當前用戶具有訪問這些數(shù)據(jù)庫的權限,一般來說必須具有管理員權限--查詢該用戶擁有哪些表select * fromuser_tables where table_name like 'CUX%';--查詢該用戶擁有哪些視圖select * fromuser_views where view_name like 'CUX%';--查詢該用戶擁有哪些索引select * fromuser_indexes; 3) 查詢物料處理記錄說明:mtl_material_transactions 這個表記錄了所有涉及倉庫收發(fā)的物料交易記錄,包括:采購、WIP、訂單、雜項等多種處理模式的內容。--舉例: 查詢某用戶在電網(wǎng)的賬戶別名發(fā)放清單select AA.TRANSACTION_ID 交易代碼,AA.INVENTORY_ITEM_ID 項目內碼,CC.SEGMENT1 物料編碼,CC.DESCRIPTION 物料說明,AA.ORGANIZATION_ID 組織代碼,AA.SUBINVENTORY_CODE 子庫名稱,AA.TRANSACTION_TYPE_ID 類型ID,BB.TRANSACTION_TYPE_NAME 類型名稱,AA.TRANSACTION_QUANTITY 數(shù)量,AA.TRANSACTION_UOM 單位,AA.TRANSACTION_DATE 交易日期,AA.TRANSACTION_REFERENCE 交易參考,AA.TRANSACTION_SOURCE_ID 參考源ID,AA.DEPARTMENT_ID 部門ID,AA.OPERATION_SEQ_NUM 工序號,ROUND(AA.Actual_Cost,2) 實際成本,ROUND(AA.Transaction_Cost,2) 處理成本,ROUND(AA.PRIOR_COST,2) 舊成本,ROUND(AA.NEW_COST,2) 新成本,ROUND(AA.VARIANCE_AMOUNT,2) 差異金額,AA.TRANSACTION_QUANTITY * ROUND(AA.PRIOR_COST,2) 交易金額,DD.USER_NAME 用戶名稱,EE.FULL_NAME 用戶姓名,AA.ATTRIBUTE1 彈性域人名,AA.ATTRIBUTE15 彈性域備注from mtl_material_transactions AA ,mtl_transaction_types BB,mtl_system_items CC,FND_USER DD,per_people_f EEwhere AA.TRANSACTION_TYPE_ID = BB.TRANSACTION_TYPE_ID andAA.CREATED_BY = DD.USER_ID andAA.INVENTORY_ITEM_ID =CC.INVENTORY_ITEM_ID andAA.ORGANIZATION_ID = CC.ORGANIZATION_IDandDD.EMPLOYEE_ID = EE.PERSON_ID andAA.ORGANIZATION_ID =1155 ANDCC.SEGMENT1='07D9202.92742' andAA.TRANSACTION_DATE >= TO_DATE('2011-01-29 00:00:00','YYYY-MM-DD HH24:MI:SS')order by aa.TRANSACTION_ID;/* 物料處理記錄mtl_material_transactions表,類型與成本說明:--雜項收 TRANSACTION_TYPE_ID = 41 錄入價格優(yōu)先,=Actual_Cost,移動平均 TRANSACTION_QUANTITY > 0 ,調整類似注:1)如果再接收界面錄入了價格,以錄入價格計入Actual_Cost,進行移動平均2)如果沒有錄入價格,字段NULL,則系統(tǒng)會以當前成本接收,計入Actual_Cost--雜項發(fā) TRANSACTION_TYPE_ID = 31 以出=Actual_Cost, TRANSACTION_QUANTITY < 0 ,調整類似--采購收 TRANSACTION_TYPE_ID = 18 以 入=Actual_Cost,移動平均 TRANSACTION_QUANTITY > 0--采購退 TRANSACTION_TYPE_ID = 36 以 出=Actual_Cost, TRANSACTION_QUANTITY < 0注:1) 系統(tǒng)按采購成本退貨和扣除庫存金額,不考慮已消耗狀況;2) 如果庫存金額夠扣除,則扣除后重新計算出一個新成本;3)如果庫存金額不夠扣除,則扣除全部金額,就會出現(xiàn)有庫存量而單位成本=0的物資,不夠扣的部分計入字段VARIANCE_AMOUNT。--作業(yè)發(fā) TRANSACTION_TYPE_ID = 35 以當前成本出,=Actual_Cost, TRANSACTION_QUANTITY < 0 ,特定組件發(fā)料類似--作業(yè)退 TRANSACTION_TYPE_ID = 43 以當前成本入,=Actual_Cost,不移動平均 TRANSACTION_QUANTITY > 0--配送出 TRANSACTION_TYPE_ID = 100 以當前成本出,=Actual_Cost, TRANSACTION_QUANTITY < 0--配送退 TRANSACTION_TYPE_ID = 101 以配送價入 ,=Actual_Cost,移動平均 TRANSACTION_QUANTITY > 0--銷售發(fā) TRANSACTION_TYPE_ID = 33 以當前成本出,=Actual_Cost, TRANSACTION_QUANTITY < 0--銷售退 TRANSACTION_TYPE_ID = 15 以當前成本入,=Actual_Cost, TRANSACTION_QUANTITY > 0*/--物料處理記錄類型列表select bb.transaction_type_id 類型ID,bb.transaction_type_name 別名,bb.description 說明from mtl_transaction_types BBorder by bb.transaction_type_id--交易來源類型列表SELECT *FROM mtl_txn_source_types--交易原因代碼表 SELECT REASON_ID 原因代碼, REASON_NAME 名稱, DESCRIPTION 描述FROM inv.mtl_transaction_reasons;?
轉載于:https://www.cnblogs.com/wellhuang/p/9014874.html
總結
以上是生活随笔為你收集整理的EBS常用表_Dictionary的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 时间同步linux和window
- 下一篇: python函数高级运用