Oracle EBS SLA取值
-- 从GL总账追溯到 => 子分类账SLA => 子模块AP、AR等
SELECT xep.name, -- 法人主体xep.legal_entity_identifier, -- 法人主体所得纳税税登记--xentity_t.entity_code,xentity_t.name "事务实体类型名称",--xte.application_id "应用ID",xte.entity_id,xte.ledger_id "分类账SOB ID",------------------------------ --AP_INVOICES AP发票 INVOICE_ID--AP_PAYMENTS AP付款 CHECK_ID--RECEIPTS 收款 CASH_RECEIPT_ID--TRANSACTIONS 事务处理 销售发票 CUSTOMER_TRX_IDxte.source_id_int_1 "事务源对应ID",------------------------------/*--下面两个字段折旧的时候会有值,xte.source_id_int_2,xte.source_id_int_3 */xte.security_id_int_1 "ORG_ID",xte.source_application_id "源应用ID",--xe.event_id,xe.event_type_code,xevent_t.name "事件类型",----==============xla_ae_headers=======-----xah.ae_header_id,xah.ledger_id "SOB ID",xah.je_category_name,xah.accounting_date,xah.period_name,/* xah.balance_type_code, --Balance type (Actual, Budget, or Encumbrance) xah.gl_transfer_date,xah.accounting_entry_status_code,xah.accounting_entry_type_code,xah.zero_amount_flag,*/--==============xla_ae_line=======-----xal.ae_line_num "行号",xal.code_combination_id "账户ID",gjl.code_combination_id "日记帐gcc",/* ,xal.gl_transfer_mode_code,xal.accounting_class_code "会计分类"*/xlp.meaning "会计分类",xal.accounted_dr "入账借项(本位币)",xal.accounted_cr "入账贷项(本位币)",xal.currency_code "币种",xal.entered_dr "账户原币借项",xal.entered_cr "账户原币贷项",gir.je_line_num "日记帐行号",--==============xla_distribution_links=======-----xdl.source_distribution_type, -- 源账户分配类型xdl.source_distribution_id_num_1 "源账户关联ID", -- Transaction source distribution identifer (Number) xdl.tax_line_ref_id, -- 税明细行 ZX_LINES_V.TAX_LINE_ID -- Detail Tax Line Referencexdl.unrounded_entered_dr, -- Unrounded Entered Debit Amount for the journal line (DR)xdl.unrounded_entered_cr, -- Unrounded Entered Credit Amount for the journal line (CR)--xdl.applied_to_distribution_type, -- (如:AP_INV_DIST、PO_DISTRIBUTIONS_ALL等)xdl.applied_to_source_id_num_1, -- (如:核销行 源发票ID 、PO_DISTRIBUTION_ID等)xdl.applied_to_dist_id_num_1 --FROM xle_entity_profiles xep,--xla_entity_types_tl xentity_t,--xla.xla_transaction_entities xte, -- ORG VPDxla_event_types_tl xevent_t,xla_events xe,--xla_distribution_links xdl, -- distribution--xla_ae_headers xah,xla_ae_lines xal,xla_lookups xlp,-- gl_import_references gir,gl_je_headers gjh,gl_je_lines gjlWHERE 1 = 1-- 1.9 xep + xteAND xep.legal_entity_id(+) = xte.legal_entity_id-- 1.8 xentity_t + xteAND xentity_t.entity_code = xte.entity_codeAND xentity_t.application_id = xte.application_idAND xentity_t.language = userenv('LANG')-- 1.7 xevent_t + xeAND xevent_t.event_type_code = xe.event_type_codeAND xevent_t.application_id = xe.application_idAND xevent_t.language = userenv('LANG')-- 1.6 xte + xe/xah-- XLA.XLA_TRANSACTION_ENTITIES_U1 on XLA.XLA_TRANSACTION_ENTITIES (ENTITY_ID, APPLICATION_ID)-- 如果不关联xla_events表,则此处可以使用如下方式进行关联-- AND xte.entity_id = xah.entity_id-- AND xte.application_id = xah.application_idAND xte.entity_id = xe.entity_idAND xte.application_id = xe.application_id-- 1.5 xe + xah -- XLA.XLA_EVENTS_U1 on XLA.XLA_EVENTS (EVENT_ID, APPLICATION_ID)-- XLA.XLA_EVENTS_U2 on XLA.XLA_EVENTS (ENTITY_ID, EVENT_NUMBER, APPLICATION_ID)AND xe.event_id = xah.event_idAND xe.application_id = xah.application_id-- 1.4 xal + xdl(distribution)-- 此处为什么使用外连接 ? 因为有的事务处理没有distribution ^_^AND xdl.ae_header_id(+) = xal.ae_header_idAND xdl.ae_line_num(+) = xal.ae_line_numAND xdl.application_id(+) = xal.application_id-- 1.3 xah + xalAND xah.ae_header_id = xal.ae_header_idAND xah.application_id = xal.application_idAND xlp.lookup_code(+) = xal.accounting_class_codeAND xlp.lookup_type(+) = 'XLA_ACCOUNTING_CLASS'-- 1.2 xal + girAND xal.gl_sl_link_id = gir.gl_sl_link_idAND xal.gl_sl_link_table = gir.gl_sl_link_table-- 1.1 gir + glAND gir.je_header_id = gjh.je_header_idAND gir.je_line_num = gjl.je_line_num-- AND gjh.je_header_id = gjl.je_header_idAND gjh.je_header_id = 216128 /*216124*/
-- AND gjl.je_line_num = 1, 2, 3
--应收事务处理追溯SLA
SELECT pv.vendor_name,sum(rt.quantity) quantity,sum(xal.accounted_dr) accounted_dr,sum(xal.accounted_cr) accounted_crFROM xla_ae_lines xal,gl_code_combinations_v gcc,xla_ae_headers xae,rcv_receiving_sub_ledger rrsl,xla_distribution_links xdl,rcv_transactions rt,po_vendors pvWHERE 1 = 1AND xal.code_combination_id = gcc.code_combination_idAND rrsl.code_combination_id = xal.code_combination_idAND gcc.segment3 = '22020201'AND xae.ae_header_id = xal.ae_header_idAND xdl.source_distribution_id_num_1 = rrsl.rcv_sub_ledger_idAND xdl.ae_header_id = xal.ae_header_idAND rt.transaction_id = rrsl.rcv_transaction_idAND rt.vendor_id = pv.vendor_idAND xae.period_name = '01-15'GROUP BY pv.vendor_name;
--应付发票追溯SLA
SELECT jh.name 总账日记账名称jh.je_source 总账日记账来源jh.je_category 总账日记账分类jh.description 总账日记账说明jh.currency_code 总账币别jh.period_name 总账会计期间jh.default_effective_date 总账有效日期jl.je_line_num 总账行号gcc.concatenated_segments 总账账户jl.accounted_dr 总账入账借方jl.accounted_cr 总账入账贷方jl.description 总账行说明xal.ae_line_num 分类账行号xal.accounted_dr 分类账借方金额xal.accounted_cr 分类账贷方金额nvl(xal.accounted_dr, 0) - nvl(xal.accounted_cr, 0) 分类账余额xal.description 分类账行说明su.vendor_name 供应商名称sus.vendor_site_code 供应商地点ai.invoice_num 发票或付款编号ai.invoice_date 发票日期FROM gl_je_headers jh,gl_je_lines jl,gl_import_references gir,gl_code_combinations_kfv gcc,xla_ae_lines xal,xla_ae_headers xah,xla.xla_transaction_entities xte,ap.ap_invoices_all ai,ap.ap_suppliers su,ap.ap_supplier_sites_all susWHERE jh.je_header_id = jl.je_header_idAND jl.je_header_id = gir.je_header_idAND jl.je_line_num = gir.je_line_numAND jl.code_combination_id = gcc.code_combination_idAND gir.gl_sl_link_id = xal.gl_sl_link_idAND gir.gl_sl_link_table = xal.gl_sl_link_tableAND xal.application_id = xah.application_idAND xal.ae_header_id = xah.ae_header_idAND xah.application_id = xte.application_idAND xah.entity_id = xte.entity_idAND xte.source_id_int_1 = ai.invoice_idAND xte.entity_code = 'AP_INVOICES'AND ai.vendor_id = su.vendor_idAND ai.vendor_id = sus.vendor_idAND ai.vendor_site_id = sus.vendor_site_idAND ai.org_id = sus.org_idAND xal.displayed_line_number > 0AND jh.ACTUAL_FLAG = 'A'--AND su.vendor_name = '&供应商名称-- AND gcc.segment1 like 'A140101'AND gcc.code_combination_id = 31322--AND gcc.segment2 = '&部门-- AND gcc.segment3 = '&会计科目AND jl.period_name = '2015-07'
--收款追溯SLA
SELECT hp.party_name,(nvl(al.accounted_cr,0) - nvl(al.accounted_dr,0)) amount,crh_first_posted.gl_date,cr.commentsFROM xla.xla_ae_lines al,xla.xla_ae_headers ah,xla.xla_transaction_entities xte,ar_cash_receipts_all cr,ar_cash_receipt_history_all crh_first_posted,hz_cust_site_uses_all csu,hz_cust_acct_sites_all hcas,hz_cust_accounts_all hca,hz_parties hpWHERE 1 = 1AND al.ae_header_id = ah.ae_header_idAND ah.entity_id = xte.entity_idAND xte.entity_code = 'RECEIPTS'AND cr.cash_receipt_id = xte.source_id_int_1AND ah.ledger_id = 2021AND al.code_combination_id = 20795AND hp.party_id = hca.party_idAND csu.site_use_id = cr.customer_site_use_idAND csu.cust_acct_site_id = hcas.cust_acct_site_idAND hca.cust_account_id = hcas.cust_account_idAND hcas.org_id = cr.org_idAND crh_first_posted.cash_receipt_id(+) = cr.cash_receipt_idAND crh_first_posted.org_id(+) = cr.org_idAND crh_first_posted.first_posted_record_flag(+) = 'Y'ORDER BY hp.party_name
--库存事务处理
SELECT pv.vendor_name,poh.segment1,mmt.transaction_quantity,rt.quantity,mmt.rcv_transaction_id,mmt.transaction_type_id,xal.accounted_dr,xal.accounted_cr,OOD.ORGANIZATION_NAMEFROM mtl_material_transactions mmt,rcv_transactions rt,po_headers_all poh,po_vendors pv,xla_ae_lines xal,gl_code_combinations_v gcc,xla_ae_headers xah,xla.xla_events xe,xla.xla_transaction_entities xte,org_organization_definitions oodWHERE 1 = 1AND xal.code_combination_id = gcc.code_combination_idAND gcc.segment3 = '22020201'AND xal.ae_header_id = xah.ae_header_idAND xah.event_id = xe.event_idAND xe.entity_id = xte.entity_idAND xte.entity_code = 'MTL_ACCOUNTING_EVENTS'AND mmt.transaction_id = xte.source_id_int_1AND mmt.rcv_transaction_id = rt.transaction_id(+)AND rt.po_header_id = poh.po_header_id(+)AND poh.vendor_id = pv.vendor_id(+)AND ood.organization_id = mmt.organization_idAND to_char(mmt.transaction_date, 'YYYY-MM') = '2015-02';
--付款
-- 从应付付款追溯
SELECT jh.name 总账日记账名称jh.je_source 总账日记账来源jh.je_category 总账日记账分类jh.description 总账日记账说明jh.currency_code 总账币别jh.period_name 总账会计期间jh.default_effective_date 总账有效日期jl.je_line_num 总账行号gcc.concatenated_segments 总账账户jl.accounted_dr 总账入账借方jl.accounted_cr 总账入账贷方jl.description 总账行说明xal.ae_line_num 分类账行号xal.accounted_dr 分类账借方金额xal.accounted_cr 分类账贷方金额nvl(xal.accounted_dr, 0) - nvl(xal.accounted_cr, 0) 分类账余额xal.description 分类账行说明su.vendor_name 供应商名称sus.vendor_site_code 供应商地点to_char(ac.check_number) 付款或付款编号ac.check_date 发票或付款日期FROM gl_je_headers jh,gl_je_lines jl,gl_import_references gir,gl_code_combinations_kfv gcc,xla_ae_lines xal,xla_ae_headers xah,xla.xla_transaction_entities xte,ap.ap_checks_all ac,ap.ap_suppliers su,ap.ap_supplier_sites_all susWHERE jh.je_header_id = jl.je_header_idAND jl.je_header_id = gir.je_header_idAND jl.je_line_num = gir.je_line_numAND jl.code_combination_id = gcc.code_combination_idAND gir.gl_sl_link_id = xal.gl_sl_link_idAND gir.gl_sl_link_table = xal.gl_sl_link_tableAND xal.application_id = xah.application_idAND xal.ae_header_id = xah.ae_header_idAND xah.application_id = xte.application_idAND xah.entity_id = xte.entity_idAND xte.source_id_int_1 = ac.check_idAND xte.entity_code = 'AP_PAYMENTS'AND ac.vendor_id = su.vendor_idAND ac.vendor_id = sus.vendor_idAND ac.vendor_site_id = sus.vendor_site_idAND ac.org_id = sus.org_idAND xal.displayed_line_number > 0AND jh.ACTUAL_FLAG = 'A'--AND su.vendor_name = '&供应商名称-- AND gcc.segment1 like 'A14%'AND gcc.code_combination_id = 31322--AND gcc.segment2 = '&部门--AND gcc.segment3 = '&会计科目AND jl.period_name = '2015-07'
--采购
SELECT jh.name 总账日记账名称jh.je_source 总账日记账来源jh.je_category 总账日记账分类jh.description 总账日记账说明jh.currency_code 总账币别jh.period_name 总账会计期间jh.default_effective_date 总账有效日期jl.je_line_num 总账行号gcc.concatenated_segments 总账账户jl.accounted_dr 总账入账借方jl.accounted_cr 总账入账贷方jl.description 总账行说明xal.ae_line_num 分类账行号xal.accounted_dr 分类账借方金额xal.accounted_cr 分类账贷方金额nvl(xal.accounted_dr, 0) - nvl(xal.accounted_cr, 0) 分类账余额xal.description 分类账行说明su.vendor_name 供应商名称sus.vendor_site_code 供应商地点to_char(ac.check_number) 付款或付款编号ac.check_date 发票或付款日期FROM gl_je_headers jh,gl_je_lines jl,gl_import_references gir,gl_code_combinations_kfv gcc,xla_ae_lines xal,xla_ae_headers xah,xla.xla_transaction_entities xte,ap.ap_checks_all ac,ap.ap_suppliers su,ap.ap_supplier_sites_all susWHERE jh.je_header_id = jl.je_header_idAND jl.je_header_id = gir.je_header_idAND jl.je_line_num = gir.je_line_numAND jl.code_combination_id = gcc.code_combination_idAND gir.gl_sl_link_id = xal.gl_sl_link_idAND gir.gl_sl_link_table = xal.gl_sl_link_tableAND xal.application_id = xah.application_idAND xal.ae_header_id = xah.ae_header_idAND xah.application_id = xte.application_idAND xah.entity_id = xte.entity_idAND xte.source_id_int_1 = ac.check_idAND xte.entity_code = 'AP_PAYMENTS'AND ac.vendor_id = su.vendor_idAND ac.vendor_id = sus.vendor_idAND ac.vendor_site_id = sus.vendor_site_idAND ac.org_id = sus.org_idAND xal.displayed_line_number > 0AND jh.ACTUAL_FLAG = 'A'--AND su.vendor_name = '&供应商名称-- AND gcc.segment1 like 'A14%'AND gcc.code_combination_id = 31322--AND gcc.segment2 = '&部门--AND gcc.segment3 = '&会计科目AND jl.period_name = '2015-07'
转载于:https://www.cnblogs.com/jenrry/p/10020780.html
Oracle EBS SLA取值相关推荐
- Oracle EBS SLA概述摘录
Oracle EBS SLA概述摘录 SLA概述 SLA :子分类账(Subledger Accounting),这个在R12中大力宣扬的内容, 我们通常的认为总账就是对Journal的汇总, 但是在 ...
- Oracle什么情况使用omf,从参数取值看Oracle OMF特性
Oracle10g以后,在目录结构和文件管理方面推出两个特性OFA和OMF.OFA(Oracle Flexiable Architecture)是进行目录结构约束规范的特性.诊断文件diag.日志.数 ...
- oracle 12c omf,从参数取值瞅Oracle OMF特性
当前位置:我的异常网» 数据库 » 从参数取值瞅Oracle OMF特性 从参数取值瞅Oracle OMF特性 www.myexceptions.net 网友分享于:2014-05-17 浏览:1 ...
- Oracle EBS 值层次结构查询SQL
Oracle EBS 值层次结构查询SQL -- 查看层次结构 -- 值层次结构 SELECT ffvcv.flex_value -- 子值 ,ffvcv.description -- 说明 ,ffv ...
- 序列循环oracle,Oracle创建序列及循环自增取值问题-Oracle
Oracle创建序列及循环自增取值问题 用sys登陆Oracle SQL> conn sys/root as sysdba; 创建sequence SQL> create sequence ...
- Oracle EBS 基础概念:值集@多层从属值集
参考: https://wenku.baidu.com/view/aa5de31b0066f5335a8121bc.html 需求:客户地址的省/市/ 区可为任意输入值,需要定义一个省/市/ 区的三级 ...
- Oracle EBS 应收账龄取数SQL
取值来源与总账 SELECT decode(gcc.segment5, '0', gcc.segment6, gcc.segment5) cus_code,gcc.segment3,trunc(nv ...
- EBS的TAX的取值。
--行的税值 SELECT * FROM zx_lines; --所有的行类型的不是为'TAX'的行. SELECT * FROM zx_lines_det_factors; --分配行的税的取值 S ...
- Oracle EBS MRP模块之预测冲减
Oracle EBS MRP模块之预测冲减 基本概念 预测冲减的定义 基于原始预测,使用已计划的销售订单减少相应的预测数量,以得到当前预测. 当前预测=原始预测-客户订单. 预测冲减的方法 第一类,在 ...
最新文章
- 3、基于多播、安全认证的corosync集群(VIP、Httpd、Filesystem)
- python批量下载文件只有1kb_Python 实现批量从不同的Linux服务器下载文件
- 记一次Debian11安装
- APIO2015 酱油记
- 丈夫博士毕业想离婚,妻子要求家务补偿!法院判了
- 2名数学家或发现史上最快超大乘法运算法,欲破解困扰人类近半个世纪的问题...
- MyBatis日志插件:Mybatis Log Plugin——将控制台输出的mybatis日志转化成可执行的sql语句
- [debug] 命令行窗口运行.py文件,报错No module named XXX
- java8的新特性详解-----------Lamda表达式
- 读文件fread函数的用法
- mysql 数据库设计实例_一个简单数据库设计例子
- Proteus的使用总结
- Bootstrap INSPINIA 2.9.3 – 响应式管理模板
- 链接Maya和UE4实现real-time预览——Connecting Maya to Unreal with Live Link
- 数学对于编程有多重要?
- web开发技巧-Worker
- 根据点、旋转轴、旋转角度,计算点旋转之后的位置
- 基于惯性传感器的轨迹记录系统
- java彩票机选生成
- Win10连接上了wifi,但显示Internet无网络访问权限的解决方法