2006 Jan 02 7:49 AM
I HAVE A COLUMN LIKE THIS:
111111
111111
222222
222222
333333
333333
I WANT TO GET THIS ONLY 1 TIME?
THANKS.
2006 Jan 02 7:56 AM
after select if you want to do then...
delete adjacent duplicates by comparing field.
if you want to filter in select level
then use select distinct field
from mara
into itab.
thanks
vijay
I HAVE A COLUMN LIKE THIS:
111111
111111
222222
222222
333333
333333
I WANT TO GET THIS ONLY 1 TIME?
THANKS.
2006 Jan 02 7:52 AM
Dear Liat,
You have not been very much clear.
What I gathered is that you are retreiving values from table with a column having those values. You can achieve with DISTINCT function of OpenSQL.
Eg: SELECT DISTINCT( field )
FROM table.
regards,
Deva.
2006 Jan 02 7:53 AM
2006 Jan 02 7:56 AM
after select if you want to do then...
delete adjacent duplicates by comparing field.
if you want to filter in select level
then use select distinct field
from mara
into itab.
thanks
vijay
2006 Jan 02 7:58 AM
2006 Jan 02 8:00 AM
Hi Liat,
1. DELETE ADJACENT DUPLICATES.
(see F1 help on this command )
2. try this code (just copy paste)
REPORT abc.
DATA : BEGIN OF itab OCCURS 0,
f(10) TYPE c,
END OF itab.
itab-f = '11111111'.
APPEND itab.
itab-f = '11111111'.
APPEND itab.
itab-f = '11111111'.
APPEND itab.
itab-f = '2222222'.
APPEND itab.
itab-f = '2222222'.
APPEND itab.
itab-f = '2222222'.
APPEND itab.
itab-f = '33333333'.
APPEND itab.
itab-f = '33333333'.
APPEND itab.
itab-f = '33333333'.
APPEND itab.
itab-f = '33333333'.
APPEND itab.
write 😕 '------ Before Delete Adjacent'.
LOOP AT itab.
WRITE 😕 itab-f.
ENDLOOP.
*----
sort itab by f. "------ IMPORTANT
delete adjacent duplicates from itab.
write 😕 '------ AFTER Delete Adjacent'.
LOOP AT itab.
WRITE 😕 itab-f.
ENDLOOP.
I hope it helps.
regards,
amit m.
Message was edited by: Amit Mittal
Message was edited by: Amit Mittal
2006 Jan 02 8:00 AM
then you can use
sort itab by field1.
DELETE ADJACENT DUPLICATES FROM ITab COMPARING field1.
try this..
vijay
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |