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: 

Code Inspector Scope

0 Kudos

I'm researching the Code Inspector and testing things along the way. An obstacle I have deals with it's checking of the Authorization-Check. I set up the variant to check Robust Programming > Check of SY-SUBRC and selected AUTHORITY-CHECK.

In my test program I execute the Authority-Check without a SY-SUBRC check in a form. When I run the inspector it finds no issues. If I copy the code to in the Initialization or Start-of-Selection the inspector issues the "No Handling of SY-SUBRC After AUTHORITY-CHECK" message.

Has anyone encountered this issue and found a resolution? Is there a setting to have it check forms or even includes?

1 REPLY 1

naimesh_patel
Active Contributor
0 Kudos

For AUTHORITY-CHECK within the FORMs, SCI is assuming that the Check for SY-SUBRC would be performed by the caller.

The class CL_CI_TEST_SYSUBRC is called for the SY-SUBRC check. See the method CHECK_NEXT_STMNTS. The SUBRC check is marked successful for the next statement is the ENDFORM.

      when 'ENDFORM'.

        p_subrc_is_handled
= c_true.     "sole statement in a form routine
       
return.                          "--> SY-SUBRC could be handled by caller

If you want, you can Create your own check using blog

You could use the same logic to identify if SUBRC is present for ENDFORM which is there for other keywords in the same CASE.. ENDCASE

Regards,
Naimesh Patel