on 05-04-2007 2:13 PM
Hi!
I am receiving a flat file with one customer and n-invoice records. The file could look like this:
133133222051241480320842420500089
13317350071000010806372131000 0015890009876543X
13317350071000010806372131000 0015890009876543X
13317350071000010806372131013 0015890009876443X
13317350071000010806372131014 0015890009872343X
where the first line is customer and the rest are invoices.
My question is: How can I get this into a structure like this:
<Customer>
<...>
<Invoice>
<...>
<Invoice>
<...>
When using content conversion (Customer,1,Invoice,*) there has to be specified a key field, which is not a possibility. Do I have to create a UDF for this to get the mapping I want?
Thanks for your answers!
regs Ole Mugaas
Solved by creating each line as its own invoice and have different keyfields for each of them. Then it could be connected to the main invoice.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ole,
Your first node is customer and then invoices records.
Means occurrence of 1st line is one and invoice is unbounded.
In this case you need to define the key field name and it's value in the file adapter.
Without keyfield you cannot conert this structure.
Thanks
Amitanshu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your answers!
As I can see from the Krawcyk blog, he is only using one node and maybe that's why he don't have to use keyField. We have also come to the conclusion that we have to use keyfield, but then we have to give the fields out own values. This is not good enough since the values are predefined. Creating a "placeholder" in each data type would not be a good answer because then our customers have to send an additional field in the file which would cause a lot of work.
Do you know how this can be solved with the keyfield? Is it possible to create a keyField and give it a value that is already there, ex:
Invoice.keyFieldValue = Invoicenumber (where Invoicenumber is a field specified in the DT) ?
regards Ole
hey
are these files tab/space seprated of fixed lengths?
i mean is the length
133133222051241480320842420500089
13317350071000010806372131000 and all are fixed?
if yes,then just use .fieldFixedLengths parameter
thanx
ahmad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
Yes, they are fixed lengths. Still it does not solve the problem as the specification says there have to be a "key field" in the mapping as there can be more than one invoice record. The question is if there is a possibility to create this mapping without using the "key field" as I don't have any fields that have the same value in each record...
-Ole
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.