OSLP table in SAP Business One (Sales Employees)
OSLP is the SAP Business One table of sales employees (and buyers): one row per person with a code, name, commission percentage, active flag and an optional link to the employee master. Documents and business partners store SlpCode, so OSLP gives the name behind sales-by-salesperson and commission reports.
OSLP key fields
| Field | What it holds |
|---|---|
SlpCode | Sales employee code, the key. OINV.SlpCode, ORDR.SlpCode and OCRD.SlpCode point to it. |
SlpName | Sales employee name. |
Commission | Commission percentage of the sales employee. |
GroupCode | Commission group (OCOG). |
Active | Y = active, N = inactive. |
Locked | Y = locked, N = not locked. |
EmpID | Employee in the employee master. Joins to OHEM.empID. |
Memo | Remarks. |
Telephone / Mobil / Email | Contact details. |
UserSign | User who created the record. Joins to OUSR.USERID. |
How OSLP relates to other tables
OSLP is master data. Marketing documents carry SlpCode on the header (OINV, ORDR and the other document headers) and on the lines (INV1.SlpCode), and OCRD.SlpCode holds the default sales employee of the business partner. OSLP.EmpID links the sales employee to OHEM.
Common joins
OINV T0 INNER JOIN OSLP T1 ON T1.SlpCode = T0.SlpCode (sales employee of the invoice)ORDR T2 INNER JOIN OSLP T1 ON T1.SlpCode = T2.SlpCode (sales employee of the order)OCRD T3 LEFT JOIN OSLP T1 ON T1.SlpCode = T3.SlpCode (default sales employee of the customer)OSLP T1 LEFT JOIN OHEM T4 ON T4.empID = T1.EmpID (employee master)
When you use the OSLP table
Use OSLP for sales by salesperson, commission calculations, open orders per sales employee and to check which customers have no sales employee assigned.
Example query: invoiced sales and commission per sales employee this year
SQL Server
SELECT T1.SlpCode, T1.SlpName, T1.Commission, SUM(T0.DocTotal - T0.VatSum) AS SalesExclTax, SUM(T0.DocTotal - T0.VatSum) * T1.Commission / 100 AS CommissionAmount FROM OINV T0 INNER JOIN OSLP T1 ON T1.SlpCode = T0.SlpCode WHERE T0.CANCELED = 'N' AND YEAR(T0.DocDate) = YEAR(GETDATE()) GROUP BY T1.SlpCode, T1.SlpName, T1.Commission ORDER BY SalesExclTax DESC
SAP HANA (column names in double quotes)
SELECT T1."SlpCode", T1."SlpName", T1."Commission", SUM(T0."DocTotal" - T0."VatSum") AS "SalesExclTax", SUM(T0."DocTotal" - T0."VatSum") * T1."Commission" / 100 AS "CommissionAmount" FROM OINV T0 INNER JOIN OSLP T1 ON T1."SlpCode" = T0."SlpCode" WHERE T0."CANCELED" = 'N' AND YEAR(T0."DocDate") = YEAR(CURRENT_TIMESTAMP) GROUP BY T1."SlpCode", T1."SlpName", T1."Commission" ORDER BY "SalesExclTax" DESC
Paste either version in Tools → Queries → Query Generator. Need the other dialect for your own query? Use the SQL to HANA converter.
Common pitfall: Header SlpCode versus line SlpCode
A document has a sales employee on the header and on every line (INV1.SlpCode). If lines were changed to another person, a report on the header gives the whole invoice to one employee. Decide which level your commission rule uses. SlpCode -1 is the default on OINV and OCRD, so filter or label it in reports. See Sales by sales employee query.
Ready-made queries that use OSLP
- Sales by sales employee: Invoice count and net sales per sales employee for a period.
- Open sales orders with open quantity: Every open sales order line that still has quantity to deliver.
Questions about the OSLP table
Where is the sales employee of an invoice stored?
In OINV.SlpCode on the header and INV1.SlpCode on each line. Join either to OSLP.SlpCode to get SlpName.
Is the commission percentage stored in OSLP?
Yes, in OSLP.Commission. OSLP.GroupCode points to the commission group.
How do I link a sales employee to an employee record?
OSLP.EmpID joins to OHEM.empID. OHEM.salesPrson holds the same link from the employee side.
Related tables
OINV (A/R Invoice (header)) · ORDR (Sales Order (header)) · OCRD (Business Partners) · OHEM (Employees (employee master data)) · search all SAP Business One tables
Sources: SAP Business One documentation and SDK (DI API database tables reference), SAP Help Portal.
Ready to get started?
Tell us what you need. You get a clear technical answer, a fixed scope and a price, usually within 24 hours.
