cancel
Showing results for 
Search instead for 
Did you mean: 

Abap Import duplicate keys found

Former Member
0 Kudos

Hello,

I´m getting and error during the abap imports of the system copy in the target system.

(CREATE UNIQUE INDEX "CSMCLSMAP~0" ON "CSMCLSMAP" ( "ASC_CLASS", "L_CLASS_1", "L_CLASS_2" ) TABLESPACE PSAPSR3 STORAGE (INITIAL 144384 NEXT 0000000040K MINEXTENTS 0000000001 MAXEXTENTS 2147483645 PCTINCREASE 0 ) NOLOGGING COMPUTE STATISTICS )

DbSlExecute: rc = 99

  (SQL error 1452)

  error message returned by DbSl:

ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found

(CREATE UNIQUE INDEX "THOLT~0" ON "THOLT" ( "FTGID", "SPRAS" ) TABLESPACE PSAPSR3 STORAGE (INITIAL 65536 NEXT 0000000040K MINEXTENTS 0000000001 MAXEXTENTS 2147483645 PCTINCREASE 0 ) NOLOGGING COMPUTE STATISTICS )

DbSlExecute: rc = 99

  (SQL error 1452)

  error message returned by DbSl:

ORA-01452: cannot CREATE UNIQUE INDEX; duplicate keys found

I´m trying with the note 11369 - ORA-1452 during import after export from other system but I make

DESCRIBE sapr3.CSMCLSMAP;

And get this:

SQL> DESCRIBE SAPSR3.CSMCLSMAP;
Nombre                                    ┐Nulo?   Tipo
----------------------------------------- -------- ----------------

ASC_CLASS                                 NOT NULL VARCHAR2(120)
L_CLASS_1                                  NOT NULL VARCHAR2(120)
L_CLASS_2                                  NOT NULL VARCHAR2(120)
REFTYPE1                                   NOT NULL VARCHAR2(12)
REFTYPE2                                  NOT NULL VARCHAR2(12)
REF1                                           NOT NULL VARCHAR2(120)
REF2                                           NOT NULL VARCHAR2(120)
REFTYP1                                     NOT NULL NUMBER(5)
REFTYP2                                     NOT NULL NUMBER(5)
ASC_SCHEME                             NOT NULL VARCHAR2(24)
REFSCHEME                               NOT NULL VARCHAR2(24)
REFSCHEME2                             NOT NULL VARCHAR2(24)

Then the select will be this,no?

select alldata.rowid, alldata.*

  from SAPSR3.CSMCLSMAP alldata,

      (SELECT ASC_CLASS, L_CLASS_1, L_CLASS_2, REFTYPE1, REFTYPE2, REF1, REF2, REFTYP1, REFTYP2, ASC_SCHEME, REFSCHEME, REFSCHEME2

        FROM SAPSR3.CSMCLSMAP

         GROUP BY ASC_CLASS, L_CLASS_1, L_CLASS_2, REFTYPE1, REFTYPE2, REF1, REF2, REFTYP1, REFTYP2, ASC_SCHEME, REFSCHEME, REFSCHEME2

        HAVING COUNT(*) > 1) keydata

  where alldata.ASC_CLASS=keydata.ASC_CLASS

    and alldata.L_CLASS_1=keydata.L_CLASS_1

    and alldata.L_CLASS_2=keydata.L_CLASS_2

    and alldata.REFTYPE1=keydata.REFTYPE1

    and alldata.REFTYPE2=keydata.REFTYPE2

    and alldata.REF1=keydata.REF1

    and alldata.REF2=keydata.REF2

    and alldata.REFTYP1=keydata.REFTYP1

    and alldata.REFTYP2=keydata.REFTYP2

    and alldata.ASC_SCHEME=keydata.ASC_SCHEME

    and alldata.REFSCHEME=keydata.REFSCHEME

    and alldata.REFSCHEME2=keydata.REFSCHEME2;

If it´s correct, with this select I don´t get anyting. No rows selected

In the second error I get this with the DESCRIBE

SQL> DESCRIBE SAPSR3.THOLT;
Nombre                                    ┐Nulo?   Tipo
----------------------------------------- -------- ------------

FTGID                                     NOT NULL VARCHAR2(9)
SPRAS                                     NOT NULL VARCHAR2(3)
LTEXT                                     NOT NULL VARCHAR2(90)
KTEXT                                     NOT NULL VARCHAR2(30)

The select I´ve created

select alldata.rowid, alldata.*

  from SAPSR3.THOLT alldata,

      (SELECT FTGID, SPRAS, LTEXT, KTEXT

        FROM SAPSR3.THOLT

         GROUP BY FTGID, SPRAS, LTEXT, KTEXT

        HAVING COUNT(*) > 1) keydata

  where alldata.FTGID=keydata.FTGID

    and alldata.SPRAS=keydata.SPRAS

    and alldata.LTEXT=keydata.LTEXT

    and alldata.KTEXT=keydata.KTEXT;

And I get 182345 rows selected

Following the note It will apear an example message "Table with duplicate keys is sapr3.dk with 2 key columns c1 and c2" for to delete the duplicate keys."

I don´t get this and I don´t how to follow with the installation.

More thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member182307
Contributor
0 Kudos

Hello,

Here are the selects you should perform based on the indexes fields :

For the clause :

CREATE UNIQUE INDEX "CSMCLSMAP~0" ON "CSMCLSMAP" ( "ASC_CLASS", "L_CLASS_1", "L_CLASS_2" )

Then the select should be :

select alldata.rowid, alldata.*

  from SAPSR3.CSMCLSMAP alldata,

      (SELECT ASC_CLASS, L_CLASS_1, L_CLASS_2

        FROM SAPSR3.CSMCLSMAP

         GROUP BY ASC_CLASS, L_CLASS_1, L_CLASS_2

        HAVING COUNT(*) > 1) keydata

  where alldata.ASC_CLASS=keydata.ASC_CLASS

    and alldata.L_CLASS_1=keydata.L_CLASS_1

    and alldata.L_CLASS_2=keydata.L_CLASS_2;

For the clause :

CREATE UNIQUE INDEX "THOLT~0" ON "THOLT" ( "FTGID", "SPRAS" ) TABLESPACE PSAPSR3

Then the select should be :

select alldata.rowid, alldata.*

  from SAPSR3.THOLT alldata,

      (SELECT FTGID, SPRAS

        FROM SAPSR3.THOLT

         GROUP BY FTGID, SPRAS

        HAVING COUNT(*) > 1) keydata

  where alldata.FTGID=keydata.FTGID

    and alldata.SPRAS=keydata.SPRAS;

They should return rows.

In your case,  the example stated in the note would become :

For THOLT :

Table with duplicate keys is SAPSR3.THOLT with 2 key columns FTGID, and SPRAS.

For CSMCLSMAP  :

Table with duplicate keys is CSMCLSMAP with 3 key column ASC_CLASS, L_CLASS_1 and .L_CLASS_2 .

Just posting in here for the others to have an answer as I already answered in your former thread :

http://scn.sap.com/thread/3190243

Regards,

Steve.

Answers (0)