sap_describe_fields

Lists all tables available in the SAP system.

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:

  1. pos: Position of the field within the table or structure. This is typically a four-digit number (e.g., 0001, 0002).

  2. 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.

  3. field: The name of the field. This is the technical name used within SAP.

  4. text: A descriptive text or label for the field. This is a more human-readable description of what the field represents.

  5. decimals: The number of decimal places for numerical fields. This is typically a six-digit number (e.g., 000000, 000004).

  6. 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.

  7. ref_table: The name of the reference table, if the field references another table.

  8. ref_field: The name of the reference field in the reference table, if applicable.

  9. 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');