cancel
Showing results for 
Search instead for 
Did you mean: 

Customer Receivables Aging by Sales employee

Former Member
0 Kudos

Hi, I am making a custom Aging Report. Right now I have a query to Get all the AR Invoice/AR Credit Memo balance  of Customers By Sales Employee but It's not  tally when I compare It on B1 Aging Report  because Journal Entry/Incoming/Outgoing are included In B1 Aging Report. How can I tally the balance due on B1 Aging Report? This my my query right know.

Select SUM(BalanceDue),SlpCode from (select Sum(DocTotal-a.PaidToDate)As BalanceDue,a.SlpCode  from

  oinv a inner join oslp b  on a.slpcode=b.slpcode

  inner join JDT1 c on c.TransId=a.TransId

  inner join OCRD d on d.cardcode=a.cardcode

  where a.CANCELED='N'

  and a.DocTotal-a.PaidToDate<>0

  and a.DocDate between '01/01/1990'

  and '09/25/2014'

  and c.ShortName=a.CardCode and d.Balance<>0 Group By a.SlpCode

union all

select Sum(DocTotal-a.PaidToDate)*-1 As BalanceDue,a.SlpCode from

  ORIN a inner join oslp b  on a.slpcode=b.slpcode

  inner join JDT1 c on c.TransId=a.TransId

  inner join OCRD d on d.cardcode=a.cardcode

  where a.CANCELED='N'

  and a.DocTotal-a.PaidToDate<>0

  and a.DocDate between '01/01/1990'

  and '09/25/2014'

  and c.ShortName=a.CardCode and  d.Balance<>0  Group By a.SlpCode)A group by SlpCode

Accepted Solutions (0)

Answers (1)

Answers (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Please refer this thread:

http://scn.sap.com/thread/3243178

Thanks & Regards,

Nagarajan