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. Android 桌面生成快捷方式

    Android生成桌面快捷方式的几种方法: //------------以下为动态替换桌面应用Icon的一种解决方案------------------- // 1.获取本地目录图片的Bitmap ; ...

  2. 层次节点——NODE节点

    1.html <!DOCTYPE html> <html> <head lang="en"> <meta charset="UT ...

  3. Python zxing 库解析(条形码二维码识别)

    各种扫码软件 最近要做个二维码识别的项目,查到二维码识别有好多开源的不开源的软件 http://www.oschina.net/project/tag/238/ Zbar 首先试了一下Zbar,pyt ...

  4. TensorFlow 深度学习笔记 Stochastic Optimization

    Stochastic Optimization 转载请注明作者:梦里风林 Github工程地址:https://github.com/ahangchen/GDLnotes 欢迎star,有问题可以到I ...

  5. SQL Server数据库空间管理 (2)

     本篇内容主要解决剩余的两个问题:2).日志文件不停增长  4).自动增长和自动收缩 日志文件不停增长的解决 首先,当日志文件超过预期的时候,我们然要看看日志文件中存放了什么内容:DBCC LOG ; ...

  6. 【python】bytearray和string之间转换,用在需要处理二进制文件和数据流上

    最近在用python搞串口工具,串口的数据流基本读写都要靠bytearray,而我们从pyqt的串口得到的数据都是string格式,那么我们就必须考虑到如何对这两种数据进行转换了,才能正确的对数据收发 ...

  7. wireshark的 rdp dissector

    开源 wireshark的 rdp dissector https://github.com/boytm/wireshark_rdp. 1)support TCP reassemble 2)Fastp ...

  8. POJ-1088 Skiing(记忆化搜索)

    Description Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激.可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你.Michael想知道 ...

  9. linux下自动同步internet时间

    linux下很简单直接一句即可: ntpdate time.nist.gov ntp后面参数为internet时间服务器url或ip即可. 但是ntpdate命令需要root特权,如果做成自动运行每次 ...

  10. Vim应用

    :q!不保存退出 :set number显示行数 :wq保存并退出 ==先输入100,再输入==.从这行开始向下100行,进行自动缩进对齐