cancel
Showing results for 
Search instead for 
Did you mean: 

What field will report the true invoice value

Former Member
0 Kudos

This script is giving me a figure that does not always match the 'Total AR Invoice' against a customer in SAP Sales Analysis, as far as I can see the reported figure is greater than the SAP figure - can nayone help me put this right please?

SELECT

t0.cardcode as 'Customer Code',

t0.cardname as 'Customer name',

t2.slpname as 'Sales Person',

sum(t0.doctotal-t0.vatsum) as 'Invoiced Value'

FROM

oinv t0

inner join ocrd t1 on t0.cardcode = t1.cardcode

inner join oslp t2 on t1.slpcode = t2.slpcode

WHERE

t0.docdate between [%1] and [%2]

GROUP BY

t0.cardcode,

t0.cardname,

t2.slpname

HAVING

sum(t0.doctotal-t0.vatsum) > 0

ORDER BY

t2.slpname,

t0.cardcode

Thanks,

Robin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Robin,

Sales analysis will include Credit memo. Also need to take out the Having clause to check.

DocDate can be changed to TaxDate to try too.

The best solution is to retrieve data from JDT1 directly.

Check this for more info:

Thanks,

Gordon

Answers (0)