Application Development 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: 

Extended program check error for cl_salv_table=>factory

Former Member

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

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor

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

4 REPLIES 4

naimesh_patel
Active Contributor

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

0 Kudos

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

0 Kudos

Just declare it like:


data: lv_string type string.

Regards,

Naimesh Patel

Former Member
0 Kudos

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