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

handling exceptions for a event handler method.

Former Member
0 Likes
1,137

Hi Mates,

I have two custom container in which i am displaying an alv grid usind objects. when a double click event is performed in one of the alv the other alv should be displayed. I now have to handle exceptions of the class CX_SY_DYN_CALL_ILLEGAL_TYPE. This is raised for an invalid parameter type when calling a method dynamically. I cannot use the keyword "RAISING" in the definition of the event handler method. i checked with the syntax of the method definition in abap dictionary, there were no addition "RAISING" for an event handler method. please provide me with the solution (a sample code would do.)

1 ACCEPTED SOLUTION
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
588

Hello,

May be you should read about the TRY ... CATCH block which is used for handling exceptions.

Basic construct of your code should look like this:

TRY.
" Your Dynamic Method call

  CATCH CX_SY_DYN_CALL_ILLEGAL_TYPE.
ENDTRY.

If you want to get the error message text:

DATA:
lcx_excp TYPE REF TO CX_SY_DYN_CALL_ILLEGAL_TYPE,
v_err_msg TYPE string.

TRY.
" Your Dynamic Method call

  CATCH CX_SY_DYN_CALL_ILLEGAL_TYPE INTO lcx_excp.
  v_err_msg = lcx_excp->get_text( ).
ENDTRY.

1 REPLY 1
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
589

Hello,

May be you should read about the TRY ... CATCH block which is used for handling exceptions.

Basic construct of your code should look like this:

TRY.
" Your Dynamic Method call

  CATCH CX_SY_DYN_CALL_ILLEGAL_TYPE.
ENDTRY.

If you want to get the error message text:

DATA:
lcx_excp TYPE REF TO CX_SY_DYN_CALL_ILLEGAL_TYPE,
v_err_msg TYPE string.

TRY.
" Your Dynamic Method call

  CATCH CX_SY_DYN_CALL_ILLEGAL_TYPE INTO lcx_excp.
  v_err_msg = lcx_excp->get_text( ).
ENDTRY.