cancel
Showing results for 
Search instead for 
Did you mean: 

UDF

Former Member
0 Kudos

Hi,

Need a UDF to eliminate duplicate records in MM.Can accomplish by using standard function but i need an UDF.

Regards,

Anitha.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Anitha,

Splitbyvalue ( for change in value) plus collapse contexts will work.

regards,

Ramya Shenoy

Former Member
0 Kudos

Hi Anitha,

In that above UDF is working fine which is given by Jyothi. But need to one small change is before that process, sort the array values. Then only remove all duplicate values.

 java.util.*; 


// Sort the Array values
* Arrays.sort(a); *
 String temp = a[0];
result.addValue(a[0]);
 for(int i=0;i<a.length;i++)
{
   if(!(a<i>.equals(temp)))
   {
        result.addValue(a<i>);
   }
   temp=a<i>;
}

Regards

Vijaykumar

jyothi_anagani
Active Contributor
0 Kudos

Hi Anitha,

Is there any special reason for UDF...It can acieved by using Standrad Function...If you use UDF it will be a performance issue...Instead of that you can do like this...

input(Manual Context change to Message Type)---->sort---->SplitByvale[Valu Change]--->CollapseContext--->output

This will surely work...If you want UDF only...Then I wil provide you..

Thanks.

Former Member
0 Kudos

I need an UDF.

Regards,

anitha m.

jyothi_anagani
Active Contributor
0 Kudos

Hi,

Use this..

input(Manually Change the Context)---->sort---->UDF--->output

Use this code for UDF...

While writing the UDF select the Queue...

String temp = a[0];
result.addValue(a[0]);
 for(int i=0;i<a.length;i++)
{
   if(!(a<i>.equals(temp)))
   {
        result.addValue(a<i>);
   }
   temp=a<i>;
}

I have tested this...Working fine...

Thanks.

Former Member
0 Kudos

Hi ,

You can ask your ABAP team to remove the duplicate records in the MM ( Material Master)and then you can process right ?

If its in ur MM (Message Mapping ) , you can solve using the standard function

Regards,

Jude

Edited by: jude bright on Aug 21, 2009 8:38 AM