Skip to Content

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

Need Help in Query

Hello Expert,

   I have created AP invoice and AP Credit memo

  In AP invoice i choose 2 items

IItemCode      Quantity         Unitprice     TaxCode      

I001                  2                  200            Vat@5

I002                  1                  100             Vat@5

AND then Added Credit memo:

I001                 1                    200             Vat@5

I Created Following Query:

SELECT T0.docentry,T0.Docnum,T0.CardCode,T0.CardName,T0.DocDate,T2.stcCode,(T2.baseSum-T5.BaseSum) as 'Tax Base Amt',(T2.taxsum-T5.TaxSum) as 'Tax Amount',(T0.docTotal-T4.DocTotal) as 'Document Total'

FROM [dbo].[OPCH]  T0 INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry

inner join PCH4 T2 on T1.DocEntry=T2.DocEntry

left outer join RPC1 T3 on T3.BaseEntry=T1.DocEntry and T3.Baseline=T1.Linenum and T3.BaseType=T1.Objtype And T3.visorder=T1.Visorder

inner join ORPC T4 on T3. DocEntry= T4.DocEntry

Inner join RPC4 T5 on T4.DocEntry=T5.DocEntry

where  T0.DocDate>=[%0] and T0.DocDate<=[%1] and (T0.docTotal-T4.DocTotal)<>0

When I execute the query it giving me wrong ans Please help me to sort out this issue.



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