09-17-2008 5:40 PM
Hi Experts,
I had declared an internal table for the year.
and base don the Usre input it is fetching the all the years in to table IT_YEAR. IF the usre enters from 2007 to 2010. I am getting nearly 212 records.
when I do the delet adjacent dupilcates it is removing 200 records and it is keeping some dupilcates in the internal table.
TYPES : BEGIN OF ty_year,
BDATJ TYPE BDATJ,
END OF ty_year.
DATA : wa_year TYPE ty_year,
it_year TYPE STANDARD TABLE OF ty_year.
SELECT bdatj FROM t009b INTO TABLE it_year WHERE bdatj IN s_gjahr.
DELETE ADJACENT DUPLICATES FROM it_year comparing bdatj.
can you look into this code.
09-17-2008 5:42 PM
sort it_year by bdatj.
DELETE ADJACENT DUPLICATES FROM it_year comparing bdatj.
do you have only one field in that it_year table. anyway sort the table before using Delete adjacent duplicates.
09-17-2008 5:42 PM
09-17-2008 8:19 PM
09-17-2008 8:31 PM
Hi, before you should sort the internal table
SORT it_year BY bdatj.
DELETE ADJACENT DUPLICATES FROM it_year.
Or you also can do this:
SELECT DISTINCT( bdatj )
FROM t009b
INTO TABLE it_year
WHERE bdatj IN s_gjahr.
Code 1 have more performance than the code 2 if your table t009b don't have a lot of registers.
Thanks and Regards.
David Carballido