Oracle EBS-SQL (CST-1):检查BOM历史成本查询(Average Cost).sql
select msi1.segment1 父件编码,
msi1.description 父件描述,
msi1.primary_uom_code 父件单位,
msi2.segment1 子件编码,
msi2.description 子件描述,
msi2.primary_uom_code 子件单位,
bcb.component_quantity BOM用量,
bcb.component_yield_factor 产出率,
cos.item_cost 子件成本
from inv.mtl_system_items_b msi1,
inv.mtl_system_items_b msi2,
bom.bom_structures_b bsb,
bom.bom_components_b bcb,
(select cic.inventory_item_id,
cic.organization_id,
nvl((select max(mc.actual_cost) item_cost
from MTL_CST_ACTUAL_COST_DETAILS mc
where nvl(mc.actual_cost, 0) <> 0
and mc.inventory_item_id = cic.inventory_item_id
and mc.organization_id = cic.organization_id
and exists
(select 'X'
from (select mct.transaction_id,
mct.inventory_item_id,
mct.organization_id,
max(mct.creation_date)
from MTL_CST_ACTUAL_COST_DETAILS mct
where nvl(mct.actual_cost, 0) <> 0
and mct.organization_id = Y
and trunc(mct.creation_date) <=to_date('&DATE_YYYY_MM_DD', 'yyyy-mm-dd')
group by mct.transaction_id,
mct.inventory_item_id,
mct.organization_id) a
where a.transaction_id = mc.transaction_id
and a.inventory_item_id = mc.inventory_item_id
and a.organization_Id = mc.organization_id
and a.transaction_id = mc.transaction_id)
group by 1),
cic.item_cost) item_cost
from bom.cst_item_costs cic
where cic.cost_type_id = 2)cos
where msi1.inventory_item_id = bsb.assembly_item_id
and msi1.organization_id = bsb.organization_id
and msi2.inventory_item_id = bcb.component_item_id
and msi2.organization_id = to_number(bcb.pk2_value)
and bsb.bill_sequence_id = bcb.bill_sequence_id
and bcb.disable_date is null
and msi1.organization_id = Y
and msi2.inventory_item_id = cos.inventory_item_id
and msi2.organization_id = cos.organization_Id
and msi1.segment1 = '&item_number'
Oracle EBS-SQL (CST-1):检查BOM历史成本查询(Average Cost).sql的更多相关文章
- Oracle EBS中分类账和法人实体 的关系(有sql语句实例)
Oracle EBS中分类账和法人实体 的关系(有sql语句实例) 2012-12-06 16:05 2822人阅读 评论(0) 收藏 举报 分类: Oracle EBS(12) Oracle数据 ...
- Oracle EBS-SQL (BOM-18):检查BOM与工艺路线对照.sql
/*有工艺路线,无BOM清单*/ select msi.segment1, msi.description from apps.BOM_OPERATIONAL_ROUTINGS bor, apps.m ...
- Oracle EBS 隐藏帮助-诊断-检查
- Oracle EBS DBA常用SQL - 安装/补丁【Z】
Oracle EBS DBA常用SQL - 安装/补丁 检查应用补丁有没有安装:select bug_number,last_update_date from ad_bugs where bug_nu ...
- oracle锁表查询,资源占用,连接会话,低效SQL等性能检查
查询oracle用户名,机器名,锁表对象 select l.session_id sid, s.serial#, l.locked_mode, l.oracle_username, l.os_user ...
- [转]oracle EBS 基础100问
from:http://www.cnblogs.com/xiaoL/p/3593691.html http://f.dataguru.cn/thread-51057-1-1.html 1001 OR ...
- Oracle EBS Model Function Technical
♡.Oracle EBS(ERP)Oracle 是公司名字,这个我估计大家都知道.EBS是E-Business Suite的缩写,简单的说,就是Oracle做的一个企业级的信息化软件或者系统,里面包含 ...
- Oracle EBS应用笔记整理 (转自IT++ flyingkite)
***************************************************** Author: Flyingkite Blog: http://space.itpub. ...
- Oracle EBS R12 (12.1.3) Installation Linux(64 bit)
Oracle EBS R12 (12.1.3) Installation Linux(64 bit) Contents Objective. 3 1 Download & Unzip. 3 D ...
随机推荐
- 【转】iOS代码规范
原文地址: http://www.cocoachina.com/ios/20150908/13335.html 简介: 本 文整理自Apple文档<Coding Guidelines for C ...
- 三星S5驱动安装
三星S5的驱动安装一定要先用原装的数据线链接电脑,在电脑里面安装完驱动之后,以后才能每次都用正常的数据线链接 不然的话会提示某些驱动安装不正常..
- Service、Alarm与BroadcastReceiver的使用方法
1:定义一个服务类,在服务类中使用AlarmManager 来管理服务的运行 public class WtacService extends Service{ private AlarmManage ...
- A(51)和C(51)相互调用
C语言是一种编译型程序设计语言,它兼顾了多种高级语言的特点,并可以调用汇编语言的子程序.用C语言设计开发微控制器程序已成为一种必然的趋势.Franklin C51是一种专门针对Intel 8051系列 ...
- IE input X 去掉文本框的叉叉和密码输入框的眼睛图标
从IE 10开始,type="text" 的 input 在用户输入内容后,会自动产生一个小叉叉(X),方便用户点击清除已经输入的文本对于type="password&q ...
- Android之自定义checkbox样式
大部分情况下,我们在UI中并不采用Android自带的checkbox复选框样式,这时候就需要我们自定义自己的checkbox. 首先找两张checkbox背景图片,比如下图样子的: 然后在drawa ...
- java List与数组互转
数组转List:String[] arr = new String[] {"str1", "str2"};List<String> list = A ...
- [Medusa-dev] psp_handler - embed python in HTML like ASP
[Medusa-dev] psp_handler - embed python in HTML like ASP [Medusa-dev] psp_handler - embed python in ...
- orcl改变临时表空间的指令
sqlplus / as sysdba: alter database tempfile 'D:\oracle\product\10.2.0\oradata\zhongnan\temp01.dbf' ...
- poj 2411 新写法
别以为我在刷水题.... 今天做了场srm,500pt想到了是dp但是无从下手,但是看了rng_58的神代码后顿觉海阔天空啊(盯着看了一个下午),相比于一年前的写法,真的是不忍直视啊, TC真是个好地 ...