2020-09-06 11:41发布
加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)
嗨,
我正在寻找没有发票分支明智查询报告的交货单。 谁能帮我吗?
亲爱的Renel:
在下面的查询中尝试以下操作:
SELECT
TT.DocDate,TT.CardName,TT.SlpName, SUM(TT.DocTotal -TT.RETURN)作为AMT,SUM(TT.GrossProfit-TT.RGrossProift)来自( 选择"发票" AS DocType, T0.DocNum,T0.DocDate,T0.CardName,T2.SlpName, SUM(T1.LineTotal)AS DocTotal, SUM(T1.GrssProfit)AS GrossProfit,RETURN ='0',RGrossProift ='0' 从ODLN T0内部联接DLN1 T1到T0.DocEntry = T1.DocEntry 内连接OSLP T2开启T0.SlpCode = T2.SlpCode T0.DocDate> ='[%0]'和T0.DocDate <='[%1]'AND T1.WhsCode ='[%2]'和T0.DocStatus ='O' GROUP BY T0.DocNum,T0.DocDate,T0.CardName,T2.SlpName
UNION ALL
'Sales Return'AS DocType, T3.DocNum,T3.DocDate,T3.CardName,T5.SlpName,'0','0' SUM(T4.LineTotal)作为返回值,SUM(T4.GrssProfit)作为RGrossProift 从ORDN T3内连接RDN1 T4上T3.DocEntry = T4.DocEntry内连接OSLP T5上T3.SlpCode = T5.SlpCode T3.DocDate> ='[%0]'和T3.DocDate <='[%1]'和T4.WhsCode ='[%2]'和T0.DocStatus ='O' 按T3.DocNum,T3.DocDate,T3.CardName,T5.SlpName分组) GROUP BY TT.DocDate,TT.CardName,TT.SlpName
问候
Dinesh PN
最多设置5个标签!
亲爱的Renel:
在下面的查询中尝试以下操作:
SELECT
TT.DocDate,TT.CardName,TT.SlpName, SUM(TT.DocTotal -TT.RETURN)作为AMT,SUM(TT.GrossProfit-TT.RGrossProift)来自( 选择"发票" AS DocType, T0.DocNum,T0.DocDate,T0.CardName,T2.SlpName, SUM(T1.LineTotal)AS DocTotal, SUM(T1.GrssProfit)AS GrossProfit,RETURN ='0',RGrossProift ='0' 从ODLN T0内部联接DLN1 T1到T0.DocEntry = T1.DocEntry 内连接OSLP T2开启T0.SlpCode = T2.SlpCode T0.DocDate> ='[%0]'和T0.DocDate <='[%1]'AND T1.WhsCode ='[%2]'和T0.DocStatus ='O' GROUP BY T0.DocNum,T0.DocDate,T0.CardName,T2.SlpName
UNION ALL
SELECT
'Sales Return'AS DocType, T3.DocNum,T3.DocDate,T3.CardName,T5.SlpName,'0','0' SUM(T4.LineTotal)作为返回值,SUM(T4.GrssProfit)作为RGrossProift 从ORDN T3内连接RDN1 T4上T3.DocEntry = T4.DocEntry内连接OSLP T5上T3.SlpCode = T5.SlpCode T3.DocDate> ='[%0]'和T3.DocDate <='[%1]'和T4.WhsCode ='[%2]'和T0.DocStatus ='O' 按T3.DocNum,T3.DocDate,T3.CardName,T5.SlpName分组) GROUP BY TT.DocDate,TT.CardName,TT.SlpName
问候
Dinesh PN
一周热门 更多>