Developer ToolsFree generatorPDF, Excel, Word exportSAP ECC 6.0All SAP ECC 6.0 tools

SAP Table for Table Fields, Table Descriptions and Error Message Text: Query Generator

This generator produces an ABAP report for SAP ECC 6.0 with three modes: list a table's fields with key flag, data element, type, length and long label; find transparent tables whose description contains a word; or read the text of a message from T100. Native SQL equivalents are included as comments for DBAs who work outside the SAP GUI.

Fill in

Generated code
Download:

ABAP report: DD03L / DD02T / T100

REPORT z_ddic_and_message_lookup.

* Mode FIELDS : fields of a table with data element and long label
* Mode FIND   : transparent tables whose short text contains a word
* Mode MESSAGE: long text of a message class and number from T100

TYPES: BEGIN OF ty_field,
         position  TYPE dd03l-position,
         fieldname TYPE dd03l-fieldname,
         keyflag   TYPE dd03l-keyflag,
         rollname  TYPE dd03l-rollname,
         datatype  TYPE dd03l-datatype,
         leng      TYPE dd03l-leng,
         scrtext_l TYPE dd04t-scrtext_l,
       END OF ty_field,
       BEGIN OF ty_tab,
         tabname TYPE dd02t-tabname,
         ddtext  TYPE dd02t-ddtext,
       END OF ty_tab.

DATA: lt_fields  TYPE STANDARD TABLE OF ty_field,
      ls_field   TYPE ty_field,
      lt_tabs    TYPE STANDARD TABLE OF ty_tab,
      ls_tab     TYPE ty_tab,
      lv_msgtext TYPE t100-text,
      lv_pattern TYPE c LENGTH 64.

START-OF-SELECTION.

  CASE 'FIELDS'.

    WHEN 'FIELDS'.
* .INCLUDE rows appear with FIELDNAME '.INCLUDE' and no data element
      SELECT d3~position d3~fieldname d3~keyflag d3~rollname
             d3~datatype d3~leng d4~scrtext_l
        FROM dd03l AS d3
        LEFT OUTER JOIN dd04t AS d4
          ON  d4~rollname   = d3~rollname
          AND d4~ddlanguage = 'E'
          AND d4~as4local   = 'A'
          AND d4~as4vers    = '0000'
        INTO TABLE lt_fields
        UP TO 500 ROWS
        WHERE d3~tabname  = 'MARA'
          AND d3~as4local = 'A'
          AND d3~as4vers  = '0000'
        ORDER BY d3~position.
      LOOP AT lt_fields INTO ls_field.
        WRITE: / ls_field-position, ls_field-fieldname, ls_field-keyflag,
                 ls_field-rollname, ls_field-datatype, ls_field-leng,
                 ls_field-scrtext_l.
      ENDLOOP.

    WHEN 'FIND'.
* DDTEXT is mixed case; LIKE is case-sensitive on most databases
      CONCATENATE '%' 'Vendor' '%' INTO lv_pattern.
      SELECT t~tabname t~ddtext
        FROM dd02t AS t
        INNER JOIN dd02l AS l
          ON  l~tabname  = t~tabname
          AND l~as4local = t~as4local
          AND l~as4vers  = t~as4vers
        INTO TABLE lt_tabs
        UP TO 500 ROWS
        WHERE t~ddlanguage = 'E'
          AND t~as4local   = 'A'
          AND t~ddtext     LIKE lv_pattern
          AND l~tabclass   = 'TRANSP'.
      SORT lt_tabs BY tabname.
      LOOP AT lt_tabs INTO ls_tab.
        WRITE: / ls_tab-tabname, ls_tab-ddtext.
      ENDLOOP.

    WHEN 'MESSAGE'.
* &1..&4 (or &) in the text are filled from MSGV1..MSGV4 at runtime
      SELECT SINGLE text FROM t100 INTO lv_msgtext
        WHERE sprsl = 'E'
          AND arbgb = 'M7'
          AND msgnr = '021'.
      IF sy-subrc = 0.
        WRITE: / 'M7', '021', lv_msgtext.
      ELSE.
        WRITE: / 'Message not found in language', 'E'.
      ENDIF.

  ENDCASE.

* Native SQL equivalents for DBA tools (read-only). The schema owner
* varies by installation (often SAPSR3 on ECC, SAP<SID> or SAPABAP1):
* SELECT POSITION, FIELDNAME, KEYFLAG, ROLLNAME, DATATYPE, LENG
*   FROM SAPSR3.DD03L
*  WHERE TABNAME = 'MARA' AND AS4LOCAL = 'A' ORDER BY POSITION;
* SELECT TABNAME, DDTEXT FROM SAPSR3.DD02T
*  WHERE DDLANGUAGE = 'E' AND DDTEXT LIKE '%Vendor%';
* SELECT TEXT FROM SAPSR3.T100
*  WHERE SPRSL = 'E' AND ARBGB = 'M7' AND MSGNR = '021';

