cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate records

Former Member
0 Kudos

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>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (5)

Answers (5)

former_member185881
Active Participant
0 Kudos

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

Former Member
0 Kudos

Problem solved...I gave the points...Thanks guys...

-Esha

Former Member
0 Kudos

hi,

do u want to update or insert the table in DB?

Regards,

Senthilkumar

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

Go through the thread below.I guess thre same problem has been discussed there.

Thanks

Former Member
0 Kudos

can anybody help me out!!!!!!!!

-esha

Former Member
0 Kudos

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