Skip to Content
Aug 31, 2012 at 06:08 AM

Sales Commission


Hi Experts,

Please help me generate a query with this scenario.

Although SAP can calculate commission based on gross profit, what if the basis of cost will not be from the generated cost but from the pricelist set by the company. Can this be possible?

This is my previous query with the cost as the automatic calculation generated by SAP. I want the cost price to be base on pricelist 1.

SELECT T2.[SlpName], T0.[DocNum], T0.DocTotal, ( T0.DocTotal - T0.VatSum) As "Document Total Without VAT" , T0.[GrosProfit], T2.[Commission], (T0.GrosProfit)*( T2.Commission/100) As "Total Commission" FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode WHERE T2.SlpName = N'[%0]' AND T0.DocDate >= '[%1]' AND T0.DocDate <= '[%2]'