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

Runtime Error :ITAB_DUPLICATE_KEY Select on BSIS and BSAS Table

Former Member
0 Likes
557

Hi Experts,

We sometimes get runtime error itab duplicate key in production system on the following select:

select data from BSIS into ITAB where burks on selection screen

                                                        gjahr   on selection screen

select data from BSAS appending ITAB where burks on selection screen

                                                                    gjahr   on selection screen


ITAB is sorted table with unqiue key bukrs gjahr belnr buzei.

I belive the dump occurs because it finds duplicate record in BSAS for the same key (bukrs gjahr belnr buzei) and i can change my internal table to

non-unique key and it should resolve the error.

But when i check my dev system i dont see any records on BSAS for the key (bukrs gjahr belnr buzei) which are in BSIS.

Can someone please advice if this can happen in any scenario?

Thanks

Hi Experts,

We sometimes get runtime error itab duplicate key in production system on the following select:

select data from BSIS into ITAB where burks on selection screen

                                                        gjahr   on selection screen

select data from BSAS appending ITAB where burks on selection screen

                                                                    gjahr   on selection screen


ITAB is sorted table with unqiue key bukrs gjahr belnr buzei.

I belive the dump occurs because it finds duplicate record in BSAS for the same key (bukrs gjahr belnr buzei) and i can change my internal table to

non-unique key and it should resolve the error.

But when i check my dev system i dont see any records on BSAS for the key (bukrs gjahr belnr buzei) which are in BSIS.

Can someone please advice if this can happen in any scenario?

Thanks

2 REPLIES 2
Read only

Former Member
0 Likes
510

Hi Bhanu,

Just a thought - production system always contains real-time data hence maybe you need to analyze how the data is stored in BSIS and BSAS and replicate the same in DEV system and see what happens!

We generally do that. If we get a dump in Prod, we replicate it in Dev and correct the dump. Prod always has or is understood to have correct and real-time data unlike DEV which can have dummy data too.

Try this and let us know if this helps!

Read only

Former Member
0 Likes
510

hi,

have you checked exactly whether there is a duplicate key???

here's a routine:

itab2 = itab.

loop at itab2 into wa2.

  clear z.

  loop at itab into wa where bukrs = itab-bukrs..."(all key-fields! in where clause)

  ...

    add 1 to z.

  endloop.

*check duplicate key  when counter greater 1

if z > 1.

write: wa-bukrs, wa-belnr....

hope that helps

greetings

Andreas