PO Line Description Quandary
By Tim Dexter on Jul 01, 2008
Welcome back .... new look, same old (hopefully) useful articles - will talk about the new look another day. We're back with a bang, at least for those of you struggling with the Purchase Order Oracle Report. Dave summed up the problem on the BIP forum last week:
I have the following XML:
<TEXT>Detailed item description</TEXT>
<TEXT>Detailed item description2</TEXT>
<TEXT>Detailed item description3</TEXT>
Output should be the line details including the attachment matched by the ID:
LINE 1, Detailed item description
LINE 2, Detailed item description2
LINE 3, Detailed item description3
Is this possible?
Notice the line attachment section? We have a link back to the LINE_ROW section but no nice structure to loop over!
We have to get into some more serious XSL/XPATH expressions to get the description to appear with the rest of the line information.
With some help from a relatively new member of the BIP dev team, Yaoguang, I managed to come up with a solution.
Where you are looping over the LINES_ROW, just inside the for-each field add a new field:
Every time the loop goes over it assigns the current PO_LINE_ID to a local variable 'PoLnID'
Where ever you want the description to appear on the row create a field that contains
Its a bit of a mouthful but its basically looking for a child element that matches the PoLnID value - then its looking for the first  occurrence of the TEXT value that is a sibling to that ID.
Works real nice!
Of course it would be better to get the PO team to restructure the XML but this will do nicely. Example template here