cancel
Showing results for 
Search instead for 
Did you mean: 

Using Distinct Operator

Former Member
0 Kudos

Hi,

I use the distinct operator: I have an Tab as Output from a service (BAPI), this table has double entries in a point of view. There for I will make it dinstict regarding the field 'ID'. For that I use the distict operator: There I can define the 'ID' as the distinced field. But all the other fields are not maintained in the distinct operator. Then I couple it with a table control for output, but in the table control I have only the field 'ID' to choose. When I only choose the 'ID' as output it works fine. But now I want to have more columns from the original tab.

How can I put more fields out at the table control with the original values from the BAPI (thru the distinct operator)?

Or is there a bug: I use VC 7.1 SP04.

Kind regards, Bernd

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

It seems that you are using the wrong Operator. Try using the Aggregate Operator instead.

Add an Aggregate operator to you model.

Connect it to the BAPI.

Use the "+" button to add all the fields in your data (or all the fields you want to come through the operator).

Set "Group by" operation for your key field (the field on which you want to avoid duplicates).

Set no Operation on the other fields.

Drag a table from the output port of the Aggregate operator.

That should do the trick.

Regards,

Shai

Former Member
0 Kudos

Hi Shai,

this seems to go in the right directing, but I can't choose 'no operation' for the fields I only want to pass by!

I have to choose 'count' or an other operator. Please can you tell me how can I do this?

Kind regrads,

Bernd

Former Member
0 Kudos

Hi Bernd,

It seems I have mislead you. Following is a better solution:

In order to remove duplicates from a table you will need to use the Union Operator:

  • Add a Union Operator to your model.

  • Right click the Union Operator and select "Remove Port" from the context menu so you will have just a single port.

  • Connect the Union Operator to the data service out port.

  • Right click the Union Operator and select "Define Operator"

  • Use the "+" button to add all the fields you want to pass through the operator

  • Check the "Key" property on the field you want to be distinct

  • Drag a table from the Union Operator out port.

[See attached screen shot of model and Define union dialog|http://img329.imageshack.us/img329/6494/unionme4.png]

Regards,

Shai

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank you! That works.

Bernd