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

Raising Exception

UmaArjunan
Active Participant
1,732

The Zreport is fetching all the datas which is

displayed in the alv grid and a user defined button

( in the alv grid screen ) is pressed all the datas are send thru XI interface and it stored in the system.

This has been handled using the following code. I want to catch this exception since i was getting a warning. Plz suggest me hw to handle this exception

This has been used in the user command form

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

if r_ucomm = sy-ucomm.

.....

.......

...

CREATE OBJECT prxy.

TRY.

CALL METHOD prxy ->executre_asynchronous

EXPORTING

output = it_grtinfo.

COMMIT WORK.

CATCH cx_system_fault into fault.

CREATE OBJECT fault.

lv_msg_text = fault->get_text( ).

Write : / fault-> errortext.

ENDTRY.

endform.

After checking the syntax, i got the following warning.

Plz tell me how to handle this exception in the program

Warning message is : The exception CX_AI_SYSTEM_FAULT is neither caught nor declared in the RAISING clause of "USER_COMMAND"

Please revert back as soon as possible.

Thanks in advance

2 REPLIES 2
Read only

matt
Active Contributor
0 Likes
683
CREATE OBJECT prxy.
TRY.
  CALL METHOD prxy ->execute_asynchronous EXPORTING output = it_grtinfo.
  COMMIT WORK.
CATCH cx_system_fault into fault.
* CREATE OBJECT fault. " You don't need the this - the CATCH "creates" the object
  lv_msg_text = fault->get_text( ).
  Write : / fault-> errortext.
CATCH cx_ai_system_fault INTO ai_fault.
  lv_msg_text = ai_fault->get_text( ).
  Write : / ai_fault-> errortext.
ENDTRY.

matt