WE31 — IDoc Segment Editor
WE31 is the transaction for creating, changing, displaying and releasing IDoc segment definitions, the field-level building blocks that get assembled into a basic IDoc type in WE30. The structural fact that causes most confusion: a segment has a draft definition and a separately released version, and changes to an already-released segment create a new version rather than overwriting the old one.
This page covers WE31, the editor used to define the field structure of an IDoc segment before it is assembled into a basic type. It focuses on the release/versioning mechanics that break custom IDoc development, how to prove a segment mismatch in the data, and who should own the fix.
Reviewed by an ERPClimb SAP consultant on 15 Sept 2026· 1,187 words
Purpose
WE31 maintains the definition of an IDoc segment: its name, its short text, and its ordered list of fields with their data elements or types and lengths. A segment on its own does nothing; it becomes useful only once it is assembled, together with other segments, into a basic IDoc type through WE30. Saving a segment definition in WE31 generates a DDIC structure behind the scenes, and that generated structure is what actually carries data at runtime. The single fact that explains most confusion around this transaction is versioning: a segment definition can be edited freely while unreleased, but once released for use in a live basic type, further changes produce a new version number rather than modifying the existing one, and old IDocs continue to reference whichever version they were built against.
When it is used
WE31 is reached for during custom IDoc development, either building a brand-new basic type from scratch or extending an existing SAP-delivered one with a Z-segment to carry additional fields. It sits early in the build sequence: segments first, basic type assembly second, function module and process code linkage after that. It is not a transaction touched during routine interface operation or monitoring; a consultant chasing a failed IDoc in production goes to WE02/WE05 or the monitoring tools, not WE31. It only comes back into play when a business requirement needs a new field on an existing interface, or when a partner sends a custom segment that must be modeled on the receiving side.
How to use it in practice
- Enter the segment name, using a Z or Y prefix for custom segments, and choose Create, Change or Display.
- For a new segment, enter the short text and add fields one by one, each with a field name and either a data element or a type and length, respecting the fixed field order.
- Save the definition; this triggers generation of the underlying DDIC structure.
- Explicitly generate the segment if the save did not do so automatically, and check the generation log for errors.
- Release the segment through the release function once it is stable; this is mandatory before it can be assembled into a basic type intended for transport or production use.
- Cross-check the generated structure in SE11 and the human-readable layout in WE60.
Key data objects
- Generated DDIC structure - the runtime record layout for the segment, named after the segment itself and visible in SE11; this, not a manually maintained table, is what actually holds field metadata at runtime.
- Segment definition metadata - internal repository entries recording the segment name, its release status and its version number, maintained only through WE31 and not intended for direct table editing.
- Transport object entries - the segment, once released, is captured as a transportable development object, so its history also lives in the transport request log rather than in a business table.
How to prove it in the data
Segment definitions are metadata, not master data, so there is no SE16 table with rows to browse for this. The concrete recipe is: open WE31 in display mode against the segment name and read the release status and current version shown on the initial screen; compare that version against the version referenced inside the basic type via WE30's segment hierarchy for the same basic type; then open SE11 on the generated structure name to confirm the field list and lengths physically match what WE31 shows. Where the segment is used across systems, repeat the WE31 display in the target system and compare release status and version to confirm the transport actually landed.
ECC vs S/4HANA
WE31 is unchanged on S/4HANA; segment definition, generation and release work exactly as in ECC, and there is no Fiori app replacing it because it is a development-time tool rather than an operational one. IDoc technology itself continues to be supported on S/4HANA for both inbound and outbound interfaces, so custom segment work in WE31 remains a normal part of extending ALE-based integrations even where newer scenarios are built on APIs instead.
Common pitfalls and how to diagnose them
- Unreleased segment: WE30 refuses to add the segment to a basic type intended for productive or transported use, or the basic type saves but fails validation later. Check the release status field in WE31 first; this is the most common blocker for a brand-new custom segment.
- Field inserted mid-structure instead of appended: adding a new field in the middle of an already-released segment shifts the byte offset of every field after it, silently breaking any IDoc already parsed against the previous layout and any receiving system that has not regenerated its own copy. New fields on a released segment must always be appended at the end.
- Save without generate: the definition looks correct in WE31 but the DDIC structure in SE11 still shows the old field list, because generation did not run or failed silently. Always check the generation log after saving a structural change.
- Version mismatch across systems: the segment was released and transported in development but the transport did not include the release step, or landed out of sequence relative to the basic type transport, so the target system has a basic type pointing at a segment version it does not recognize. Compare WE31 version numbers side by side across systems before assuming a mapping or ALE configuration problem.
- Naming and length errors at generation time: exceeding the allowed segment name length or field length limits produces a generation error that is easy to miss if the log is not read line by line.
Whose problem this is
This is development work, not functional configuration, and normally sits with an ABAP or integration developer rather than a functional consultant, though the functional consultant usually defines what fields are needed and where. Basis owns the transport path once the segment is released. A clean handover states the exact segment name, the full field list with types and lengths, the target basic type and segment version, and confirmation that release and generation both completed without errors.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-tcodes/we31ERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.