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

ABAP runtime errors

Former Member
0 Likes
672

HI,

How can i delete ABAP runtime errors.

Rgds,

Vinnu.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
631

Hi Vinay,

You can't delete the ABAP Runtime errors. But you can catch the errors using catch exception Statement.

For Example,

Class-based exceptions are handled in the following control structure:

TRY.

... " TRY block (application coding)

CATCH cx_... cx_... ...

... " CATCH block (exception handler)

CATCH cx_... cx_... ...

... " CATCH block (exception handler)

...

CLEANUP.

... " CLEANUP block (cleanup context)

ENDTRY.

Try This Sample Code,

*--


EXAMPLE FOR RUNTIME ERROR--


*DATA : VALUE1 TYPE I.

*

*VALUE1 = 1 / 0. -


>>>>>> IT MAKES RUN TIME ERROR.

*

*WRITE : VALUE1.

*-EXAMPLE FOR HOW TO CATCH THE ARITHMETIC ERROR AT THE RUN TIME USING SUBRC----


DATA : VALUE1 TYPE I.

CATCH SYSTEM-EXCEPTIONS ARITHMETIC_ERRORS = 1.

VALUE1 = 1 / 0.

WRITE : VALUE1.

ENDCATCH.

IF SY-SUBRC = 1.

WRITE : ' IT MAKES ERROR'.

ELSE.

WRITE : VALUE1.

ENDIF.

Thanks,

Reward If Helpful.

3 REPLIES 3
Read only

Former Member
0 Likes
632

Hi Vinay,

You can't delete the ABAP Runtime errors. But you can catch the errors using catch exception Statement.

For Example,

Class-based exceptions are handled in the following control structure:

TRY.

... " TRY block (application coding)

CATCH cx_... cx_... ...

... " CATCH block (exception handler)

CATCH cx_... cx_... ...

... " CATCH block (exception handler)

...

CLEANUP.

... " CLEANUP block (cleanup context)

ENDTRY.

Try This Sample Code,

*--


EXAMPLE FOR RUNTIME ERROR--


*DATA : VALUE1 TYPE I.

*

*VALUE1 = 1 / 0. -


>>>>>> IT MAKES RUN TIME ERROR.

*

*WRITE : VALUE1.

*-EXAMPLE FOR HOW TO CATCH THE ARITHMETIC ERROR AT THE RUN TIME USING SUBRC----


DATA : VALUE1 TYPE I.

CATCH SYSTEM-EXCEPTIONS ARITHMETIC_ERRORS = 1.

VALUE1 = 1 / 0.

WRITE : VALUE1.

ENDCATCH.

IF SY-SUBRC = 1.

WRITE : ' IT MAKES ERROR'.

ELSE.

WRITE : VALUE1.

ENDIF.

Thanks,

Reward If Helpful.

Read only

Former Member
0 Likes
631

hi

good

you cant delete the abap runtime errors ,yes while activating you can select the activate anyway button to activate the program and execute it.

thanks

mrutyun^

Read only

Former Member
0 Likes
631

hi,

u cant delete the runtime errors only while activationg u can see them n changwe the errors but u cant delete them,