cancel
Showing results for 
Search instead for 
Did you mean: 

Item wise purchase return query

former_member377094
Participant
0 Kudos

Dear Expert,

Advance thanks for help...

Pls find below query which one reflect item wise purchase return in these query i want to add vendor code & vendor name and require filter of From Date & To Date option.

SELECT T0.[DocNum][PONO], T1.[ItemCode], T1.[Dscription], T1.[Quantity][Purchased Qty],

T3.[Quantity][Recieved Qty],T5.[Quantity][Returned Qty],  T2.[DocNum][GRPO No], T4.[DocNum][GoodsReturn No]

FROM OPOR T0  INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry,

OPDN T2 INNER JOIN PDN1 T3 ON T2.DocEntry = T3.DocEntry,

ORPD T4 INNER JOIN RPD1 T5 ON T4.DocEntry = T5.DocEntry

WHERE T3.[BaseRef] =  T0.[DocNum] and  T5.[BaseRef]  = T2.[DocNum]

GROUP BY T0.[DocNum], T1.[ItemCode], T1.[Dscription], T1.[Quantity],

T3.[Quantity],T5.[Quantity],  T2.[DocNum], T4.[DocNum]

I really appreciate if you kindly help me on this because i am functional person and i want to acquire technical knowledge also.....

Thanks & Regards,

Pratik D. Patel

Accepted Solutions (1)

Accepted Solutions (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Above query is not linked correctly. Please try this query and add required fields.

SELECT T0.[CardCode], T0.[CardName], T0.[DocNum], T0.[DocDate], T1.[ItemCode], T1.[Quantity], T3.[DocNum], T3.[DocDate], T2.[Quantity], T5.[DocNum], T5.[DocDate], T4.[Quantity] FROM OPOR T0  INNER JOIN POR1 T1 ON T0.[DocEntry] = T1.[DocEntry] left join  PDN1 T2 on  T2.[BaseEntry]  =  T1.[DocEntry]  and  T2.[BaseLine]  =  T1.[LineNum] INNER JOIN OPDN T3 ON T2.[DocEntry] = T3.[DocEntry] left join  RPD1 T4 on  T4.[BaseEntry]  =  T2.[DocEntry] and  T4.[BaseLine]  =  T2.[LineNum] LEFT JOIN ORPD T5 ON T4.[DocEntry] = T5.[DocEntry] WHERE T0.[DocDate]  between [%0] and [%1]

Thanks

former_member377094
Participant
0 Kudos

Dear sir,

I really appreciate the data coming perfect but it is possible to coming only those data which one to create goods return txn.

because i want to compare only those GRPO which one Goods return txn will be create...

Kindly help.

Regards,

Pratik D. Patel

Answers (0)