on 11-20-2008 10:02 PM
Hi
Is there a standard way in PI to sort the incoming XML message within the message mapping before doing the mapping itself?
The scenario would be an incoming Flat file with header and item data records, and we will be mapping it in PI to create IDOC messages based on the same Header segment. So for the same Header Data I would like to create a single IDOC. But the incoming file would be unsorted, so I would need to sort it first based on the header segment some way.
Ideally, we would like to do all of the mapping in the graphical mapping tool and not use a UDF.
Thanks
Edited by: MxG on Nov 20, 2008 5:04 PM
HI
Yes you can sort using standard Node function Sort.
Set the input data to same context and use Sort.
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I already tried Sort, but it doesnt work the way I want.
Say I have inbound XML as
<hdr1>
<hdr2>
<itm1>
<itm2>
<itm3>
it needs to be mapped to an IDOC as
<hdrsegment>
<itmsegment>
I mapped XML header data to IDOC after sorting, and that works fine. The issue comes on assigning the inbound XML Item data to IDOC Item segment. It is creating the correct Number of segments, but when assiging the fields to IDOC fields, it is using unsorted data ie the data as received, not the sorted one which I did for IDOC Node, and for Header fields.
What I really want is to sort the data once, and then use that in the mapping.
Yep, using Java it can be done, but I would like to use that only as the last option.
I changed the context on the field I am sorting. That sorts fine and that target field is fine. The is with the other fields. other fields are being mapped as they came in the Input message ie unsorted.
The Target root node is fine when I see the Queue, but the individual fields are issue.
is there a way in file adaptor or some other way to just sort the input file based on a key field?
Edited by: MxG on Nov 20, 2008 9:54 PM
HI
Even if changing context is not helping then you need to use sort at all nodes to achieve sorting.
Standard adapter will not do sort on key basis. You need to develop modules to do it.
Other method is scripts. Before adapter picks up the file you can execute OS command basically unix script that can help on this.
Thanks
Gaurav
User | Count |
---|---|
95 | |
11 | |
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.