Skip to Content
avatar image
Former Member


Hi ,

Currently im using ECC 6.0 EHP 8.0 version.

i need to delete duplicate records in database table S111. For deletion im using the statement.

Loop at...

DELETE S111 FROM gw_table.


But the system is throwing run time error. that is the system is not allowing to delete multiple duplicate records using the work area.

the below logic works for deleting multiple records. but taking too much time and performance is too poor. any idea to resolve this issue.

loop at ..

DELETE S111 FROM TABLE gi_table.


q.jpg (49.9 kB)
11.jpg (76.5 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 26, 2017 at 01:59 PM

    How was this data inserted in database, bypassing Primary Key constraint, primary index inactive?

    The OPEN SQL delete will use primary key values to identify records to delete, here with same keys you get only one record and database raise an error.

    Did you

    • Look for OSS notes
    • Consider full clear the database table (SE14, delete data), reactivation of index and regeneration of data with reports like RMEBEIN3 or RMCENEUA.
    • raise an OSS message, if problem was generated by standard solution

    Else could you try to (as a last tricky solution)

    • Compress the internal table (sort or sorted type, delete adjacent duplicates or similar statement like a COLLECT into another table)
    • Try a DELETE WHERE clause (in a loop)
    • database commit
    • reactivation of index
    • insert back records from the internal table (without duplicate now)
    Add comment
    10|10000 characters needed characters exceeded