SAP Connector > Part VI: Data Integration Using IDocs > IDoc mapplets > Segments and groups
  

Segments and groups

An IDoc is a hierarchical structure that contains segments. A segment can be a parent or child. A child segment depends on another segment. A parent segment contains child segments. A parent segment can be a child of another segment.
IDoc segments are organized into groups. The following rules determine the group to which a segment belongs:

Segment and group status

After you specify the message and doc type in the SAP Metadata utility, you can view the segments and groups in the IDoc.
Segments and groups can be required or optional. In an IDoc mapplet, a required segment must exist in the IDoc only if its group, its parent groups, and its parent segments are required or selected. For example, the E1MARAM group is required. Therefore, its required child segment E1MAKTM must exist in the IDoc while its optional child segment E1MARA1 does not have to exist in the IDoc.
If a required segment belongs to an optional group that is not selected, then the segment does not have to exist in the IDoc. For example, the E1MARCM group is optional. Therefore, the required E1MARCM segment also becomes optional.
When a segment is required, the Segment Status column is selected. When a group is required, the Group Status column is selected.
For example, specify the message type as MATMAS, the IDoc Type as MATMAS04, and click Fetch. You can view the segments and groups in the IDoc.
The following table describes how you can use the Segment Status and Group Status columns to understand which segments are required in the MATMAS04 IDoc:
Segment Name
Segment Group
Segment Status
Group Status
Required in IDoc
E1MARAM
E1MARAM
Required
Required
Required
E1MARA1
E1MARAM
Optional
Optional
Optional
E1MARCM
E1MARCM
Required
Optional
Optional
The following image shows that the E1MARAM segment and the E1MARAM group are required:
View the segment and group status in the MATMAS04 IDoc

IDocs properties

When you fetch an IDoc in the SAP Metadata utility, you can view all the IDoc segments. Select a segment to view the fields in the segment.

IDocs Properties

The following table describes the IDocs properties that you can view and specify in the SAP Metadata utility:
Property
Description
Message Type
Application messages that classify categories of data. For example, ORDERS and MATMAS (Material Master).
IDoc Type
Data structure associated with the message type. For example, MATMAS01, MATMAS02 for MATMAS. IDocs contain the data associated with the message type.
Control Page
Displays the control record. You can add partner profiles to the control record as key value pairs. You can also update and delete any partner profiles associated with the control record.
Select All Segments
Includes all segments in the IDoc mapplet.
Deselect All Segments
Removes all selected segments except required segments from the IDoc mapplet.
Select Transformation
Indicates the type of transformation you want to use to generate the IDoc mapplet. Select one of the following values:
  • - Prepare. Select to generate a mapplet that writes source data as an IDoc message.
  • - Interpreter. Select to generate a mapplet that reads IDoc messages.
  • - Both. Select to generate a mapplet that read IDoc messages and another mapplet to write IDoc messages.
Transformation Scope
Indicates how the Secure Agent applies the transformation logic to incoming data. Select one of the following values:
  • - Transaction
  • - All Input
Choose Transaction to apply the transformation logic to all rows in a transaction. Select Transaction when the results of the transformation depend on all rows in the same transaction, but not on rows in other transactions. When you select Transaction, associated mappings can run in real time.
Choose All Input to apply the transformation logic to all incoming data, and to drop the incoming transaction boundaries. Select All Input when the results of the transformation depend on all rows of data in the source.
Default is All Input.
Segment Name
Segment names of the IDoc type.
Description
Description of the segments.
Select
Selects the data segments to include in the transformation.
When you select a segment, the parent segments and all required child segments are also selected. When you clear a segment, all child segments are also cleared.
Segment Status
When selected, indicates that the segment is required in the IDoc mapplet.
Group Status
When selected, indicates that the group is required in the IDoc mapplet.
Min. Occurs
Minimum number of occurrences of the segment in an IDoc.
Max Occurs
Maximum number of occurrences of the segment in an IDoc.

Segment Fields

Select a segment name to view the field names of the segment.
The following table describes the segment field details:
Field
Description
Name
Field name of a segment.
Description
Description of the field.
SAP Datatype
SAP data type of the field.
Precision
Precision of the field.
Scale
Scale of the field.