Invoices created per user today
How many A/R invoices each SAP B1 user created today, with the total value.
Tool
SELECT T1.USER_CODE, T1.U_NAME, COUNT(T0.DocEntry) AS Invoices, SUM(T0.DocTotal) AS TotalValue FROM OINV T0 INNER JOIN OUSR T1 ON T0.UserSign = T1.USERID WHERE T0.CreateDate = CONVERT(date, GETDATE()) GROUP BY T1.USER_CODE, T1.U_NAME ORDER BY Invoices DESC
SELECT T1."USER_CODE", T1."U_NAME", COUNT(T0."DocEntry") AS "Invoices", SUM(T0."DocTotal") AS "TotalValue" FROM OINV T0 INNER JOIN OUSR T1 ON T0."UserSign" = T1."USERID" WHERE T0."CreateDate" = CURRENT_DATE GROUP BY T1."USER_CODE", T1."U_NAME" ORDER BY "Invoices" DESC
What this query answers
At the end of the day the billing supervisor wants to see how many invoices each person entered and their total value. It helps balance workload across the team and is a quick audit check after a busy closing day.
Sample output
Illustrative demo values. Your columns are the same; the numbers come from your company.
| USER_CODE | U_NAME | Invoices | TotalValue |
|---|---|---|---|
| billing1 | Maria Lopez | 37 | 52480 |
| billing2 | Omar Saleh | 29 | 41275.5 |
| manager | System Manager | 4 | 9800 |
SQL Server vs SAP HANA
CONVERT(date, GETDATE()) becomes CURRENT_DATE. OUSR columns USER_CODE, U_NAME and USERID are already upper case, so the quotes around them are harmless on HANA.
Common errors and fixes
- Zero rows right after midnight or for a remote team: Today is taken from the database server clock. If the server is in another time zone, add or subtract hours from GETDATE() (or CURRENT_TIMESTAMP) before taking the date.
- Counts differ from who last edited the invoice: UserSign is the creator. To see who last changed a document, join on T0.UserSign2 instead.
Need this report built into SAP Business One?
A saved query answers the question once. We offer SAP Business One support on a retainer: add-on and integration fixes, upgrade testing, small changes and new reports. Or hire a remote SAP Business One developer for the whole job, fixed price per phase.
Related queries
Table reference: OINV table (A/R Invoice (header)) · OUSR table (Users)
Three steps, no signup
Copy the right version
Use the SQL Server tab for MS SQL databases and the HANA tab for SAP B1 on HANA.
Open Query Generator
In SAP Business One go to Tools → Queries → Query Generator, paste and click Execute.
Save and share
Click Save, pick a category and give the query a name. Your team can run it from Query Manager.
Questions about this tool
How do I run the invoices created per user today query in SAP Business One?
Copy the version that matches your database, open Tools → Queries → Query Generator, paste it in the SQL box and click Execute. Save it to reuse it later.
Which tables does this query use?
It reads OINV, OUSR from the standard SAP Business One schema. No user-defined fields are needed.
Can this be turned into a dashboard or alert?
Yes. We turn queries into Crystal reports, Excel reports that refresh themselves, SAP B1 alerts or WhatsApp messages for managers.
Built for SAP Business One teams
Need this inside SAP Business One?
We build add-ons, reports and integrations for SAP B1 on SQL Server and HANA. Tell us what you need and get a fixed price, usually within 24 hours.
