cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Xpath and LastRow

Former Member
0 Likes
426

Hi,

Can someone please tell me what function we need to use to check for the last row in an xml file. I need to do some action only if it reaches the last row.

i tried using

<b>if( XmlLoader_XmlContent{/Row/Row/Column1[last()]} , true, false )</b>

but it does'nt give me the required result.

Thanks in Advance

Regards

Muzammil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Muzammii,

What exactly are your checking for in the last row? Do you want to compare a node value in the last row with another property in your transaction? To best assist you, can you please elaborate what you would like to accomplish?

Thanks,

Michael Teti

Former Member
0 Likes

Hi Michael,

I think i got it . i can make use of <b>currentItem</b> value and <b>itemcount</b> value of repeater.

Actually i need to get the <b>cumulative</b> value from the rows from xml file and need to update the final value(Added value) into SAP R/3. Updating into R/3 should be done only once and that too only after adding all the rows.

But now i think it can be better done with currentItem and Item Count.

Thanks for your instant response.

If any other easier way is there, please let me knw

Regards

Muzammil

Former Member
0 Likes

The fastest and best way is no to use a repeater, but to use the aggregator action.

Simply feed the aggregator action with /Rowsets/Rowset/Row/ColumnName, where ColumnName is the name of the column you wish to add up. Aggregator will provide you a count, total, minimum, maximum, average, and standard deviation.

Also, the XPath for the "last" or "not last" rows would be:

/Rowsets/Rowset/Row[position() = last()]

or

/Rowsets/Rowset/Row[position() != last()]

Best regards,

Rick

Former Member
0 Likes

Thanks a lot Rick

Regards

Muzammil

Answers (0)