| CranCran77 2005-08-25, 2:52 am |
|
I have a record coming from my database which contains data that is
related in the following fashion:
HEADER_ID_1 HEADER_DATA_1 LINE_ID_1 LINE_DATA_1
HEADER_ID_1 HEADER_DATA_1 LINE_ID_2 LINE_DATA_2
HEADER_ID_2 HEADER_DATA_2 LINE_ID_1 LINE_DATA_1
What I need to map is into an IDOC structure which contains the
following output:
<RECORD>
<HEADER>HEADER1</HEADER>
<LINE>LINE1</LINE>
<LINE>LINE2</LINE>
</RECORD>
<RECORD>
<HEADER>HEADER2</HEADER>
<LINE>LINE1</LINE>
</RECORD>
Using a few of the functiods I have been close to success with this
type of output comparing the current interation header id with the
previous to see if they're different; however this approach has the
drawback that when this comparison implies the same header detected,
that line isn't mapped. So I end up with:
<RECORD>
<HEADER>HEADER1</HEADER>
<LINE>LINE1</LINE>
</RECORD>
<RECORD>
<HEADER>HEADER2</HEADER>
<LINE>LINE1</LINE>
</RECORD>
Unfortunately I am on a project deadline and need to find a solution
pretty fast and unfortunately breaking up the data isn't an option.
Thanks
cracran
|