select

we.wip_entity_name                          任务号
      ,mfg_lookups_wjs.meaning               作业状态
      ,wdj.class_code                                任务类型
      ,msi1.segment1                               装配编码
      ,msi1.description                              装配描述
      ,wdj.scheduled_start_date          计划完成日期
      ,wdj.scheduled_completion_date 计划完成日期
      ,nvl(wdj.start_quantity
          ,0)                                             计划数量
      ,nvl(wdj.quantity_completed
          ,0)                                             完成数量
      ,msi2.segment1                              物料编码
      ,msi2.description                             物料描述
      ,nvl(wro.required_quantity
          ,0)                                             需求数量
      ,nvl(wro.quantity_issued
          ,0)                                             发料数量
      ,nvl(wro.required_quantity
          ,0) - nvl(wro.quantity_issued
                   ,0)                                    未发数量
      ,wro.supply_subinventory                供应子库
      ,ml.meaning                                   供应类型
      ,onhand.subinventory_code                   子库
      ,onhand.TRANSACTION_QUANTITY   子库数量
      ,(select nvl(sum(moq.TRANSACTION_QUANTITY),0)
        from   apps.mtl_onhand_quantities moq
        where  moq.organization_id=851
        and    moq.inventory_item_id=msi2.inventory_item_id) 现有量
from wip.wip_discrete_jobs          wdj
      ,wip.wip_requirement_operations wro
      ,inv.mtl_system_items_b         msi1
      ,inv.mtl_system_items_b         msi2
      ,wip.wip_entities               we
      ,bom.cst_item_costs             cic
      ,applsys.fnd_lookup_values      ml
      ,applsys.fnd_lookup_values      mfg_lookups_wjs
      ,(select moq.inventory_item_id,
               moq.subinventory_code,
               sum(moq.TRANSACTION_QUANTITY) TRANSACTION_QUANTITY              
        from   apps.mtl_onhand_quantities moq
        where  moq.organization_id=x
        group by moq.inventory_item_id,
        moq.subinventory_code) onhand
 where we.organization_id = x
   and wdj.wip_entity_id = we.wip_entity_id
   and wdj.organization_id = we.organization_id
   and msi1.inventory_item_id = we.primary_item_id
   and msi1.organization_id = we.organization_id
   and wro.wip_entity_id = wdj.wip_entity_id
   and wro.organization_id = wdj.organization_id
   and msi2.inventory_item_id= wro.inventory_item_id
   and msi2.organization_id = wro.organization_id
   and onhand.inventory_item_id(+)=msi2.inventory_item_id
   and ml.lookup_type = 'WIP_SUPPLY'
   and ml.lookup_code = wro.wip_supply_type
   and (mfg_lookups_wjs.lookup_type = 'WIP_JOB_STATUS')
   and (wdj.status_type = mfg_lookups_wjs.lookup_code)
   and cic.inventory_item_id = msi2.inventory_item_id
   and cic.organization_id = msi2.organization_id
   and cic.cost_type_id = 1
   and mfg_lookups_wjs.meaning <> '已关闭'
   and ml.meaning not like '虚拟件'
   and trunc(wdj.scheduled_completion_date) between
       to_date('20**/01/01'
              ,'yyyy-mm-dd') and
       to_date('20**/01/31'
              ,'yyyy-mm-dd')
   and mfg_lookups_wjs.language = 'ZHS'
   and ml.language = 'ZHS'
   and nvl(wro.required_quantity
          ,0) - nvl(wro.quantity_issued
                   ,0) > 0
   and nvl(wdj.start_quantity
          ,0) = nvl(wdj.quantity_completed
                   ,0)
   order by 1,10

