User-defined fields in SAP Business One to extend documents

Publications

SAP Business One User-Defined Fields: Extend Your Documents Without Programming

Hector Pincheira

Hector Pincheira

CIO | CTO
Digital Strategy & Technology Innovation

items

SAP Business One User-Defined Fields They are the tool that turns your standard ERP into a system tailored to your operations, and the best part is that you don't need to write a single line of code to achieve it. Imagine the scene, so common in any company: you need to record the sales channel on each invoice, the container number on each import, or the person responsible for each purchase order. The field simply doesn't exist in the standard form. So your team ends up jotting that data down in the comments field, in a parallel spreadsheet, or, worst of all, in someone's memory.

That scattered data is information your company generates but cannot leverage. Therefore, when it comes time to analyze sales by channel or track an import, the information is not where it should be. In this tutorial, you will learn how to create, configure, and audit custom fields professionally, so that every piece of data is structured, available, and ready for reporting.

What are SAP Business One User-Defined Fields and why you need them

A user-defined field, or UDF, is an additional field that you create on a standard system table without altering its base structure. For example, you can add a «Sales Channel» field to the invoice header, a «Production Batch» field to the manufacturing order lines, or a «Risk Level» field to the business partner master data. SAP stores each field with the prefix U_, which allows you to easily identify and consult it.

The strategic advantage is clear: you capture exactly the data your business needs, at the exact point where it is generated. Furthermore, by living within the ERP, that data is natively integrated with reports, formatted searches, alerts, and Crystal Reports. Consequently, you stop relying on parallel spreadsheets that no one maintains and that age poorly. In this way, a field well-designed today transforms into an axis of analysis tomorrow.

SAP Business One User-Defined Fields - structuring business data in documents
Every note you jot down in the margin today can become a structured and analyzable field.

Prerequisites before starting

Before creating your first field, make sure you have the following. First, you need a user with «Superuser» permissions or explicit authorization over the customization tools. However, keep a golden rule in mind: the creation of user fields requires exclusive database access, meaning no other user can be connected to that company while you are defining the field. Therefore, plan this task outside of operating hours.

Secondly, define the purpose of the field on paper first: what data it will capture, what table it lives in, what type of value it supports, and whether it will be mandatory. Next, check that the data does not already exist in a standard field; many companies duplicate information by not thoroughly exploring the form. As a result of this prior planning, you will avoid orphan fields that no one uses.

Step-by-step tutorial: create your first field

Step 1. Open the field manager. Go to the menu Tools → Customization Tools → User-Defined Fields – Management. A window will open with the category tree where SAP organizes all fields by their location in the system.

Step 2. Choose the correct category. This decision is critical because it determines on which forms the field will appear. For example, «Master Data → Business Partners» adds the field to the customer or vendor master record, while «Marketing Documents → Header» adds it to the header of invoices, orders, and deliveries. In contrast, «Marketing Documents → Rows» adds it to each line of the document. Therefore, choose based on where the data actually originates.

Step 3. Define the field. Press «Add» and complete the title (for example, Sales Channel), the description, the data type, and the length. Next, review the available types: alphanumeric for text, numeric for quantities, date/time for deadlines, and «units and totals» for monetary values. In this way, the system will automatically validate what the user enters.

Step 4. Set valid values. Here is the difference between an amateur field and a professional one. In the «Define valid values for the field» tab, upload a closed list of options, for example: «TIENDA», «WEB», «MAYORISTA», «EXPORTACION». As a result, the user chooses from a drop-down menu instead of typing free text. This way, you prevent «web», «Web», «WEB », and «página» from coexisting as if they were different channels and ruining your reports.

Step 5. Set dependencies and obligatoriness. You can mark the field as mandatory or make it dependent on another. For example, the «Discount Reason» field only appears if the discount exceeds a certain threshold. However, use mandatory fields judiciously: a forced field that the user does not understand generates garbage data just to get by. Finally, click «Update» and confirm. The system will create the field with the prefix U_ in the corresponding table.

SAP Business One User Defined Fields - auditing with SQL queries on the CUFD and UFD1 tables
Every field you create is recorded in the CUFD and UFD1 tables, ready to be audited with SQL.

Audit your fields with SQL queries

All the metadata for your fields lives in two system tables: CUFD save the definitions and UFD1 save the valid values. Therefore, with SQL you can inventory, audit, and control your customizations without opening form by form. Below are three essential queries, each in its version for SQL Server and SAP HANA.

1. Complete inventory of user fields

This query lists all the fields created in the company, along with their table, alias, description, and type. In this way, you get a map of all your customizations in seconds.

SQL Server

-- Inventory of all user-defined fields (UDF)
SELECT
    T0.TableID  AS "Table",
    T0.AliasID  AS "Field",
    T0.Descr    AS "Description",
    CASE T0.TypeID
        WHEN 'A' THEN 'Alphanumeric'
        WHEN 'N' THEN 'Numeric'
        WHEN 'D' THEN 'Date/Time'
        WHEN 'B' THEN 'Units and Totals'
        ELSE T0.TypeID
    END         AS "Type",
    T0.EditSize AS "Length"
FROM CUFD T0
ORDER BY T0.TableID, T0.AliasID;

SAP HANA

