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

Catching a runtime error

Former Member
0 Likes
2,798

Hi,

A runtime error for overflow (type p) occurs with the following details:

Runtime Errors COMPUTE_BCD_OVERFLOW

Exception CX_SY_ARITHMETIC_OVERFLOW

Date and Time 06/12/2007 11:33:13

Instead of displaying the dump screen, i'd like to catch the runtime error and display a message instead. The following is the code that causes the error (onhand is too large):

REQRMENT = FORECAST - ONHAND - OPENQTY.

Please help,

Points will be rewarded and all help will be greatly appreciated.

Thanks,

John

2 REPLIES 2
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,224

Wrap it with a CATCH.




catch system-exceptions compute_bcd_overflow = 1.
 REQRMENT = FORECAST - ONHAND - OPENQTY.
endcatch.

if sy-subrc  = 1.
* Handle the exception
Endif.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
1,224

According to help, these are the catchable exceptions for a form call:

Catchable Exceptions

CX_SY_PROGRAM_NOT_FOUND

Cause: The specified program was not found.

Runtime Error: LOAD_PROGRAM_NOT_FOUND

Cause: The specified program cannot exist because the program name is longer than 40 characters.

Runtime Error: PERFORM_PROGRAM_NAME_TOO_LONG

CX_SY_DYN_CALL_ILLEGAL_FORM

Cause: The specified subroutine was not found.

Runtime Error: PERFORM_NOT_FOUND

Cause: The specified index was too small.

Runtime Error: PERFORM_INDEX_0

Cause: The specified index was negative.

Runtime Error: PERFORM_INDEX_NEGATIVE

Cause: The specified index was too large.

Runtime Error: PERFORM_INDEX_TOO_LARGE

CX_SY_DYN_CALL_PARAM_MISSING

Cause: The called FORM expects more parameters than were specified.

Runtime Error: PERFORM_PARAMETER_MISSING

CX_SY_DYN_CALL_PARAM_NOT_FOUND

Cause: More parameters were specified than expected by FORM.

Runtime Error: PERFORM_TOO_MANY_PARAMETERS

CX_SY_DYN_CALL_ILLEGAL_TYPE

Cause: In the parameter transfer using the addition STRUCTURE, the addressing offsets/> do not match in the current and target structures.

Runtime Error: PERFORM_BASE_WRONG_ALIGNMENT

Cause: The deep components contained in the current and target structures cannot be passed to each other. This error can only occur in parameter transfer using STRUCTURE.

Runtime Error: PERFORM_CAST_DEEP_MISMATCH

Cause: During the transfer of a generically defined type to the form, a type conflict occurred.

Runtime Error: PERFORM_CONFLICT_GENERIC_TYPE

Cause: The table type of the current parameter does not match the table type of the parameter defined in the form.

Runtime Error: PERFORM_CONFLICT_TAB_TYPE

Cause: The type of current parameter does not match the type of parameter defined in the form.

Runtime Error: PERFORM_CONFLICT_TYPE

Cause: The current parameter occupies less storage space than the target parameter defined in the form. This error occurs only with parameter specification using STRUCTURE.

Runtime Error: PERFORM_PARAMETER_TOO_SHORT

Cause: During parameter transfer with the addition STRUCTURE, the fragment views of the current and target parameters do not match. This error only occurs in Unicode programs in

Runtime Error: PERFORM_CONFLICT_UC_STRUCT

Cause:When the form is called, an internal table is expected as current parameter.

Runtime Error: PERFORM_TABLE_REQUIRED

Cause: A hash table was passed to a parameter defined using TABLES.

Runtime Error: PERFORM_STD_TAB_REQUIRED