Syntax
The sap_describe_fields
function returns a table that provides metadata about the fields of a given SAP table or structure. Here’s a detailed description of each column in the output:
pos: Position of the field within the table or structure. This is typically a four-digit number (e.g., 0001, 0002).
is_key: Indicates whether the field is a key field (‘X’) or not (blank). Key fields are crucial for uniquely identifying a record in the table.
field: The name of the field. This is the technical name used within SAP.
text: A descriptive text or label for the field. This is a more human-readable description of what the field represents.
decimals: The number of decimal places for numerical fields. This is typically a six-digit number (e.g., 000000, 000004).
check_table: The name of the check table associated with the field. A check table is used to validate the values entered in the field.
ref_table: The name of the reference table, if the field references another table.
ref_field: The name of the reference field in the reference table, if applicable.
language: The language code (e.g., ‘E’ for English) for the descriptive text.
The function has the following signature:
SELECT * FROM sap_describe_fields([col0 = "<tablename>"])
Example usage
SELECT * FROM SAP_DESCRIBE_FIELDS('SPFLI');