Skip to Content

ABAP dump analysis

Hi Experts,

We have encountered a dump in production where insert statement fails to update a custom database table.The internal table that contains the entries that updates the database table is IT_LABELS. As can be seen in below screenshot, IT_LABELS contains two entries:

Scrolling down*

My question is, are these two entries the contents of table IT_LABELS?

If so, as both entries are identical, is this what's causing the dump. I have checked this entry in the database table, however it still does not exist. Does insert statement fail when the internal table source contains identical entries (same primary keys) even though that entry does not exist in the database yet?

4mh63.png (56.0 kB)
xcbuw.png (56.0 kB)
vam8e.png (97.4 kB)
soj5f.png (97.4 kB)
r9pfu.png (72.9 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jul 28, 2020 at 01:19 PM

    Hello Katherine Darunday

    Yes, these are the entries in the IT_LABELS table.

    Yes, the INSERT will fail if the primary key or a unique index is violated.

    If you try to insert the two entries at the same time, then the INSERT statement will fail regardless if the first record with the same key is already in the DB table or not. Because for the INSERT, the first record is already in the table when trying to insert the second one.

    When the statement fails no database change is committed, hence you cannot see any of the records in the DB table.

    Kind regards,
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 28, 2020 at 01:24 PM

    When you insert data from a not checked area (file, human, ...) you could add the parameters ACCEPTING DUPLICATES to the INSERT statement

    Add a comment
    10|10000 characters needed characters exceeded

    • Katherine Darunday, with "ACCEPTING DUPLICATE KEYS", in your case if the duplicates are only in your internal table, only the first unique records will be inserted, all duplicate entries will be discarded. If the duplicates already exist in the database and your internal table, all duplicates in the internal table will be discarded.

      If you dont use "ACCEPTING DUPLICATE KEYS", you can catch the error with CX_SY_OPEN_SQL_DB, and the insert will be stopped, once a duplicate key is encountered and only the first unique records will be in the database.

      If you neither use "ACCEPTING DUPLICATE KEYS" nor catch the error CX_SY_OPEN_SQL_DB, you will end up with the dump that you have encountered and no records will be inserted at all.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.