‎2008 Feb 18 6:25 AM
hi experts,
my select command is fetching duplicate entries..however in the database there are no such entries..tell me wat is the reason for this..m sending u the code of my select commands.
SELECT ABELNR ADMBTR ABUDAT AXBLNR ASGTXT ASHKZG ABLART AHKONT AZUONR BSTBLG A~BLART INTO CORRESPONDING FIELDS OF TABLE IT_BSIS
FROM BKPF AS B INNER JOIN BSIS AS A ON ( ABELNR = BBELNR )
WHERE ABUKRS = BUKRS AND ABUDAT IN POSTDAT
AND ABLART = 'DG' AND AGJAHR = YEAR
AND B~STBLG = ' ' AND ZUONR IN CUST
AND ( A~HKONT BETWEEN '0000235001' AND '0000235050'
OR A~HKONT BETWEEN '0000235101' AND '0000235201' )..
CLEAR IT_BSIS.
SELECT ABELNR ADMBTR ABUDAT AXBLNR ASGTXT ASHKZG ABLART AHKONT AZUONR BSTBLG A~BLART INTO CORRESPONDING FIELDS OF IT_BSIS
FROM BSAS AS A INNER JOIN BKPF AS B ON ( ABELNR = BBELNR )
WHERE ABUKRS = BUKRS AND ABUDAT IN POSTDAT
AND ABLART = 'DG' AND AGJAHR = YEAR
AND B~STBLG = SPACE AND ZUONR IN CUST
AND ( A~HKONT BETWEEN '0000235001' AND '0000235050'
OR A~HKONT BETWEEN '0000235101' AND '0000235201' )..
APPEND IT_BSIS.
CLEAR IT_BSIS.
ENDSELECT..
regards,
raman
‎2008 Feb 18 6:35 AM
Hi
Since you are using the Joins, because of this the system checks the all the tables which are there joins and adds the fields which are having multiple entries to the itab
check the record which is having multiple entries and validate in all the tabels used by joins
delete which are not required
Regards
Shiva
‎2008 Feb 18 6:36 AM
Hi,
After fetching the data,use DELETE ADJACENT DUPLICATES
statement.
Regards,
Ravindra
‎2008 Feb 18 6:38 AM
Just check..the second query will append the records after the first fetch...
Split ur query and process it...
‎2008 Feb 18 6:40 AM
Hi,
after the query..sort the table with belnr then,
sort it_bsis by belnr,
delete adjacent duplicates from it_bsis comparing belnr.
hope it helps,
pls reward if helps,
regards.