Skip to Content

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

Exclude A/P Credit Memo from this Query

Hello All,

i am trying to figure out to exclude A/P Invoice that it was already Credit Memo with my existing Query

SELECT

max(T0.DocDate) as 'Date',

max(T1.CardName) as 'Vendor Name',

max(T0.Address) as 'Vendor Address',

count(T0.DocNum) as 'No. of Invoices',

max(T1.LicTradNum) as 'TIN No.',

sum(T0.BaseAmnt) as 'Base Amount',

sum(T0.VatSum) as 'Input Tax',

max(T1.ECVatGroup ) as 'TaxCode',

max(T2.WTCode) as 'WtaxCode'

FROM OPCH T0  INNER JOIN OCRD T1 ON T0.CardCode = T1.CardCode

left join PCH5 T2 on T0.DocEntry = T2.AbsEntry

WHERE T0.DocDate BETWEEN '[%0]' and '[%1]' and T0.VatSum <> 0

GROUP BY T1.CardCode

Please help mew revise my Query.

this is connected with my previous question How to Identify A/P Invoice that was Credit Memo  but i cannot figure out how to incorporate PCH1.TargetEntry

Please Help.

Thank You.

Fidel

Former Member
Not what you were looking for? View more on this topic or Ask a question