SAP tableObjectSTXHModuleABAP

STXH table — SAPscript Text Header Table

STXH is the header table for SAPscript texts (long texts, standard texts, notes). One row identifies a single text object instance by object type, name, text ID and language, and points to the actual text lines stored separately in STXL. It does not contain the text content itself, only metadata about which text exists and when it was last changed.

STXH is the control table behind every SAPscript long text stored in the system, from purchase order item texts to customer master notes. This page covers how to read the key correctly, how STXH relates to STXL, and the recurring mistake of treating a missing STXH row as proof that text was never entered.

Published 15 Sept 2026· 1,106 words

What it stores

Each row in STXH represents one SAPscript text object instance: a specific combination of text object (e.g. a sales order, a material, a purchase order item), text ID (which text slot within that object, such as header text or item note), language, and name (the key that ties the text back to the business document or master record). The row carries administrative data about that text - format, line size, line count, who last maintained it and when - but the actual text content, line by line, lives in STXL. STXH exists so the system can check whether a text exists and retrieve its metadata without reading the full text body. Every long text field on an SAP screen backed by SAPscript, rather than a simple character field, generates entries here when text is saved.

Key fields

  • MANDT - client
  • TDOBJECT - text object, identifies the application area the text belongs to (e.g. material, sales document, vendor)
  • TDNAME - the object key, this is what links the text back to the business record it belongs to
  • TDID - text ID, distinguishes which specific text slot this is within the object (header note, item text, internal memo)
  • TDSPRAS - language key of the text
  • TDLINESIZE - line width the text was maintained with
  • TDLINECNT - number of lines stored in STXL for this header
  • TDFORMAT - text format indicator
  • TDFDATE - date the text was last changed
  • TDFTIME - time the text was last changed
  • TDFUSER - user who last changed the text

How it joins the data model

  • STXH-TDOBJECT = STXL-TDOBJECT and STXH-TDNAME = STXL-TDNAME and STXH-TDID = STXL-TDID and STXH-TDSPRAS = STXL-TDSPRAS, joins the header to its actual text lines
  • STXH-TDSPRAS = T002-SPRAS, resolves the language key to a readable language description
  • STXH-TDNAME resolves against the key of the owning business object, for example the sales document number, material number or vendor number, depending on TDOBJECT - there is no generic foreign key, the interpretation is object-dependent
  • STXH-TDID validated against the domain of fixed values that documents the meaningful text IDs for a given TDOBJECT

How to read it safely

STXH is client-dependent and can be very large in a mature system because every long text saved anywhere, from a scribbled internal note on a purchase order to a formal customer contract clause, creates a row. Never select on TDOBJECT alone or on TDFDATE alone across the whole client - both are low selectivity and the table will have millions of rows in an established landscape. Always restrict on the full composite key: TDOBJECT plus TDNAME plus TDID, and add TDSPRAS if the language is known. If only the business document number is known, first confirm which TDOBJECT and TDID apply to that document type before querying, otherwise the same TDNAME value can exist under multiple unrelated objects and pull in noise.

How to prove it in the data

Symptom: a user claims text was entered on a document but it does not print or does not show on redisplay. Select STXH with TDOBJECT for that document type, TDNAME equal to the document number, and TDID equal to the expected text ID. If no row is returned, the text was never saved under that ID, or it was saved against a different TDID or a different TDNAME format (padding, leading zeros) than expected. If a row exists, check TDLINECNT is greater than zero and then confirm matching lines actually exist in STXL for the same key.

ECC vs S/4HANA

STXH remains a live table in S/4HANA. SAPscript long text storage was not replaced by the S/4HANA data model changes the way many classic tables were, though many newer applications prefer other text storage mechanisms outside SAPscript entirely. Where SAPscript is still used, the same STXH and STXL pairing applies unchanged. No CDS compatibility view is generally needed because the underlying table structure and technology did not change.

Common pitfalls

  • A missing STXH row is read as 'text was deleted' when it may simply have been saved with a different TDID, or under a different TDNAME format such as unpadded versus zero-padded document numbers - always check the exact key format the application uses before concluding text is missing
  • TDLINECNT greater than zero does not guarantee STXL has readable content, corruption or incomplete transport can leave a header without matching lines, so the two tables should be checked together, never STXH alone
  • TDFDATE and TDFUSER reflect the last save of the header, not necessarily the last meaningful content change, a text can be re-saved unchanged and refresh these fields, misleading anyone trying to date when content actually changed
  • Assuming TDOBJECT values are consistent in meaning across modules, the same short text object code can be reused for very different business content depending on configuration, so TDOBJECT alone is not enough to identify what a text is for without also knowing TDID
  • Deleting rows directly from STXH via direct table maintenance without also removing the STXL lines leaves orphaned line data and can cause runtime errors the next time the application tries to read that text through its intended function module
  • Treating STXH as searchable by text content, it is not, the actual words are in STXL, so any content-based search has to go through STXL or the appropriate text read function module, not STXH

Whose problem this is

A question about missing or wrong long text on a document is first the functional consultant's problem, since the correct TDOBJECT and TDID for that document type are configuration knowledge. The ABAP or basis team gets involved only when STXH and STXL are inconsistent with each other, or when a mass text migration or transport has left orphaned or duplicate entries.

Related SAP objects

Reviewed pages this object connects to in the ERPClimb knowledge graph.

Source: ERPClimb — https://erpclimb.com/sap-tables/stxhERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.