Defining Segments 

This section involves a scenario in which you have to create a new segment. If you have to create a new segment definition, change an existing segment using the segment editor.

Prerequisites

You must have authorization to create development objects and transport requests.

Procedure

  1. Call the segment editor from the Initial Node of the IDoc Interface by selecting Development ® IDoc segments. Select Utilities ® Requests (organizer) to create a request.
  2. Specify a segment type and select .
  3. Specify a description of the segment and enter the field names and data elements: Decide whether your field is to store data which is coded according to the ISO standard (checkbox).
  4. The field lengths (in bytes) and any fixed values are derived from the data elements via the domains (with field lengths as export lengths). The documentation for the data element is also copied and displayed by the documentation tools.

    Do not change the export length. Data is sent to and from the external systems as character fields with this length. However, internally (in the IDoc), the data is stored as a field of the same type as the selected data element (for example as an integer) with the corresponding length. Different lengths can lead to a loss of data (superfluous bytes are cut off).

  5. Choose Goto ® Documentation and describe the segment type. Save the active version of your application documentation and return to the segment editor.
  6. If you use the segment later in an IDoc type and display this type via the documentation tools, the description you have entered here will be displayed.

  7. Save the segment definition by selecting . Enter the segment in a transport request.
  8. You should assign all your development objects (segments, IDoc type, function group, and so on) for IDoc types to the same development class, so that the transport properties are always identical.

  9. Exit the screen (F3).

The segment definition you have created appears with the version number 000 in the segment editor. It is also included in the transport request you created.

Result

You have now created a new segment type with one segment definition. Although not released, you can still test and work with the segment type. You should only release the segment after you have successfully tested the processing.

In the example, you should define two segments - E1HEAD (header) and E1ITEM (item). These two segments already exist in the system. They are only used as examples and should not be used in live systems. For example, the segment E1HEAD starts with the following fields:

Field

Data element

Length

BELNR (document no.)

EDI_BELNR

35

VKORG (sales org.)

VKORG

4

VTWEG (distrib. channel)

VTWEG

2

SPART (division)

SPART

2

...

...

...