Skip to Content
0
Former Member
Apr 19, 2011 at 09:48 AM

error

19 Views

Hi,

Pls look at this query this query is running successfully and giving desired output.. but using this query when i design the qld

sap is getting closed.. pls help experts.

select DelNo,CardName,ItemCode,Dscription,Price,Sales,Stock,Stock-Sales Excess,(Stock-Sales)/Sales Variance,Price*Sales TotAmt from

(SELECT T1.docentry DelNo, T1.[ItemCode], T1.[Dscription],sum(T1.[Quantity]) Sales, T1.[Price] ,T0.[CardName],

(select (S_OITM.[OnHand]) + sum(S_DLN1.[Quantity]) from DLN1 S_DLN1

inner join OITM S_OITM ON S_DLN1.ItemCode = S_OITM.ItemCode

where S_DLN1.DocEntry >= T1.DocEntry and S_DLN1.[ItemCode]=T1.[ItemCode] group by S_OITM.[OnHand]) Stock FROM ODLN T0

INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry

Group By T1.docentry,T1.[ItemCode], T1.[Dscription] , T1.[Price],T0.[CardName]

) AA

regards,

RV