sap mes 15.3 eq库存 盘盈盘亏分摊逻辑 未完待续

sap mes  15.3 eq库存 盘盈盘亏分摊逻辑

1.取盘盈盘亏条码

with ta as /*取盘盈盘亏条码   1/2 */
 (select site, storage_location, item, unit_of_measure, qty, comment9 inventory_id, created_date_time +
          8 / 24 created_date_time, 'InventoryBO:' || site || ',' || comment9 inventory_bo
  from z_inventory_transaction2 x
  where apportion = 'N' and ( /*x.TRANSACTION_REASON_CODE = 'Z01A' or 此处暂时只考虑 盘亏的部分*/
         x.transaction_reason_code = 'Z01A')
  order by x.storage_location, item)

2.盘盈盘亏条码 串查EQ信息 

with ta as /*取盘盈盘亏条码   1/2 */
 (select site, storage_location, item, unit_of_measure, qty, comment9 inventory_id, created_date_time +
          8 / 24 created_date_time, 'InventoryBO:' || site || ',' || comment9 inventory_bo
  from z_inventory_transaction2 x
  where apportion = 'N' and ( /*x.TRANSACTION_REASON_CODE = 'Z01A' or 此处暂时只考虑 盘亏的部分*/
         x.transaction_reason_code = 'Z01A')
  order by x.storage_location, item),
ta1 as /*盘盈盘亏条码 串查EQ信息  2/2 */
 (select ta.*, iad.data_attr so_num, iad1.data_attr so_line_num, iad2.data_attr wbs_num
  from ta, inventory_assy_data iad, inventory_assy_data iad1, inventory_assy_data iad2
  where (ta.inventory_bo = iad.inventory_bo(+) and
        iad.data_field(+) = 'SO_NUM') /*串查销售单号*/
        and (ta.inventory_bo = iad1.inventory_bo(+) and
        iad1.data_field(+) = 'SO_LINE_NUM') /*串查销售行*/
        and (ta.inventory_bo = iad2.inventory_bo(+) and
        iad2.data_field(+) = 'WBS_NUM') /*串查wbs*/ /*盘盈盘亏条码串查EQ*/
  )

3.线边仓匹配产线

with ta as /*取盘盈盘亏条码   1/2 */
 (select site, storage_location, item, unit_of_measure, qty, comment9 inventory_id, created_date_time +
          8 / 24 created_date_time, 'InventoryBO:' || site || ',' || comment9 inventory_bo
  from z_inventory_transaction2 x
  where apportion = 'N' and ( /*x.TRANSACTION_REASON_CODE = 'Z01A' or 此处暂时只考虑 盘亏的部分*/
         x.transaction_reason_code = 'Z01A')
  order by x.storage_location, item),
ta1 as /*盘盈盘亏条码 串查EQ信息  2/2 */
 (select ta.*, iad.data_attr so_num, iad1.data_attr so_line_num, iad2.data_attr wbs_num
  from ta, inventory_assy_data iad, inventory_assy_data iad1, inventory_assy_data iad2
  where (ta.inventory_bo = iad.inventory_bo(+) and
        iad.data_field(+) = 'SO_NUM') /*串查销售单号*/
        and (ta.inventory_bo = iad1.inventory_bo(+) and
        iad1.data_field(+) = 'SO_LINE_NUM') /*串查销售行*/
        and (ta.inventory_bo = iad2.inventory_bo(+) and
        iad2.data_field(+) = 'WBS_NUM') /*串查wbs*/ /*盘盈盘亏条码串查EQ*/
  ),
tb as /*线边仓匹配产线 1/2*/
 (select distinct sl.storage_location, /*slm.*,*/ wcm.work_center_bo
  from storage_location sl, storage_location_member slm, work_center_member wcm
  where slm.storage_location_bo = sl.handle and exists
   (select 1 from ta where ta.storage_location = sl.storage_location) /*限定只返回涉及盘盈盘亏的仓库*/
        and wcm.work_center_or_resource_gbo = slm.work_center_bo)

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值