cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping problem - trying to map lowerlevel field to flat file

Former Member
0 Kudos

Dear experts,

I have a rpoblem mapping my data.

my input-xml looks like this:

. orderheader

...orderdetail (1..n)

.....delivery header (1..n)

.......delivery detail (1..n)

.........invoice header (always max 1 per delivery detail)

...........invoice detail (always max 1 per invoiceheader)

.......delivery detail

etc

I have a flat file as output which looks like this

. RECORD

...ORDERNR

...ORDERPOSITION

...DELIVERYNUMBER

...DELIVERYPOSITION

...INVOICENUMBER

...INVOICEPOSITION

If there are 2 invoicelines in the input xml, the outputfile should contain 2 records with all same data except invoiceposition. For each delivery-detail line a line in the outputfile must be created. So I mapped "deliverydetail" to RECORD. No problems here.

Further I mapped invoicenumber (within the invoice header tag) to INVOICENUMBER.

But when for instance deliverydetail 1 and 2 don't have an invoice, and deliverydetail 3 does, I see this invoicenumber not in record 3 but in record 1. Record 2 and 3 contain no invoicenumber.

What am I doing wrong here?

Thanks in advance,

William

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi William,

One header has multiple items, so here you have to use the oneAsMany node function.

first input for oneasmany node function is Invoice number and 2nd and 3rd input is InvoiceDetail node.

Regards

Ramesh

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Check the context on the InvoiceNumber field, keep it at the level of the node not at higher level.

regards

Mustafa