Skip to Content
0
Former Member
May 12, 2008 at 07:12 PM

Commission report Query Question

90 Views

The inbuilt Commission Report is run by the following query:

SELECT T0.DocNum, T0.DocType, T0.DocTotal, ( T0.DocTotal - T0.VatSum) As "Net Income" , T1.SlpName, T1.Commission, ( ( T0.DocTotal - T0.VatSum)*( T1.Commission/100)) As "Sum_Commissions" FROM OINV T0 INNER JOIN OSLP T1 ON T0.SlpCode = T1.SlpCode WHERE T1.SlpName = N'[%0]' AND T0.DocDate >= '[%1]' AND T0.DocDate <= '[%2]'

However, I have a need to change this query to solve a problem:

If AFTER the Invoices are added to the system, I go back to the Invoice and change/add the Employee Name to the transaction line, the query ignores these additions made. Can I change the query so the Commission Report takes into account changes made to the employees' field AFTER invoices are posted to the system (SAP allowes me to make such changes to the employee)

In other words I would like the Query to look at the Emploee field AFTER I make changes and give me an updated report.

i am aware that SAP does not allow changes to the Invoice AFTER posting them to the system but it seems to allow changes to the Commission/Employee field, so I should be able to run a Commission report after I make these changes.

Thank you

Robert