An IDoc definition file has information about the structure of the IDoc, the IDoc segment hierarchy, and the fields that make up the segments. SAPODA uses the IDoc as input to generate the data record business object and its child business objects. The number of children depends on the IDoc segment definition of the basic IDoc type from the SAP application.
The top level of the data record business object corresponds to the basic IDoc type. This top-level business object contains an attribute that represents a child business object or an array of child business objects (one for each IDoc segment). The structure and hierarchy of the child business objects match that of the IDoc segments in the basic IDoc type.
Generating an IDoc from the system using SAPODA creates the data record object and its child business objects by making calls into the SAP system itself. Fields from an IDoc definition file are used in this section to help illustrate how different properties of a business object are set. Generating an IDoc from the system uses corresponding fields from the calls made into the SAP system.
This section describes:
Table 26 describes the properties of each simple attribute in the data record business object. SAPODA generates the properties described below.
Table 26. Simple attributes: data record business object
Property name | Description |
---|---|
Name | The value of the Name property is the modified value of the NAME or TEXT field in the IDoc definition. SAPODA replaces special characters (such as periods, slashes, and spaces) with underscores so that the name contains only alphanumeric characters and the underscore character (_), as described in Business object naming conventions. |
Type | Specifies the type of data. SAPODA sets the value to String. |
MaxLength | SAPODA derives the value of MaxLength from the LENGTH field in the IDoc definition. |
IsKey | SAPODA sets this property to true on the first attribute in each business object. For every other attribute, SAPODA sets the value to false. |
IsForeignKey | SAPODA sets the value to false. |
IsRequired | Specifies whether an attribute must contain a value. SAPODA sets the value to false. |
AppSpecificInfo | SAPODA sets the value of the AppSpecificInfo property to the value of the Name field in the IDoc definition prepended by the offset value and the + character; for example, for a segment field named SIGN with an offset of 40, it sets the following value for AppSpecificInfo: 40+SIGNFor more information, see Application-specific information: Data record business object. |
DefaultValue | Specifies the value to assign to this attribute if there is no run-time value. SAPODA does not set a value for this property. |
Table 27 describes the properties of each attribute in the data record business object that represents a child or array of child business objects. SAPODA generates the properties described below.
Table 27. Attributes that represent child business objects
Property name | Description |
---|---|
Name | SAPODA sets the value to BOprefix_BasicIDocTypeIdocSegmentName; for example, SAP_E2ALER1001 |
Type | SAPODA sets the value to: BOprefix_BasicIDocTypeIdocSegmentName |
ContainedObjectVersion | SAPODA sets the value to 1.0.0. |
Relationship | SAPODA sets the value to containment. |
IsKey | SAPODA sets the value to false. |
IsForeignKey | SAPODA sets the value to false. |
IsRequired | The IsRequired property specifies whether a child business object must exist. SAPODA sets the value to false if the value of the STATUS field for the corresponding segment in the IDoc definition has a value of OPTIONAL. SAPODA sets this property to true if the STATUS field in the IDoc definition has a value of MANDATORY. |
AppSpecificInfo | The AppSpecificInfo property contains information on the hierarchy level and minimum and maximum number of allowed occurrences of a segment. For more information, see Application-specific information in attributes that represent children. |
Cardinality | If the value of the LOOPMAX field in the IDoc definition is 1, SAPODA sets the value to 1. If the value of LOOPMAX is greater than 1, SAPODA sets the value to n. |
This section describes how connector uses the value of the AppSpecificInfo property:
The connector uses the value of the AppSpecificInfo property at the business-object level of the data record and each of its children to obtain the name of the associated Idoc and its segments:
IDocType_CWDATA
For example, given an IDoc named ALERQ01, SAPODA creates the value of the AppSpecificInfo property as ALERQ01_CWDATA.
The connector uses the value of the AppSpecificInfo property of simple attributes to obtain the field name in SAP and its position (offset) in the data string.
The offset value is the position of the first character of the attribute value in the data string. The offset value is calculated by subtracting the value in the BYTE_FIRST value of the first field in the IDoc definition from the BYTE_FIRST value of the given attribute. This value is used with the MaxLength property to build the data string for the IDoc segment.
The syntax of the AppSpecificInfo property of simple attributes is:
OffsetNumber+IDocFieldName
For example, a segment field named SIGN with an offset of 40 has the following value for AppSpecificInfo:
40+SIGN
The connector uses the value of the AppSpecificInfo property of attributes that represent a child or array of child business objects to obtain information on the hierarchy level and minimum and maximum number of allowed occurrences of a segment. SAPODA sets the AppSpecificInfo property for these attributes by obtaining information from the LEVEL, LOOPMIN and LOOPMAX fields in the IDoc definition.
Figure 21 illustrates the relationship between the WebSphere data record business object and the IDoc definition from an SAP application.
Figure 21.
Relationship Between data record business object and IDoc
Definition fields