cancel
Showing results for 
Search instead for 
Did you mean: 

At SAP PI End Value for element getting duplicated !!!!

former_member184155
Participant
0 Kudos

Hello Experts,

We are currently undergoing Integration Testing for SAP-INFOR WMS , in a particular scenario for Outbound IDOC there are two line item with different Valuation types .PFA screen shot of Outbound IDOC generated at SAP R/3 . Also at SAP PI end XML file of IDOC too show two line items with  different Valuation types. But while looking at Request Message Mapping Node Payload in T-code IDX5 the outbound generated XML to external application is showing two line items with same Valuation type, in this case the the Valuation type of 1st line item is copied to second line item.

I had looked into mapping for this interface the mapping look okay, in this case a for each loop is introduced in XSLT Mapping. in my opinion the vlaues for valuation types are not getting cleared for the second iteration.

Kindly let me know if there is something in Mapping where we can clear value after every iteration.

Best Regards

Priyesh Shah

Accepted Solutions (1)

Accepted Solutions (1)

udo_martens
Active Contributor
0 Kudos

Hi,

the second 'for each' expression is wrong. If you put a loop around like for-each select="//Z1STOLN" then any other select from an inner loop would start exactly there. Therefore that second loop should look like: for-each select="BWTAR"

/Udo

former_member184155
Participant
0 Kudos

Hi Udo Martens,

Thanks for your valuable inputs, i rectified the error on my own after i can across a bug in XSL input file,

While assigning source path to a target XSLT element inside a for-each loop the exact path was given for each element inside the for-each ; where else we have to provide only the name of the field.

for ex before mapping correction.

<Lottable02>

  <xsl:value-of select="/ZSTORE1/IDOC/Z1STOHD/Z1STOLN/BWTAR" />

  </Lottable02>

After Mapping Correction

<Lottable02>

  <xsl:value-of select="BWTAR" />

  </Lottable02>

Best Regards

Priyesh Shah

udo_martens
Active Contributor
0 Kudos

Hi Priyesh,

you have to adapt the mapping corresponding the wished target and X-Path logic. If you have a certain selection in a 'for-each loop' it will have node set as result. In your example your will have all Z1STOLN nodes. If you want to select subnodes from that selection you need a relative path. In your example the just 'BWTAR'. If you put a full path there it the parser will for each node 'Z1STORLN' jump up to the xml root and then down the path and finally select the first element.

I think you got the logic behind, shouldnt be a problem to correct the mapping.

/Udo

former_member184155
Participant
0 Kudos

Thanks Udo

Answers (0)