DD03L, DD04T, DD02L, DD02T and T100 are client-independent, so no MANDT filter is needed. Active versions have AS4LOCAL = 'A' and AS4VERS = '0000'. Language is the internal 1-character key (E, D, F), not the ISO code (EN, DE, FR) found in T002-LAISO. Native SQL is for read-only DBA use; confirm the schema owner on your database before running it.

Get a data map of your ECC tables

Tell us the business objects you report on and we will return the tables, keys and joins in your ECC system, including custom Z tables.

Optional. The tool and every export work without this. No spam.

Was this tool useful?

Which dictionary tables hold what

The ABAP Dictionary stores its own definitions in tables. DD02L lists tables with their class (TABCLASS TRANSP, CLUSTER, POOL, INTTAB for structures, VIEW), DD02T their short texts per language. DD03L lists fields per table with POSITION, KEYFLAG, ROLLNAME (data element), DATATYPE and LENG. DD04T holds data element texts, including the long field label SCRTEXT_L that SE16 shows as column heading. Message texts are in T100 keyed by SPRSL (language), ARBGB (message class) and MSGNR (three-digit number). All of these tables are client-independent, so they hold the same content in every client of the system.

  • DD03L: table fields (structure of a table).
  • DD02T: table descriptions; DD02L: table list and class.
  • T100: message texts; T100A: message classes.

How to use it

Pick FIELDS, enter a table such as MARA or EKPO and run the report in SE38: the list returns fields in dictionary order with the label your users see. Pick FIND and enter a word such as Vendor to locate candidate tables when you know the business object but not the table name; texts are mixed case, so try Vendor and vendor. Pick MESSAGE with class M7 and number 021 to read the text behind an error your users screenshot as M7 021. The native SQL comment block gives the same three queries for SQL tools against the database.

Gotchas

Includes show up in DD03L as rows with FIELDNAME .INCLUDE (or .INCLU-xxx for named includes) and no data element; the included fields follow as separate rows, so do not treat .INCLUDE as a column. Append structures behave the same way. Fields with no data element (rare, built-in types) get no label from DD04T, which is why the join is LEFT OUTER. Language keys trip up DBAs: SAP stores E for English in DDLANGUAGE and SPRSL, while ISO EN only appears in conversion tables. On HANA and Oracle the schema owner differs between installs, so the native SQL uses SAPSR3 only as an example.

How to check the result

Compare the FIELDS output with SE11 for the same table: key fields, order and data elements should match exactly. For FIND, open the table names in SE11 to confirm the description. For a message, SE91 with the class and number shows the same short text plus the long text (documentation), which is not in T100 but in the documentation tables. A message with placeholders such as & or &1 is filled at runtime from MSGV1 to MSGV4, so the text you see in T100 is the template, not the final message the user saw.

Frequently Asked Questions

Which SAP table stores the fields of a table?

DD03L holds the fields of every dictionary table and structure, with position, key flag, data element, data type and length. Join DD04T on ROLLNAME with DDLANGUAGE and AS4LOCAL = 'A' to get field labels. SE11 shows the same information interactively; DD03L is what you query when you need it in bulk.

What is the error message table in SAP?

T100 stores message texts by language (SPRSL), message class (ARBGB) and number (MSGNR). An error shown as M7 021 is class M7, number 021. Transaction SE91 maintains and displays messages, including the long text that explains the cause and fix, which is stored separately from T100.

Which SAP table has table descriptions?

DD02T holds the short text of each table per language. DD02L is the table list with TABCLASS, so join the two to restrict results to transparent tables (TRANSP) and exclude structures and views. Remember that DDTEXT is mixed case, so a LIKE search is case-sensitive on most databases.

Why does DD03L show .INCLUDE instead of field names?

When a table includes a structure, DD03L stores a row for the include itself with FIELDNAME .INCLUDE and PRECFIELD naming the structure, followed by rows for the included fields. Filter FIELDNAME NOT LIKE '.%' if you only want real columns, or keep the rows to see where each include begins.

If your team wants to ask your ECC system where data lives and what an error means in plain English on your own servers, we can build that over the dictionary queries shown here.

ArchRay builder
Design the on-prem AI stack for SAP ECC 6.0: model, GPUs, RAG pipeline, guardrails
See memory, speed and cost as you swap parts, then export the diagram. Free, in your browser.
Open the builder

Keep exploring