SAP B1 中查看已分配批次明细

SAP B1 中查看已分配批次明细

-- =============================================
-- Author:  袁英杰
-- Create date: 2023-10-03
-- Description: 传入锁货类型(比如销售订单的锁货,-99时返回所有类型的锁货),返回该类型的所有未清的锁货行明细
-- =============================================
CREATE FUNCTION getBatchAllocDetail (@AllocateTP INT)
   RETURNS TABLE
AS
RETURN (SELECT t3.AllocateTp,
               t3.AllocatEnt,
               t3.AllocateLn,
               t3.ItemCode,
               Sum (AllocQty) AllocQty,
               t2.DistNumber,
               t2.AbsEntry,
               t3.LocCode
        FROM ITL1 (NOLOCK) t1
             INNER JOIN OBTN (NOLOCK) t2 ON t1.MdAbsEntry = t2.AbsEntry
             INNER JOIN OITL (NOLOCK) t3 ON t1.LogEntry = t3.LogEntry
        WHERE (t3.AllocateTp = @AllocateTP OR @AllocateTP = -99)
        GROUP BY AllocateTp,
                 AllocatEnt,
                 AllocateLn,
                 t3.ItemCode,
                 t2.DistNumber,
                 t3.LocCode,
                 t2.AbsEntry
        HAVING Sum (AllocQty) > 0)

  • 6
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值