Entering content frameBackground documentation Frequently Occurring Elements Locate the document in its SAP Library structure

Even if a source field in accordance with an XML schema definition is not limited in how often it can occur, it only actually occurs in the XML document for which the message mapping was executed. The target field attributes minOccurs and maxOccurs then determine how often it occurs in the target structure. For the purpose of the statements below, sourceElem is a source structure tag and targetElem is a target structure tag that is assigned to this field in the mapping editor (without using functions):

Generating Functions

The standard functions of the Constants functions category do not have an input value. Therefore, they generate a value for a target field instead of taking it from a source field. However, what happens if the target field can occur more than once? Should the minimum number of possible fields then be generated, or the maximum?

In the example instance below maxOccurs is set to 40 for the <count> target field and minOccurs is set to 1:

<Material>
 <nr>345200</nr>
 <count>4</count>
</Material>

<Material>
 <nr>98673</nr>
 <count>6</count>
</Material>
[...]

The source structure gets multiple elements of type <Material>, which is a subnode of the element <count>. Let us assume you to reverse each occurrence of the counter <count> in this target structure by using a mapping. To do so, you would intuitively assign the constant 0 to the <count> field. However, if the value is only generated once, because minOccurs is set to 1, what should then happen with the other fields? The best solution is to leave them empty. If you connect the Constant function to the <count> target field, the message mapping assigns the specified constant to all 40 fields.

To conclude, note the following:

 

 

 

 

 

Leaving content frame