UFD1 table in SAP Business One (User-Defined Fields (valid values))

UFD1 is the SAP Business One table of valid values for user-defined fields: one row per value of a UDF dropdown, with the stored value (FldValue) and its description. It joins to the field definition in CUFD on TableID and FieldID, so it turns the code stored in a U_ column into the text users see.

UFD1 key fields

FieldWhat it holds
TableIDTable of the user-defined field. Joins to CUFD.TableID.
FieldIDField number. Joins to CUFD.FieldID.
IndexIDPosition of the value in the list.
FldValueValue stored in the U_ column.
DescrDescription shown to users.
FldDateDate value.

How UFD1 relates to other tables

UFD1 is the value list of CUFD: TableID plus FieldID point to one UDF, and IndexID orders the values. A UDF without valid values has no rows in UFD1. The business table stores FldValue in its U_ column, not the description.

Common joins

  • UFD1 T1 INNER JOIN CUFD T0 ON T0.TableID = T1.TableID AND T0.FieldID = T1.FieldID (field definition)
  • OINV T2 LEFT JOIN UFD1 T1 ON T1.TableID = 'OINV' AND T1.FieldID = <FieldID> AND T1.FldValue = T2.U_<name> (description of a stored value)

When you use the UFD1 table

Use UFD1 to show the description of a UDF value on reports, to list the dropdown values of every UDF, and to find stored values that are no longer in the list.

Example query: valid values of every udf in the database

SQL Server

SELECT T0.TableID, 'U_' + T0.AliasID AS ColumnName, T0.Descr AS FieldDescr,
  T1.IndexID, T1.FldValue, T1.Descr AS ValueDescr
FROM UFD1 T1
INNER JOIN CUFD T0 ON T0.TableID = T1.TableID AND T0.FieldID = T1.FieldID
ORDER BY T0.TableID, T0.AliasID, T1.IndexID

SAP HANA (column names in double quotes)

SELECT T0."TableID", 'U_' || T0."AliasID" AS "ColumnName", T0."Descr" AS "FieldDescr",
  T1."IndexID", T1."FldValue", T1."Descr" AS "ValueDescr"
FROM UFD1 T1
INNER JOIN CUFD T0 ON T0."TableID" = T1."TableID" AND T0."FieldID" = T1."FieldID"
ORDER BY T0."TableID", T0."AliasID", T1."IndexID"

Paste either version in Tools → Queries → Query Generator. Need the other dialect for your own query? Use the SQL to HANA converter.

Common pitfall: Joining on FieldID only

FieldID is numbered per table, so field 0 exists in OINV, OCRD and every other table with UDFs. A join on FieldID without TableID multiplies the rows and mixes values of different fields. Always join on TableID and FieldID together. See CUFD table (UDF definitions).

Questions about the UFD1 table

How do I join UFD1 to CUFD?

On TableID and FieldID together.

Is the description or the value stored in the U_ column?

The value (UFD1.FldValue). UFD1.Descr is the text shown to users.

Why does a UDF have no rows in UFD1?

It has no valid values defined; it is a free-entry field.

Related tables

CUFD (User-Defined Fields (descriptions)) · OUTB (User-Defined Tables) · 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.