Skip to Content

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

A/R Aging Report

Dear Experts,

Good day!

I have seen a report here in SCN where it allows me to generated Aging Report using a query.

select T1.cardcode 'Bp Code',T1.cardname 'Name',sysdeb 'Debit Amount',syscred 'Credit Amount',

(T0.BALDUEDEB - T0.BALDUECRED) as 'Balance Due',

case T0.transtype

when '13' then 'INV'

when '14' then 'AR CN'

when '24' then 'INCOMING'

else 'Other'

end 'Type',

Ref1,

fccurrency 'BP Currency',

CONVERT(VARCHAR(10), refdate, 103) 'Posting Date',

CONVERT(VARCHAR(10), duedate, 103) 'Due Date',

CONVERT(VARCHAR(10), taxdate, 103) 'Doc Date' ,

CASE when (DATEDIFF(dd,refdate,current_timestamp))+1 < 31 then

case

when BALDUECRED <> 0 then -BALDUECRED

else BALDUEDEB

end

end "0-30 days",

case when ((datediff(dd,refdate,current_timestamp))+1 > 30

and (datediff(dd,refdate,current_timestamp))+1< 61)

then

case

when BALDUECRED <> 0 then -BALDUECRED

else BALDUEDEB

end

end "31 to 60 days",

case when ((datediff(dd,refdate,current_timestamp))+1 > 60

and (datediff(dd,refdate,current_timestamp))+1< 91)

then case when BALDUECRED <> 0 then -BALDUECRED else BALDUEDEB  end end "61 to 90 days",

CASE

when (DATEDIFF(dd,refdate,current_timestamp))+1 > 90

then

case

when BALDUECRED= 0 then BALDUEDEB

when BALDUEDEB= 0 then -BALDUECRED

end

end "90 + days"

from dbo.JDT1 T0

INNER JOIN dbo.OCRD T1 ON T0.shortname = T1.cardcode and T1.cardtype = 'c'

where T0.intrnmatch = '0' and T0.BALDUEDEB != T0.BALDUECRED and t1.CardName='[%0]'

ORDER BY T1.CARDCODE, T0.taxdate

The problem is the correct age per transaction was not displayed because the report is considering only the current system date. What if I want to see the report for a specific period of time and not only the current date?

Thank you!

Ashley

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