cancel
Showing results for 
Search instead for 
Did you mean: 

Number of Item segments determine number of occurences in 1:N multi mapping

0 Kudos
65

I'm trying to split MATMAS05 to multiple occurences of MATMAS05 1:N. The target MATMAS05 I have duplicated it a few times depending on the number of plants.

If E1MARCM-WERKS = 1234 then assign MATMAS05 -> MATMAS05

/ns0:Messages/ns0:Message1/MATMAS05=ifWithoutElse([keepss=false]stringEquals(removeContexts(/ns0:Messages/ns0:Message1/MATMAS05/IDOC/E1MARAM/E1MARCM/WERKS=), const([value=1234])), /ns0:Messages/ns0:Message1/MATMAS05=)

The above logic gives me the error:

11:51:28 Start of test

Compilation of MM_Split_MATMAS05 successful Cannot produce target element /ns0:Messages/ns0:Message1/MATMAS05[2]/IDOC. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd Cannot produce target element /ns0:Messages/ns0:Message1/MATMAS05[2]/IDOC. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd

11:51:44 End of test

Could someone kindly advice what is the mistake here?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

/ns0:Messages/ns0:Message1/MATMAS05=ifWithoutElse(keepss=falsestringEquals(removeContexts(/ns0:Messages/ns0:Message1/MATMAS05/IDOC/E1MARAM/E1MARCM/WERKS=), const(value=1234)), /ns0:Messages/ns0:Message1/MATMAS05=)

if the condition is true you are mapping to target MATMAS05 and if the condition fails target field will not be generated that is why you get that error

so change the occurence 0--unbounded export xsd to desktop then chnge occurence and again import it

Answers (2)

Answers (2)

0 Kudos

Thank you Abhishek and Kubra for your responses.

The problem is that this is my first mapping before its passed to another xsl mapping and the xsl mapping (which I cannot edit for ownership reasons) requires a single MATMAS05 message and cannot receive multiple IDOC segments within that.

So I have to split from one MATMAS05 message to produce mulitple MATMAS05 messages and cannot split one MATMAS05 to have n IDOCs within the same target MATMAS05. This is because of my subsequent mapping requirement.

I'm not sure if I've explained it clearly

former_member200962
Active Contributor
0 Kudos

The only thing that i wanted to convey was that you cannot right-click target element (which is 1..1) and say Duplicate Subtree (referring to the way you have used to duplicate).....this will cause error when executing......unlesss and until you change the occurence you cannot proceed.....be it you change the occurence by changing the XSD or be it through the signature tab of MM & IM.....

Regards,

Abhishek.

0 Kudos

Hi Abhishek,

The target message in the MM under the tab Messages I have changed the occurence from 1 to 0..unbounded and after that I right clicked and duplicated the subtree for MATMAS05. So now in the MM window it shows as below:


Messages            1:1
  Message1          1:1
       MATMAS05      0..unbounded
       MATMAS05      0..unbounded
       MATMAS05      0..unbounded

and my mapping condition is as follows:


/ns0:Messages/ns0:Message1/MATMAS05=ifWithoutElse([keepss=false]stringEquals(removeContexts(/ns0:Messages/ns0:Message1/MATMAS05/IDOC/E1MARAM/E1MARCM/WERKS=), const([value=4510])), /ns0:Messages/ns0:Message1/MATMAS05=)

Regards,

// Saj

former_member200962
Active Contributor
0 Kudos

have you changed the occurence of your target structure??...your IDOC will have 1..1 occurence which you need to change to 1..unbounded to get it working for your 1:N case......

import the IDOC in your local system....open with notepad/Texpad.....change the occurence....save and again import....and now use this IDOC....there is a blog by Michal on the same....check if that helps you in any way...

Edited by: abhishek salvi on Jul 3, 2009 3:28 PM