Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

duplicate entries

Former Member
0 Likes
729

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

4 REPLIES 4
Read only

Former Member
0 Likes
609

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

Read only

Former Member
0 Likes
609

Hi,

After fetching the data,use DELETE ADJACENT DUPLICATES

statement.

Regards,

Ravindra

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
609

Just check..the second query will append the records after the first fetch...

Split ur query and process it...

Read only

Former Member
0 Likes
609

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.