Skip to Content

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

Crystal Report OUtgoing payment

Hi

SELECT T2.[DocTotal] as 'Invoice total' ,T2.[DocNum] as'Invoice no',T2.[DocDate] as 'invoice date',t0.Comments,t0.CardName,T3.[CheckSum],t0.doctotal

,T3.[CheckNum],t0.DocNum,t0. CreateDate ,t4.U_NAME  

FROM [dbo].[OVPM]  T0 INNER JOIN [dbo].[VPM2]  T1 ON T0.DocNum = T1.DocNum INNER JOIN OPCH T2 ON T1.DocEntry = T2.DocEntry left join VPM1 t3 on

T0.DocNum = t3.docnum left join OUSR t4 on T0.UserSign=t4.USERID where T0.[Docentry]={?DocKey@} group by T2.[DocTotal],T2.[DocNum] ,T2.[DocDate] ,T2.doctotal,t0.Comments,t0.CardName,T3.[CheckSum],t0.doctotal

,T3.[CheckNum],t0.DocNum,t0. CreateDate,t4.U_NAME   Order BY T2.[DocNum]

The above code diplays outing payments details when the invoice is selected but when payment on account and account tab is selecte the report is showing blank.

please suggest what to include in the above code so that it dispalys details when payment on account and account tab is selected.

Attached screen shots for three scenarios.

Regards,

Karthik

Account tab.JPG (117879 B)
with invoice.JPG (134228 B)
Former Member
Former Member replied

try this

(you had another inner join to opch )

shachar

SELECT T2.[DocTotal] as 'Invoice total' ,T2.[DocNum] as'Invoice no',T2.[DocDate] as 'invoice date',t0.Comments,t0.CardName,T3.[CheckSum],t0.doctotal

,T3.[CheckNum],t0.DocNum,t0. CreateDate ,t4.U_NAME  

FROM [dbo].[OVPM]  T0 left JOIN [dbo].[VPM2]  T1 ON T0.DocNum = T1.DocNum left JOIN OPCH T2 ON T1.DocEntry = T2.DocEntry left join VPM1 t3 on

T0.DocNum = t3.docnum left join OUSR t4 on T0.UserSign=t4.USERID where T0.[Docentry]={?DocKey@} group by T2.[DocTotal],T2.[DocNum] ,T2.[DocDate] ,T2.doctotal,t0.Comments,t0.CardName,T3.[CheckSum],t0.doctotal

,T3.[CheckNum],t0.DocNum,t0. CreateDate,t4.U_NAME   Order BY T2.[DocNum]

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