cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping multiplicity

Former Member
0 Kudos

Gurus salutem,

I think I have a seemingly simple question.

I would like to map a structure with mutiplicity 1 to a structure with multiplicity 3.

The non-repetitive structure looks like as follows:

<xsd:complexType name="inParameters">

<xsd:sequence>

<xsd:element maxOccurs="1" minOccurs="0" name="key1" type="xsd:string"/>

<xsd:element maxOccurs="1" minOccurs="0" name="key1Value" type="xsd:string"/>

<xsd:element maxOccurs="1" minOccurs="0" name="key2" type="xsd:string"/>

<xsd:element maxOccurs="1" minOccurs="0" name="key2Value" type="xsd:string"/>

<xsd:element maxOccurs="1" minOccurs="0" name="ownerID" type="xsd:string"/>

</xsd:sequence>

The repetitive segment looks like follows:

<xsd:complexType name="QueryFilter">

<xsd:sequence>

<xsd:element maxOccurs="1" minOccurs="0" name="operation" type="xsd:string"/>

<xsd:element maxOccurs="1" minOccurs="0" name="action" type="xsd:string"/>

<xsd:element maxOccurs="1" minOccurs="0" name="attribute" type="xsd:string"/>

<xsd:element maxOccurs="1" minOccurs="0" name="value" type="xsd:anySimpleType"/>

<xsd:element maxOccurs="1" minOccurs="0" name="valueLow" type="xsd:anySimpleType"/>

<xsd:element maxOccurs="1" minOccurs="0" name="valueHigh" type="xsd:anySimpleType"/>

<xsd:element maxOccurs="1" minOccurs="0" name="condition" type="cafpref3:condition"/>

</xsd:sequence>

The result of the mapping should be:

QueryFilter(1).attribute := inParameters.key1

QueryFilter(1).value := inParameters.key1Value

QueryFilter(1).condition := u201CEQu201D

QueryFilter(2).attribute := inParameters.key2

QueryFilter(2).value := inParameters.key2Value

QueryFilter(2).condition := u201CEQu201D

QueryFilter(3).attribute := u201CownerIDu201D

QueryFilter(3).value := inParameters.ownerID

QueryFilter(4).condition := u201CEQu201D

In short the three repetitive segments contain the values from the non-repetitive segment.

Probably more than one guru has encountered this issue.

Thanks for your replies,

Martijn.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member185086
Active Contributor
0 Kudos

Hi,

Have a look on below threads.

[How to deal with 0...n or 1...n mappings? |;

[implement lists/multiple entries of one type within process context? |;

Best Regards

Satish Kumar

Former Member
0 Kudos

Hi Satish,

That is not the solution.

SAP provided me with a solution (many thanks Martin!!), that seems rather simple.

1. create a new mapping function in this case named createFilter, that returns queryFilter (multiplicity exactly 1), with inbound parameters attribute, value and condition.

2. map attribute, value and condition to the queryFilter elements in the mapping expression of the mapping function

3. when mapping the inType to QueryFilter (1..*) in the mapping object use the mapping function to define the following mapping expression:

(createFilter("abc",DO_inType/key1Value,"EQ"),

createFilter("def",DO_inType/key2Value,"EQ"),

createFilter("ghi", DO_inType/ownerId, "EQ"))

Use the standard assignment "Set".

That's it!

Best regards,

Martijn.

Edited by: Martijn on Jan 4, 2012 3:15 PM