on 01-28-2015 9:59 AM
Greetings of the day Experts,
Does anyone have a query to match the GRPO Value and quantity details between GRPO and AP Invoice?
Regards.
Hi Mekhala,
Please check below Query.
SELECT T0.DocNum as GRN_No, T1.DocNum as AP_Invoice_No, T3.ItemCode as GRN_Item, T4.ItemCode as Invoice_Item,
T3.Quantity as GRN_Qty, T4.Quantity as Invoice_Qty, T0.DocTotal as GRN_DocTotal, T1.DocTotal as Invoice_DocTotel FROM OPDN T0
INNER JOIN PDN1 T3 ON T3.DocEntry = T0.DocEntry
LEFT JOIN PCH1 T4 ON T4.BaseEntry = T3.DocEntry AND T4.BaseLine = T3.LineNum
LEFT JOIN OPCH T1 ON T1.DocEntry = T4.DocEntry
WHERE T0.DocDate between [%0] and [%1]
GROUP BY T0.DocNum, T1.DocNum , T3.ItemCode , T4.ItemCode ,T3.Quantity , T4.Quantity , T0.DocTotal , T1.DocTotal
Hope this helps
--
--
Regards::::
Atul Chakraborty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Greetings of the day, Manish and Atul,
Wow, appreciate the immediate and prompt response to our help.
Thanks a lot, this would help me a lot.
The problem was i am not aware of joining three or more tables. if you can share me a guide to it, that would be more helpful in future.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try the below query
SELECT A.DocDate AS [GRPO DATE],D.DocDate AS [INVOICE DATE],A.DocNum AS [GRPO DOC NO],D.DocNum AS [INVOICE DOCNUM],B.ItemCode ,B.Quantity AS [GRPO QTY],C.Quantity AS [INVOICE QTY]
FROM OPDN A
INNER JOIN PDN1 B ON A.DocEntry=B.DocEntry
LEFT OUTER JOIN PCH1 C ON C.BaseRef=B.TrgetEntry
INNER JOIN OPCH D ON C.DOCENTRY=D.DOCENTRY LEFT OUTER JOIN ORCT E ON E.DOCENTRY=D.DOCENTRY
GROUP BY A.DocDate ,D.DocDate ,A.DocNum ,D.DocNum ,B.ItemCode ,B.Quantity ,C.Quantity
--Manish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there,
You have a question and need help by the community? Instead of posting into an old question thread, it is more helpful for you, if you create your own question. Here is how to get started:
That's it. Thank you!
Best regards
Jennifer
Your SAP Community moderator
User | Count |
---|---|
101 | |
14 | |
10 | |
5 | |
4 | |
3 | |
3 | |
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.