Hi everyone,
I am playing around with hierarchy views and I came across the following problem:
My source data for the hierarchy view degenerates and may contain cycles, which cause any query on the hierarchy view to result in a runtime error. I am trying to catch the error with an exit handler for SQLException, with no success. Exit handlers for the specific error code result in an activation error.
Here is the body of my stored procedure:
BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION SELECT ::SQL_ERROR_CODE, ::SQL_ERROR_MESSAGE FROM DUMMY;
SELECT * FROM "IBP_RM.DATA::PEGARC_CALC.HIER"; -- invalid hierarchy view
END;
And the result I get from calling the procedure from the console:
Could not execute 'call "_SYS_BIC"."IBP_RM/PEG_CONE_TEST"' in 197 ms 739 µs .
SAP DBTech JDBC: [2048]: column store error: [2048] "_SYS_BIC"."IBP_RM/PEG_CONE_TEST": line 5 col 1 (at pos 294): [2048] (range 3): column store error: search table error: [6994] Invalid cycles detected. A SUCC node has itself as an ancestor.B3 C1
Does anyone have an idea why this error is not caught by the exit handler and how I may be able to catch it?
PS: I have used the same code in an AMDP and tried to catch the error in ABAP, but it can't be caught there either
Thanks,
Florian