2006 Sep 30 6:11 AM
How to obtain distinct values in internal tables like the
"SELECT DISTINCT" in Database tables?
2006 Sep 30 6:47 AM
Hi Pooja,
Two ways to do this :
1. You can sort the internal table by the fields you want and then delete the adjacent duplicates comparing those fields by which you sorted.
sort <internal table> by field1> <field2>.
Delete adjacent duplicate values from itab comparing <field1> <field2>.
2. If you need to consider all fields of the internal table,
sort itab
Delete adjacent duplicate values from itab comparing all fields.
BR,
Preema
*Reward points for helpful answers
Hi Pooja,
Two ways to do this :
1. You can sort the internal table by the fields you want and then delete the adjacent duplicates comparing those fields by which you sorted.
sort <internal table> by field1> <field2>.
Delete adjacent duplicate values from itab comparing <field1> <field2>.
2. If you need to consider all fields of the internal table,
sort itab
Delete adjacent duplicate values from itab comparing all fields.
BR,
Preema
*Reward points for helpful answers
2006 Sep 30 6:14 AM
HI,
you can use DELETE ADJACENT to delete duplicates and the remaining will be distinct values.
SORT itab by field.
DELETE ADJACENT-DUPLICATES FROM ITAB.
Regards,
2006 Sep 30 6:22 AM
HI,
1>sort itab by <field>.
2>delete adjacent duplicates from itab comparing <field>.
2006 Sep 30 6:47 AM
Hi Pooja,
Two ways to do this :
1. You can sort the internal table by the fields you want and then delete the adjacent duplicates comparing those fields by which you sorted.
sort <internal table> by field1> <field2>.
Delete adjacent duplicate values from itab comparing <field1> <field2>.
2. If you need to consider all fields of the internal table,
sort itab
Delete adjacent duplicate values from itab comparing all fields.
BR,
Preema
*Reward points for helpful answers
2006 Sep 30 7:21 AM
Hi all,
Thanks for all your answers. I am getting an error while rewarding points. I will try again later.
Regards,
Pooja
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |