Exception is not handled and is not declared in the RAISING clause
ABAP Test Cockpit (ATC) checks enables SAP programmers to catch code blocks with unhandled exceptions. For example Exception is not handled and is not declared in the RAISING clause ATC message informs the ABAP developer to code blocks where exception handling should be done by using ABAP TRY-CATCH method.
ATC check on a SAP HANA ABAP program resulted with following messages:
Extended Program Check (SLIN) Exception is not handled and is not declared in the RAISING clause
When I jump to the ABAP code block where the ATC check message occurs by clicking on the Object Name column value, I see that the reported problem occured where I called the ABAP class method cl_shdb_seltab=>combine_seltabs without catching the method exception cx_shdb_exception
I used the code that ABAP Object Pattern tool suggests.
When I enclose this ABAP method call within a TRY...CATCH code block, I got following ABAP code.
*try.
call method cl_shdb_seltab=>combine_seltabs
exporting
it_named_seltabs =
* iv_client_field =
receiving
rv_where =
.
* catch cx_shdb_exception .
*endtry.
Uncomment ABAP TRY-CATCH code lines
I modified the original code for its final version as seen below
try .
call method cl_shdb_seltab=>combine_seltabs
exporting
it_named_seltabs = value #(
( name = 'AUART' dref = ref #( s_auart[] ) )
( name = 'VBTYP' dref = ref #( s_vbtyp[] ) )
( name = 'SPERR' dref = ref #( r_sperr[] ) )
)
* iv_client_field =
receiving
rv_where = data(lv_where).
catch cx_shdb_exception.
endtry.
Or as follows helped me to get rid of the ATC check messages related with missing catch statements for the class method exceptions.
try.
data(lv_where) = cl_shdb_seltab=>combine_seltabs( it_named_seltabs = value #(
( name = 'AUART' dref = ref #( s_auart[] ) )
( name = 'VBTYP' dref = ref #( s_vbtyp[] ) )
( name = 'SPERR' dref = ref #( r_sperr[] ) )
) ).
catch cx_shdb_exception.
endtry.