Now accepting guest editorial from SAP, Oracle, Workday and ServiceNow practitioners.Pitch a guide
The Sign-Off Table

Lesson 3 of 6

Extension types in WE30

7 min

Listen to this lesson

0:00 / 7:43

A segment on its own goes nowhere. To use it, you append it to an SAP basic type through an extension (older documentation calls it an enhancement or extension type). The basic type plus the extension together form the IDoc type that partners receive. You build extensions in the IDoc type editor, WE30, choosing Extension rather than Basic type.

Building the extension

  1. In WE30, select Extension, enter a name in the customer namespace, for example ZCMCINV1, and choose Create.
  2. Link it to the basic type it extends, INVOIC02, and give it a description such as "Contoso core return data on invoice items".
  3. SAP shows the basic type's segment tree. Select the reference segment, here E1EDP01 (invoice item), and append Z1CMCCORE as its child.
  4. Set the occurrence: minimum 0 (optional, because many invoice items have no core agreement) and maximum 1 per item.
  5. Check the extension for consistency, save it on the same transport as the segment, and release it once tests pass.
The extended IDoc type for Great Lakes: INVOIC02 plus ZCMCINV1, with the custom segment as a child of each item.
The Sign-Off Table · thesignofftable.com/academy/sap-edi-209

Extensions attach to reference segments of the basic type. Because SAP never removes segments from a released basic type, the parent you hang your segment on will still be there in future releases. That is the core of the upward compatibility SAP's documentation describes, and the reason an extension is preferred over copying the basic type into a new custom basic type.

Extension or new basic type?

OptionWhen it fitsMain cost
Extension of an SAP basic typeYou need extra data in an SAP business message (invoice, order, delivery)Exit code to fill or read the segment; SAP processing stays standard
Copy of a basic type as a Z basic typeRarely justified; avoidYou own the whole structure and lose SAP's improvements to the original
New custom basic typeA message with no SAP counterpart, for example a custom object distributed by ALEOwn processing code end to end
Extension versus custom basic type: extend unless the message has nothing to do with an SAP type.
The Sign-Off Table · thesignofftable.com/academy/sap-edi-209

Naming, versions and limits

Keep extension names short and meaningful, with a version digit at the end, because a later change usually means a new extension rather than an edited one once partners rely on it. One extension extends one basic type. If both Great Lakes and another fleet customer need different custom data on invoices, consider whether one shared extension with optional segments can serve both; every additional extension is another IDoc type to document, map and test.

Extensions can only add segments. You cannot change fields of SAP segments, change SAP occurrence rules, or remove segments. If a partner needs a longer field than the SAP segment offers, the extra data goes into a custom segment, not into a modified SAP segment.

  1. Do you need to change an SAP segment's fields?Yes → not possible; add a custom segment instead · No → continue
  2. Does the data belong to an existing SAP segment level?Yes → append under that reference segment · No → append under the header
  3. Can the segment be missing for some items?Yes → minimum occurrence 0 · No → minimum 1, and the exit must always fill it
  4. Will partners rely on it?Yes → release before go-live, version the name · No → keep it unreleased while prototyping in CMD only
Rules for extending a basic type.
The Sign-Off Table · thesignofftable.com/academy/sap-edi-209

Hierarchy in the data records

In the IDoc's data records, every segment carries its hierarchy level and the number of its parent segment. Because Z1CMCCORE is defined as a child of E1EDP01 in the extension, SAP knows that each Z1CMCCORE belongs to the item segment immediately before it. Middleware and partner translators rely on the same hierarchy: Process Orchestration reads Z1CMCCORE as a child node of the E1EDP01 node in the IDoc XML, so the mapping can place the core agreement reference in the correct 810 item loop. If the exit appends the segment after the wrong item, the reference lands on the wrong invoice line, and only a content check catches it.

Inbound extensions

Extensions work the same way for inbound IDocs. If a customer sent a value in its 850 that no ORDERS05 segment carries, the middleware would fill a custom segment in an extension of ORDERS05, the inbound partner profile would name the extension, WE57 would register the inbound function module for it, and an inbound exit would read the segment and move the value into the sales order. The structure work is identical; only the direction of the exit code changes.

Key points
  • Build extensions in WE30 by appending custom segments under reference segments of an SAP basic type.
  • Basic type plus extension is the IDoc type partners receive; extensions only add segments.
  • Set occurrences deliberately: optional data gets minimum 0.
  • Prefer extensions to copied basic types; release before partners rely on them.

Check your understanding · not graded

Lesson check

  1. 1. Which transaction builds an extension of INVOIC02?

  2. 2. What can an extension NOT do?

  3. 3. Why is an extension preferred to copying INVOIC02 into a Z basic type?