Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

help with query OINV = ODLN

I create query to display invoices based on delivery note

the result are incorrect

can someone tell me what is the problem?

select T0.DocNum,T0.DocDate,T0.CardCode ,T0.CardName ,T0.DocTotal ,T3.DocNum

from oinv T0 inner join INV1 T1 on T0.DocEntry=T1.DocEntry

inner join DLN1 T2 on T1.BaseRef=T2.DocEntry

inner join ODLN T3 on T3.DocEntry=T2.DocEntry

thank you

Elad

Former Member replied

Hi

the problem is that your connection between dln1 and inv1 is not the correct field

you should use this query :

T0.DocNum,T0.DocDate,T0.CardCode ,T0.CardName ,T0.DocTotal ,T3.DocNum


oinv T0 inner join INV1 T1 on T0.DocEntry=T1.DocEntry


join DLN1 T2 on T1.BaseEntry=T2.DocEntry


join ODLN T3 on T3.DocEntry=T2.DocEntry

shachar

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question