Oracle EBS-SQL (WIP-15):检查车间任务物料未发数量与现有量对照.sql的更多相关文章

  1. Oracle EBS R12 WIP Component Issue&Return Process

    oracleassemblytransactionscomponentsjobsreference 目录(?)[-] 定义BOM 定义Routing 定义WIP Discrete Job 发料 Mat ...

  2. Oracle EBS 隐藏帮助-诊断-检查

  3. Oracle EBS DBA常用SQL - 安装/补丁【Z】

    Oracle EBS DBA常用SQL - 安装/补丁 检查应用补丁有没有安装:select bug_number,last_update_date from ad_bugs where bug_nu ...

  4. Oracle EBS中分类账和法人实体 的关系(有sql语句实例)

    Oracle EBS中分类账和法人实体 的关系(有sql语句实例) 2012-12-06 16:05 2822人阅读 评论(0) 收藏 举报  分类: Oracle EBS(12)  Oracle数据 ...

  5. oracle锁表查询,资源占用,连接会话,低效SQL等性能检查

    查询oracle用户名,机器名,锁表对象 select l.session_id sid, s.serial#, l.locked_mode, l.oracle_username, l.os_user ...

  6. [转]oracle EBS 基础100问

    from:http://www.cnblogs.com/xiaoL/p/3593691.html  http://f.dataguru.cn/thread-51057-1-1.html 1001 OR ...

  7. Oracle EBS R12经验谈(二)

    作者: jianping.ni    时间: 2009-2-13 12:52     标题: Oracle EBS R12经验谈(二) OAF页面:银行帐户开户人LOV值列表无值    在输入 应付超 ...

  8. Oracle EBS应用笔记整理 (转自IT++ flyingkite)

    ***************************************************** Author: Flyingkite Blog:   http://space.itpub. ...

  9. 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 ...

随机推荐

  1. php 联系电话验证(手机和固话)

    $tel='要验证的联系电话'; $isMob="/^1[3-5,8]{1}[0-9]{9}$/"; $isTel="/^([0-9]{3,4}-)?[0-9]{7,8} ...

  2. UI原则之-拼车

    1.简洁------------一目了然,简洁明了 2.易用------------操作方便 3.直观.快速-------快速定位到所需信息 4.友好-------网络延时.超时.等待 5.易懂--- ...

  3. 安全HTTPS-全面详解对称加密,非对称加密,数字签名,数字证书和HTTPS【下】

    1.  HTTPS 1.1. 什么是HTTPS HTTPS(HypertextTransfer Protocol Secure)即安全的HTTP.HTTPS的安全基础是安全套接层(Secure Soc ...

  4. ac命令根据/var/log/wtmp文件登录退出时间计算用户连接时间

    ac命令根据/var/log/wtmp文件登录退出时间计算用户连接时间

  5. Android 获取系统内置Intent

    1,掉web浏览器 Uri myBlogUri = Uri.parse("http://www.yzmanga.com"); returnIt = new Intent(Inten ...

  6. 从txt中读入数据到数组中(fscanf)

    C-sources: #include<stdio.h> int main() { FILE* fp; //定义一个文件 fp = fopen("p5.txt",&qu ...

  7. Python中and和or

    转自:http://unei66.blog.163.com/blog/static/544640292010320745886/ python中的and和or 4.6. and 和 or 的特殊性质在 ...

  8. SQLite.dll混合模式程序集是针对“v2.0.50727”版的运行时生成的,在没有配置其他信息的情况下,无法在 4.0 运行时中加载该程序集。

    其他信息: V5.7.4.4 Can't find the System.Data.SQLite.dll more info : 混合模式程序集是针对"v2.0.50727"版的运 ...

  9. Vbox 未指定XXX网络名称 找不到网卡问题

    链接方式不止Host-Only 我一般选桥连 选择 VBoxNetFltM.inf VBoxNetFltM.inf VirtualBox的桥接网络驱动程序的INF文件(Miniport:端口) VBo ...

  10. CSS架构目标

    擅长CSS的Web开发人员不仅可以从视觉上复制实物原型,还可以用代码进行完美的呈现.无需使用表格.尽可能少的使用图片.如果你是个名副其实的高手,你可以快速把最新和最伟大的技术应用到你的项目中,比如媒体 ...