Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Non-Catchable exception

Madjid_Khanevadegi
Participant
0 Likes
2,382

Hello

how to handle Non-Catchable exception in abap

like "EXSQL_DSQL_DUPLICATE_CURSOR"

thank you

1 ACCEPTED SOLUTION
Read only

matt
Active Contributor
2,108

Oh yes, I see. I saw the word duplicate, but not the word cursor.

The advice remains - you need to make sure the error doesn't happen, rather than try to catch it. There is clearly a programming error - your trying to open a cursor that's the same as the one you've already got. The documentation says

The specified cursor is already open. An OPEN command command in Native SQL has a specified cursor, which the cursor administration knows is already open.

Rather than Native SQL, use the CL_SQL_... classes. Then you'll get catchable errors.

9 REPLIES 9
Read only

matt
Active Contributor
0 Likes
2,108

Make sure there are no duplicates before executing the code.

Read only

0 Likes
2,108

Hi

yes , i use only one cursor in my code

Read only

matt
Active Contributor
0 Likes
2,108

Duplicate records.

Read only

0 Likes
2,108

my query is not has duplicate record
the Short Text of error is "The specified cursor is already open."

but i do not have specify that the cursor is open or not

thanks

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,108

Whatever the exception is, a "Non-Catchable exception" cannot be "handled". It just stops.

But maybe you can prevent the exception from happening... So you should tell us more about your code!

Read only

Madjid_Khanevadegi
Participant
0 Likes
2,108

Hello Sandra

i now that this error may be occured for example when Fetch Next Cursor into work area ,does not match corresponding field of query with work area

Anyway i wants handle "non-catchable" exception in my abap code .

That is not possible

thanks


Read only

matt
Active Contributor
2,109

Oh yes, I see. I saw the word duplicate, but not the word cursor.

The advice remains - you need to make sure the error doesn't happen, rather than try to catch it. There is clearly a programming error - your trying to open a cursor that's the same as the one you've already got. The documentation says

The specified cursor is already open. An OPEN command command in Native SQL has a specified cursor, which the cursor administration knows is already open.

Rather than Native SQL, use the CL_SQL_... classes. Then you'll get catchable errors.

Read only

0 Likes
2,108

Thank you Matthew Billingham

in Native SQL ,before open my cursor how to define its open , for close it .

if the cursor is not close or program encounter with short dump , the cursor is open in background and Apparently its maintain in sap system cash.

Read only

matt
Active Contributor
0 Likes
2,108

As I said:

Rather than Native SQL, use the CL_SQL_... classes. Then you'll get catchable errors.