Start a project

Business partners missing a tax ID

Active customers and vendors with no federal tax ID (VAT / RUC / NIT / NTN).

Tables: OCRDUse: E-invoicing readiness: ZATCA, SRI and FEL reject documents without it.

Tool

SELECT T0.CardCode, T0.CardName, T0.CardType, T0.LicTradNum
FROM OCRD T0
WHERE T0.frozenFor = 'N' AND (T0.LicTradNum IS NULL OR LTRIM(RTRIM(T0.LicTradNum)) = '')
ORDER BY T0.CardType, T0.CardCode
Need your UDFs in this report, or a dashboard? We extend it for your company.Customize it →

What this query answers

Before switching on e-invoicing, the implementation lead needs a clean list of active customers and vendors with no tax ID, because tax authority platforms reject documents without one. It is also a useful monthly data-quality check for the master-data team.

Sample output

Illustrative demo values. Your columns are the same; the numbers come from your company.

CardCodeCardNameCardTypeLicTradNum
C70010Harbor Street MarketC
C70024Green Valley ClinicC
V30005City Cleaning ServicesS

SQL Server vs SAP HANA

LTRIM(RTRIM(...)) is valid on HANA as well, so only quoting changes. HANA treats an empty string and NULL as different values, which is why both checks in the OR are kept.

Common errors and fixes

  • Placeholder tax IDs are not caught: Values like '0000000000', 'N/A' or '-' are not empty. Add conditions such as T0.LicTradNum IN ('N/A', '-') or a LEN() check for the length your country requires.
  • Leads appear in the list: CardType 'L' is a lead. Add AND T0.CardType IN ('C', 'S') to check only customers and vendors.
  • The tax ID is filled on the invoice but the partner is listed: Some localizations store the tax ID per address (CRD1.LicTradNum). Check the address-level field before changing the master data.

Need this report built into SAP Business One?

A saved query answers the question once. We build SAP Business One e-invoicing integration: invoices and credit memos go from SAP to the tax authority, and the status comes back to SAP. Or hire a dedicated SAP B1 developer for the whole job, fixed price per phase.

Admin

Related queries

Table reference: OCRD table (Business Partners)

How it works

Three steps, no signup

1

Copy the right version

Use the SQL Server tab for MS SQL databases and the HANA tab for SAP B1 on HANA.

2

Open Query Generator

In SAP Business One go to Tools → Queries → Query Generator, paste and click Execute.

3

Save and share

Click Save, pick a category and give the query a name. Your team can run it from Query Manager.

FAQ

Questions about this tool

How do I run the business partners missing a tax id 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 OCRD 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.

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.