02-10-2010 4:30 AM
hi all,
when performing Extended Program check, I am getting some warning message
code
DATA: lc_msg TYPE REF TO cx_salv_msg.
*. Create Instance for ALV
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = go_alv
CHANGING
t_table = ts_z3rl_docket.
CATCH cx_salv_msg INTO lc_msg .
ENDTRY.
Error message;
No Exception Handling After the CATCH Statement
(The message can be hidden with "#EC NO_HANDLER)
how to handle this message?? how to recitfy this?
kindly help
02-10-2010 4:37 AM
Basically, this message appears because, you are trying to CATCH the exception in the exception object, but you are not accessing this exception object. If you do want to give the message, if you catch some exception, you should do like this:
*. Create Instance for ALV
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = go_alv
CHANGING
t_table = ts_z3rl_docket.
CATCH cx_salv_msg INTO lc_msg .
lv_string = lc_msg->get_text( ). " <
message lv_string type 'I'. "<
ENDTRY.
Or, if you don't want to handle the exception, you can do like this:
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = go_alv
CHANGING
t_table = ts_z3rl_docket.
CATCH cx_salv_msg. "#EC NO_HANDLER
ENDTRY.
Regards,
Naimesh Patel
02-10-2010 4:37 AM
Basically, this message appears because, you are trying to CATCH the exception in the exception object, but you are not accessing this exception object. If you do want to give the message, if you catch some exception, you should do like this:
*. Create Instance for ALV
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = go_alv
CHANGING
t_table = ts_z3rl_docket.
CATCH cx_salv_msg INTO lc_msg .
lv_string = lc_msg->get_text( ). " <
message lv_string type 'I'. "<
ENDTRY.
Or, if you don't want to handle the exception, you can do like this:
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = go_alv
CHANGING
t_table = ts_z3rl_docket.
CATCH cx_salv_msg. "#EC NO_HANDLER
ENDTRY.
Regards,
Naimesh Patel
02-11-2010 3:37 AM
Hi Narmesh Patel,
when i tried the first code, I am getting an error as Field "LV_String" is unknown..niether delcared in tables or in DATA stmts.
what i need to delcare for the lv_string??
kindly help
02-11-2010 3:44 AM
Just declare it like:
data: lv_string type string.
Regards,
Naimesh Patel
02-10-2010 4:39 AM
Hi
DATA: lc_msg TYPE REF TO cx_salv_msg.
*. Create Instance for ALV
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = go_alv
CHANGING
t_table = ts_z3rl_docket.
CATCH cx_salv_msg INTO lc_msg . "#EC NO_HANDLER
ENDTRY.
This sould hide the error message in the SLIN check. Or you could write a bit of code below the CATCH statement to hadle the exception.
Pushpraj