on 04-08-2009 6:43 PM
I am reading a source CSV file that has this structure. All rows in the source file are the same structure: line items of a PO. But there will be multiple POs in a single file, identified by the PO number as one column in the file.
PONum,LineItemNum,Qty,Description 001,1,34,Carrots 001,2,17,Apples 001,3,22,Bananas 002,1,4,Mangos 002,2,9,Coconuts 003,1,44,Grapes
Goal is to generate 3 messages, one for each PO:
<po> <num>001</num> <line_items> ... 3 line items for PO # 001 ... </line_items> </po> <po> <num>002</num> <line_items> ... 2 line items for PO # 002 ... </line_items> </po> <po> <num>003</num> <line_items> ... 1 line item for PO # 003 ... </line_items> </po>
Is there any way to use the Content Conversion Key Field Name to group the line items into the correct 3 messages? "Key Field Name" expects a static identifier for each type of row; but mine varies by the PO number in the content.
Or do I need to do this in the mapping? If so, what is the easiest way to split 1 large message of all line items into multiple target messages based on the PO number? (I assume this is better than sending individual line item messages and aggregating them later, as long as the file size is OK.)
Thanks in advance!
RBL
Edited by: Robert Burfoot-Lobo on Apr 8, 2009 11:43 AM
Hi Robert,
If ur goal is to split into 3 messages one for each PO, you can go for message split and using graphical mapping you can achieve that.
Within the message mapping go to the tab Messages.
Change the occurrence of the target message to 0..unbounded.
Also this link may help you.
/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool
Regards,
Madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome find - thanks Madhu & others. Newbie mistake. I was on the wrong path by thinking Content Conversion in the file adapter was the right/easy place to do this, when this blog clearly shows my problem is best solved with a 1:n mapping.
Kiran: it varies. Perhaps there would be a way if was fixed? But that is not the case for me.
Joel: I think my head was between my knees on this one...
hi Robert,
When you have a headache you press your head , not your knees.
I wonder from where you got this idea of doing in content conversion when you have graphical mapping.
Regards
joel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Does the number of PO's remain constant or varies from file to file..
Thanks,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.