on 03-26-2008 2:46 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Thank you! That works.
Bernd
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.