on 08-10-2008 5:00 AM
Hi,
How can we remove the duplicate records and process in XI.
Source
<Records>
<Row>
<ID>10001</ID>
<Name>Praveen</Name>
</Row>
<Row>
<ID>11901</ID>
<Name>Raj</Name>
</Row>
<Row>
<ID>10001</ID>
<Name>Praveen</Name>
</Row>
</Records>
Target
<Records>
<Row>
<ID>10001</ID>
<Name>Praveen</Name>
</Row>
<Row>
<ID>11901</ID>
<Name>Raj</Name>
</Row>
</Records>
hi esha,
Target structure map with like below.
ID(change the context to parent node(Records))-Sort-SplitByValue(Select Value Change)-
CollapseContext-Target"Row".
It will restrict the duplicate records contains same ID.
Regards,
Prakasu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
you do that inside the mapping. I would take ABAP or XSL for that reason. May be Java but not grafical. Sort the fields and loop. Remember the value of the actual field and compare with the last. If same throw away. I cant translate the programming technique very well into english, may be it is call "group step handling" or something like that.
Please dont forget to give points.
bye
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
do u want to update or insert the table in DB?
Regards,
Senthilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Senthil,
For the mapping of the Row element, use a user-defined function to filter the non-unique entries.
The source for the UDF:
// imports: java.util.Vector
// Cache: context
// Arguments: ID
// Name: SuppressDuplicates
Vector v = new Vector(ID.length);
for(int i = 0; i < ID.length; i++){
if(v.contains(ID<i>))
result.addValue(ResultList.SUPPRESS);
else{
v.add(ID<i>);
result.addValue(ID<i>);
}
}
Now, in the mapping for the Row element, use ID as an imput for this UDF and set the context for the ID field on 'Records':
ID (Context: Records) --> SuppressDuplicates --> Row
Hope this helps,
Koen
Dear Esha,
Try using Java mapping instead of Graphical Mapping.
or Write a Module Program for Adapter.
see this demo by Stephen how to write a Module Program.
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/efa72219-0e01-0010-75ac-973bdc2fdcb3]
Hope this will help you
Praveen K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I think that the best way to do it is in the sender system.
If this option is not available you need to write UDF.
I asked this question before and have a thread about that.
I cannot succeed to add link but you can search for this "ab;bc;cd;de;4" to find this thread.
Elad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.