CUFD table in SAP Business One (User-Defined Fields (descriptions))

CUFD is the SAP Business One table that describes every user-defined field (UDF): one row per table and field, with the field name (AliasID), description, type, size, default value, required flag and the linked table. The UDF itself is a column named U_ plus AliasID in the table given by TableID; its valid values are in UFD1.

CUFD key fields

FieldWhat it holds
TableIDTable the field belongs to, for example OINV.
FieldIDField number within the table. Together with TableID it identifies the field.
AliasIDField name (title). The database column is U_ plus this name.
DescrField description.
TypeIDField type.
EditTypeEdit type (subtype).
SizeID / EditSizeSize and edit size.
DfltDefault value.
NotNullY = required entry field.
IndexIDY = create index.
RTableLinked table. Joins to OUTB.TableName.
RelUDO / RelSORelated user-defined object and related system object.

How CUFD relates to other tables

CUFD is the definition layer of UDFs. UFD1 holds the valid values of a field, joined on TableID and FieldID. RTable points to a user-defined table in OUTB when the field is linked to one. The values typed by users are not in CUFD: they are in the U_ columns of the business table itself.

Common joins

  • CUFD T0 LEFT JOIN UFD1 T1 ON T1.TableID = T0.TableID AND T1.FieldID = T0.FieldID (valid values)
  • CUFD T0 LEFT JOIN OUTB T2 ON T2.TableName = T0.RTable (linked user-defined table)

When you use the CUFD table

Use CUFD to document all UDFs of a company before an upgrade or migration, to find required fields that block DI API or Service Layer posts, and to compare UDFs between a test and a live database.

Example query: all udfs of the a/r invoice header with their valid values

SQL Server

SELECT T0.TableID, T0.FieldID, 'U_' + T0.AliasID AS ColumnName, T0.Descr, T0.TypeID,
  T0.SizeID, T0.NotNull, T0.Dflt, T1.FldValue, T1.Descr AS ValueDescr
FROM CUFD T0
LEFT JOIN UFD1 T1 ON T1.TableID = T0.TableID AND T1.FieldID = T0.FieldID
WHERE T0.TableID = 'OINV'
ORDER BY T0.FieldID, T1.IndexID

SAP HANA (column names in double quotes)

SELECT T0."TableID", T0."FieldID", 'U_' || T0."AliasID" AS "ColumnName", T0."Descr", T0."TypeID",
  T0."SizeID", T0."NotNull", T0."Dflt", T1."FldValue", T1."Descr" AS "ValueDescr"
FROM CUFD T0
LEFT JOIN UFD1 T1 ON T1."TableID" = T0."TableID" AND T1."FieldID" = T0."FieldID"
WHERE T0."TableID" = 'OINV'
ORDER BY T0."FieldID", 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: Querying AliasID without the U_ prefix

CUFD.AliasID stores the name without the prefix, but the column in the business table is U_ plus that name. A query that selects the AliasID as typed fails with an invalid column error. Also join UFD1 on TableID and FieldID together; FieldID alone repeats in every table. See UFD1 table (UDF valid values).

Questions about the CUFD table

Where are user-defined fields defined in SAP Business One?

In CUFD, one row per table (TableID) and field (FieldID). Valid values are in UFD1.

What is the column name of a UDF?

U_ followed by CUFD.AliasID, in the table named in CUFD.TableID.

How do I find required UDFs?

Filter CUFD.NotNull = 'Y'.

Related tables

UFD1 (User-Defined Fields (valid values)) · 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.