Plural attributes
'Plural attributes' are attributes, that may be assigned multiple times to the same data object. Typically, the individual instances will contain varying details (or 'values'). However, this is not a requirement for the elements of a plural attribute.
While predefined 'plural attributes' of business objects are 'plural by definition', individual types of 'typed attributes' may be configured as 'plural'. In both cases, attribute values assigned to a data object appear as individual elements in the list of <attributes> together with all other (singular) attributes. In contrast to the latter, the elements of plural attributes feature an integer index property (index), incrementally ascending from '0'.
There are dedicated resolvers for handling 'plural content' (see Attribut (Wertauflöser)), particularly the Plural attributes (Resolver) and the Plural typed attribute resolver.
►NOTE◄ Index values of plural attributes can be overwritten, e.g. by assignments in Event handling, to manipulate the sequence of elements. For this purpose, arbitrary integer values may be assigned to the index property. When object data is loaded into a form containing the plural attribute (possibly invisible and inactive), elements are sorted according to the assigned index values and renumbered automatically to show indices ascending from 0. If required, this 're-indexing' step may be anticipated by explicitly running a Für jeden Eintrag wiederholen (Schleife) to set the index of all elements to the value of the loop counter (variable $index). This ensures that the systematic index is immediately available for succeeding actions.
The following example shows an excerpt from an XML structure of a shipment containing one singular text attribute ('DESTINATION_COUNTRY') and a plural text attribute ('CONTAINER_NO') with three elements. Aside from the index property, the structure of each element of the plural text attribute resembles that of a singular text attribute.
<
shp
:Shipment [...]>
[...]
<
attributes
>
[...]
<
shp
:ShipmentText
id
=
"1901"
[...]>
<
value
textType
=
"DESTINATION_COUNTRY"
>
<
textValue
>AUS (AUSTRALIA)</
textValue
>
</
value
>
</
shp
:ShipmentText>
<
shp
:ShipmentText
id
=
"1824"
[...]>
<
value
textType
=
"CONTAINER_NO"
index
=
"0"
>
<
textValue
>JFGU2018119</
textValue
>
</
value
>
</
shp
:ShipmentText>
<
shp
:ShipmentText
id
=
"1827"
[...]>
<
value
textType
=
"CONTAINER_NO"
index
=
"1"
>
<
textValue
>SCMJ1248422</
textValue
>
</
value
>
</
shp
:ShipmentText>
<
shp
:ShipmentText
id
=
"1826"
[...]>
<
value
textType
=
"CONTAINER_NO"
index
=
"2"
>
<
textValue
>JFGU2018042</
textValue
>
</
value
>
</
shp
:ShipmentText>
[...]
</
attributes
>
<
lineItems
/>
</
shp
:Shipment>