-- Inventory of all user-defined fields (UDF)
SELECT
    T0."TableID"  AS "Table",
    T0."AliasID"  AS "Field",
    T0."Descr"    AS "Description",
    CASE T0."TypeID"
        WHEN 'A' THEN 'Alphanumeric'
        WHEN 'N' THEN 'Numeric'
        WHEN 'D' THEN 'Date/Time'
        WHEN 'B' THEN 'Units and Totals'
        ELSE T0."TypeID"
    END           AS "Type",
    T0."EditSize" AS "Length"
FROM CUFD T0
ORDER BY T0."TableID", T0."AliasID";

2. Valid values configured in a field

When you need to check what options a dropdown has, this query joins CUFD with UFD1 and returns the complete list. For example, for the field Sales Channel.

SQL Server

-- Valid values for a specific field
SELECT
    T0.AliasID  AS "Field",
    T0.Descr    AS "Field_Description",
    T1.FldValue AS "Value",
    T1.Descr    AS "Value_Description"
FROM CUFD T0
INNER JOIN UFD1 T1 ON T0.TableID = T1.TableID AND T0.FieldID = T1.FieldID
WHERE T0.AliasID = 'Canal_Venta'
ORDER BY T1.IndexID;

SAP HANA

-- Valid values for a specific field
SELECT
    T0."AliasID"  AS "Field",
    T0."Descr"    AS "Field_Description",
    T1."FldValue" AS "Value",
    T1."Descr"    AS "Value_Description"
FROM CUFD T0
INNER JOIN UFD1 T1 ON T0."TableID" = T1."TableID" AND T0."FieldID" = T1."FieldID"
WHERE T0."AliasID" = 'Sales_Channel'
ORDER BY T1."IndexID";

3. Detect documents with empty required field

This is the control that separates reliable data from incomplete data. The query searches for invoices where the field Sales Channel It remained empty, so you can correct the screenshot before reporting.

SQL Server

-- Invoices with the user field uncompleted
SELECT
    T0.DocNum   AS "Invoice",
    T0.DocDate  AS "Date",
    T0.CardName AS "Customer",
    T0.DocTotal AS "Total"
FROM OINV T0
WHERE ISNULL(T0.U_Canal_Venta, '') = ''
  AND T0.DocDate >= '2026-01-01'
ORDER BY T0.DocDate DESC;

SAP HANA

-- Invoices with the user field uncompleted
SELECT
    T0."DocNum"   AS "Invoice",
    T0."DocDate"  AS "Date",
    T0."CardName" AS "Customer",
    T0."DocTotal" AS "Total"
FROM OINV T0
WHERE IFNULL(T0."U_Canal_Venta", '') = ''
  AND T0."DocDate" >= '2026-01-01'
ORDER BY T0."DocDate" DESC;

Variations and real-world use cases

Custom fields shine when they solve a specific problem. For example, in the sales area, they allow segmenting sales by channel, campaign, or external salesperson. In addition, in logistics, they record the container number, the shipping company, or the incoterm of each import. In production, they capture the batch, the shift, or the machine responsible for each order. However, the greatest value appears when you combine the field with a formatted search that completes it automatically, or with a Alert that warns when it is empty.

Another powerful use case is linking a user-defined field to a user-defined table (UDT). This way, the drop-down list is not populated with fixed text, but with records from a table that you manage, such as a catalog of reasons or distribution centers. As a result, you maintain the list in a single place and all documents consume it consistently.

Best practices and common mistakes

First, name your fields with a clear convention and in uppercase without spaces, for example SALES_CHANNEL instead of sales channel. Second, always prefer valid values over free text; free text is the main source of useless reports. Third, document every field you create, because a field without an owner and without a purpose becomes noise over time.

Among the most frequent mistakes is creating duplicate fields by not checking existing ones, as well as overusing required fields and forcing the user to invent data. However, the most costly mistake is not auditing: many companies create dozens of fields and never check if they are being filled out. Therefore, periodically run the queries from this tutorial and turn your fields into living information, not dead columns.

Official SAP Resources

For more details, refer to the SAP Business One online help on the portal help.sap.com, «Customization Tools» section, and the guide «How to Configure User-Defined Fields, Tables and Objects» available in the SAP Business One Customer Portal. In addition, the SAP Community maintains active threads on advanced UDF use cases and their exploitation in Crystal Reports.

Conclusion

User-defined fields are the fastest and safest way to adapt SAP Business One to your reality without depending on programming or external consultants. Consequently, any data that currently lives outside the system can become an analysis axis that drives better decisions. Start with a single field, configure it with valid values, and audit it with the queries you just learned.

Do you want to master SAP Business One customization from end to end? In the Strategic Circle you will find advanced tutorials, ready-to-use queries, and guidance to transform your ERP into a real competitive advantage. Join and take your operation to the next level.

Most Read

Ballena jorobada bajo el agua con su aleta pectoral extendida: la esperanza en la tecnología y la biomimética
La ballena que volvió: la esperanza en la tecnología y la que no cabe en un tablero
SAP data in ChatGPT: an open door at the far end of a dark room
The Tab Next Door: The SAP Data in ChatGPT That Nobody Authorized
SAP Business One Purchase Price Variance - featured image of the tutorial
SAP Business One Purchase Price Variance: Detect the Inflation in Your Buying Costs
QlikSense format changeovers: actual minutes against the standard
QlikSense Format Changeovers: the Minutes Nobody Bills
QlikSense buttons and actions: executive dashboard with indicators
QlikSense Buttons and Actions: the Dashboard that Runs the Meeting
SAP Business One Internal Reconciliation - featured image of the tutorial
SAP Business One Internal Reconciliation: Clear False Open Items

RELATED ARTICLES