‎2008 Feb 01 10:42 AM
Hi all,
I am afraid I know the answer, but maybe you have a solution to my problem. I have a SELECT into a hashed table, that should return only one result per key (key-field of the hashed table). But in some rare cases the data in DB is not ok, then I get more than one result with the same key of the hashed table, which of course leads to an exception and therefore a dump.
Now I want to catch this exception as I want to show a nice error message to the user instead of this ugly short dump screen. But when I look into the ABAP help I see that the exception "ITAB_DUPLICATE_KEY" (see help text for INSERT at internal tables chapter) is an uncatchable exception, so there is no exception class for a try-block.
Now to my question: How can I catch or process this uncatchable exception, or any other uncatchable exception? I need to create an error popup in my application, as most of the users have no idea what this means -- and because it's a better way to handle errors in any case
Thanks in advance for any ideas or hints.
Kind regards, Matthias
‎2008 Feb 01 9:41 PM
I know exactly what you're talking about - ran into this a couple of times.
SELECT DISTINCT should resolve the issue. But if you insist on checking for duplicates and howing an error message, then you'd have to do SELECT into a regular or a sorted table, then copy the content into another table. Do DELETE ADJACENT DUPLICATES and compare the number of records. Or something along those lines.
Uncatchable exceptions are, as the name suggests, uncatchable - sorry!
‎2008 Feb 01 9:41 PM
I know exactly what you're talking about - ran into this a couple of times.
SELECT DISTINCT should resolve the issue. But if you insist on checking for duplicates and howing an error message, then you'd have to do SELECT into a regular or a sorted table, then copy the content into another table. Do DELETE ADJACENT DUPLICATES and compare the number of records. Or something along those lines.
Uncatchable exceptions are, as the name suggests, uncatchable - sorry!