SAP ECC IDoc Extension and Custom Segment Checklist
This checklist covers adding a custom segment to a standard IDoc in SAP ECC 6.0: designing the segment, building it in WE31, WE30 and WE82, filling or reading it in a user exit, setting up partner profiles and testing. It is written for ABAP developers and integration consultants extending ORDERS, MATMAS and similar IDocs.
0 of 27 items complete
6 critical items still open - these are the highest-risk gaps.
Design
Build
Fill and read logic
Partner profile and runtime
Test and transport
Critical items are the usual reasons a new segment never appears: unreleased segment, missing WE82 assignment or extension in WE20, a wrong exit or a syntax error from segment order.
Get your IDoc extension reviewed
Send the WE30 structure and exit code and we will check segment design, exit choice and partner setup.
Optional. The tool and every export work without this. No spam.
How IDoc extensions work
A basic type such as ORDERS05 is SAP's fixed structure. An extension type adds customer segments to it without changing SAP's definition, so upgrades are unaffected. The segment is created in WE31 as a segment type (Z1...) with a versioned definition (Z2...000). WE30 builds the extension: you choose the basic type, add the Z segment under the right parent and set occurrences. WE82 ties message type, basic type, extension and release together. At runtime the control record carries the basic type in IDOCTP and the extension in CIMTYP, which is how the receiver knows to expect the new segment.
- WE31: segment editor
- WE30: basic types and extensions
- WE82: message type assignment
- WE20: partner profiles, WE21: ports
Filling and reading the segment
Standard function modules do not know your segment, so you fill or read it in an exit. For inbound sales orders through IDOC_INPUT_ORDERS, enhancement VEDA0001 offers EXIT_SAPLVEDA_001 to read segment data into the order structures. For outbound purchase orders created through message control, enhancement MM06E001 offers EXIT_SAPLEINM_002 to append segments. For MATMAS sent through ALE, enhancement MGV00001 offers EXIT_SAPLMV01_002. Implement them in a CMOD project, and always confirm the exit and its parameters in SMOD on your release, because interfaces differ between IDoc functions.
Worked example: ZORDERS05EXT
A customer sends a line-level drawing revision. The team creates segment Z1DRAWREV with fields DRAWNO (CHAR 25) and REVLEV (CHAR 2) in WE31 and releases it. In WE30 it creates extension ZORDERS05EXT on ORDERS05 with Z1DRAWREV under E1EDP01, occurrences 0 to 1, and releases it. WE82 assigns ORDERS, ORDERS05, ZORDERS05EXT and the release. The partner adds CIMTYP ZORDERS05EXT to its control record. EXIT_SAPLVEDA_001 reads the segment and fills a custom field on the item. WE19 testing shows status 53 with the revision on the order.
Common mistakes
Forgetting to release the segment, so it cannot be transported or used in production. Adding the extension in WE30 but not in WE82, which produces syntax errors. Leaving the extension field blank in the outbound WE20 parameters. Using non-character field types. Coding in the wrong exit and seeing nothing in the IDoc. Testing only in WE19 without a full end-to-end run through message control or ALE.
Frequently Asked Questions
How do I add a custom segment to an SAP IDoc?
Create and release the segment in WE31, create an extension in WE30 on the basic type with the segment under the right parent, assign message type, basic type and extension in WE82, fill or read the segment in the relevant user exit, set the extension in the WE20 outbound partner profile, and test with WE19.
Which user exit is used for inbound ORDERS IDocs?
Inbound ORDERS uses function module IDOC_INPUT_ORDERS. Its customer exits are in enhancement VEDA0001; EXIT_SAPLVEDA_001 is commonly used to move custom segment data into the order. Check the exits listed in SMOD for VEDA0001 on your release to pick the one called at the point you need.
Why do I get status 26 after adding an extension?
Status 26 is a syntax error in an outbound IDoc. Typical causes are a segment in the wrong position, too many occurrences, an extension not assigned in WE82 or not named in the partner profile, or an unreleased segment. Compare the IDoc in WE02 with the structure in WE30 or WE60.
Should I copy a basic type or create an extension?
Create an extension. Copying a basic type to a Z basic type cuts it off from SAP's later versions and from the standard IDoc functions, while an extension keeps the standard processing and only adds your segments. A new basic type makes sense only for fully custom message types.
If you want your integration team to ask ECC about IDoc volumes, errors and segment contents in plain English on your own servers, we can set that up.
Related Tools
SAP IDoc Partner Profile (WE20) Setup Template
A fill-in setup sheet for WE20 partner profiles, WE21 ports and the inbound and outbound parameters behind each IDoc partner.
SAPSAP IDoc Status Codes Reference
Look up any IDoc status code, see whether it is inbound or outbound, whether it is an error, and which transaction to use to fix it.
Developer ToolsSAP ECC User Exit (CMOD/SMOD) Implementation Checklist
Find the right exit, decide between customer exit, form user exit, BAdI or BTE, then implement, activate, transport and test a CMOD project in SAP ECC.
SAPSAP ECC SM36 Standard Housekeeping Jobs Checklist
Check that every standard SAP ECC housekeeping job is scheduled with the right program and frequency, plus the common interface and application jobs.
More Developer Tools tools
See all- SAP ECC Enhancement Transactions and Exit Tables Reference (SMOD, CMOD, SE18, MODSAP, SXC_EXIT)
- SAP ECC Data Dictionary and Repository Tables Reference (DD02L, DD03L, T100, E070, TSTC)
- SAP ECC ABAP Runtime Errors (ST22 Dumps) and Error Log Transactions Reference
- SAP ECC Background Job History ABAP Query Generator (TBTCO + TBTCP)
- SAP ECC Background Job Creation ABAP Generator (JOB_OPEN, SUBMIT, JOB_CLOSE)
- SAP ECC IDoc Segment Data Reader ABAP Generator (EDIDC, EDID4, EDIDS)
- SAP ECC Custom Inbound IDoc Function Module Skeleton Generator
- SAP ECC BAPI_SALESORDER_CHANGE ABAP Generator
- SAP ECC BAPI_PO_CHANGE ABAP Generator
Keep exploring
Free tools
- SAP ECC Custom Inbound IDoc Function Module Skeleton GeneratorGenerate a ready-to-adapt inbound IDoc function module for a custom message type and segment: standard interface, segment cast, validation, status 51 or 53, workflow return variables and the configuration steps.
- SAP ECC MATMAS05 Material Master IDoc Segments ReferenceThe MATMAS05 segment tree with the material master table each segment carries, so you can build, reduce or debug material master distribution.
- SAP IDoc Partner Profile (WE20) Setup TemplateA fill-in setup sheet for WE20 partner profiles, WE21 ports and the inbound and outbound parameters behind each IDoc partner.
ERP fixes and how-tos
- IDocs for SAP PP: LOIPRO, LOIROU and PORDCR Configuration and MonitoringWhich IDoc message types SAP PP uses for orders and routings, how to configure partner profiles and ALE, and how to monitor and reprocess failures.
- SAP IDoc Status 51: Application Document Not PostedIDoc status 51 means Application document not posted, a category, not a diagnosis. Find the real cause in WE02 or SLG1 and reprocess safely with BD87.
- How to add AI to SAP ECC 6.0 on-prem without moving data to a cloudReference architecture for a private on-prem AI assistant on SAP ECC 6.0: RFC and BAPI reads, SLT replica, retrieval index, local LLM, permission mirroring.
Integrations
- How to use ChatGPT with SAP ECC 6.0Using ChatGPT with SAP ECC 6.0: custom GPT actions, exports versus live access, an OData or MCP bridge, enterprise data controls, and when a private model is safer.
- How to add AI agents to SAP ECC 6.0How to add AI agents to SAP ECC 6.0: a tool layer over BAPIs, RFC and IDocs, human approval before any posting, and an on-prem model that never leaves your network.