2009 Sep 14 7:56 AM
HI all,
i call to method in FM and i want avoid dump when i have exception.
how i can do so since when i use try and catch and i run the fm with wrong data nothing happen .
and when i run the FM without try and catch i get dump when i put wrong data .
P.s. i put cx_ur_map in the function module raise tab .
TRY.
CREATE OBJECT lo_us.
CALL METHOD lo_uS->getles
EXPORTING
iv_ex = iv_ex
RECEIVING
rt_r = rt_uR.
CATCH cx_ur_map .
ENDTRY.
Thanks
Chris
2009 Sep 14 12:15 PM
Hi Chris,
you have to write some code after the CATCH statement to actually handle the exception, otherwise nothing will happen in case of that exception.
try the following
data: lx_error type ref to cx_ur_map,
l_message type string.
TRY.
CREATE OBJECT lo_us.
CALL METHOD lo_uS->getles
EXPORTING
iv_ex = iv_ex
RECEIVING
rt_r = rt_uR.
CATCH cx_ur_map into lx_error .
l_message = lx_error->get_text( ).
message l_message type 'E'.
" more code to handle the error
ENDTRY.
HI all,
i call to method in FM and i want avoid dump when i have exception.
how i can do so since when i use try and catch and i run the fm with wrong data nothing happen .
and when i run the FM without try and catch i get dump when i put wrong data .
P.s. i put cx_ur_map in the function module raise tab .
TRY.
CREATE OBJECT lo_us.
CALL METHOD lo_uS->getles
EXPORTING
iv_ex = iv_ex
RECEIVING
rt_r = rt_uR.
CATCH cx_ur_map .
ENDTRY.
Thanks
Chris
2009 Sep 14 8:09 AM
Hi Chris,
In F1 help of the ABAP code you can find the possible exceptions of the class. If it is a global class go to events tab to find the exception.
If you are designing a new class then you have to define a exception method and the corresponding event in the events tab
let me know if you need any more help, For better understanding refer to BC401 doc
Cheers
Pavan
2009 Sep 14 12:15 PM
Hi Chris,
you have to write some code after the CATCH statement to actually handle the exception, otherwise nothing will happen in case of that exception.
try the following
data: lx_error type ref to cx_ur_map,
l_message type string.
TRY.
CREATE OBJECT lo_us.
CALL METHOD lo_uS->getles
EXPORTING
iv_ex = iv_ex
RECEIVING
rt_r = rt_uR.
CATCH cx_ur_map into lx_error .
l_message = lx_error->get_text( ).
message l_message type 'E'.
" more code to handle the error
ENDTRY.
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |