Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Issue Statement: If there are duplicate records(identified by key field) in a message, send only one record to target system.

Input & Output Message Structure:

MT_Vendor

     row

          SupplierNumber

          Field1

          Field2

          ....

          ....

Logic: Create 'row' node only once for duplicate records. Suppress the other duplicate records.

Solution: Create a simple UDF, to suppress the subsequent duplicate records. I got the UDF code from SDN, when I was implementing the logic for a project :smile:

Message mapping:

UDF Code:

for (int i = 0; i < input.length; i++) {

    int found = 0;

    for (int j = 0; j < i; j++) {

       if (input[i].equals(input[j]))

{

          found = 1;

          break;

      }

    }

    if (found > 0) result.addSuppress();

    else result.addValue(input[i]);

}

2 Comments
Labels in this area