on 03-24-2023 3:20 PM
Hi Experts, I have been developing the below query in the aim to pull through a query based on a date range of one month however SAP just seems to crash each time no matter what i change the WHERE parameters too, Please can you advise:
SELECT DISTINCT
T3.[DocNum] AS 'SO Number', T3.[DocDate] AS 'SO Date', T0.[DocNum] AS 'INV Number', T0.[DocDate], T0.[CardCode], T0.[CardName], T0.[SlpCode], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[Price], T1.[LineTotal],T2.[ItmsGrpNam] FROM OINV T0 INNER JOIN INV1 T1 ON T0.[DocEntry] = T1.[DocEntry], OITB T2, ORDR T3
WHERE T3.[DocDate] >=[%0] and T3.[DocDate] <=[%1]
Hi,
Try this
SELECT
T3.[DocNum] AS 'SO Number', T3.[DocDate] AS 'SO Date', T0.[DocNum] AS 'INV Number', T0.[DocDate], T0.[CardCode], T0.[CardName],
T0.[SlpCode], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[Price], T1.[LineTotal],T5.[ItmsGrpNam]
FROM OINV T0 INNER JOIN INV1 T1 ON T0.[DocEntry] = T1.[DocEntry]
LEFT JOIN RDR1 T2 on T1.BaseType='17' and T1.BaseEntry=T2.DocEntry and T1.BaseLine=T2.LineNum
LEFT JOIN ORDR T3 on T2.DocEntry=T3.DocEntry
LEFT JOIN OITM T4 on T1.ItemCode=T4.ItemCode
LEFT JOIN OITB T5 on T4.ItmsGrpCod = T5.ItmsGrpCod
WHERE T3.[DocDate] >=[%0] and T3.[DocDate] <=[%1]
The query is based on SO >>> AR process. If SO >>> Delivery >>> AR process, the query need to adjust for linking to DLN1, then RDR1.
Hope this helps,
Son Tran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.