SAP Code Inspector(SCI)
A Brief Introduction ‘SAP code Inspector’ as the name suggests scan programs for potential problems that are closely related to the static ABAP code, mainly in the areas of performance and security. Now best part of this tool is before the program is being developed, any issues can be corrected before it reaches the Production System. Program Quality can be determined by using testing strategies, which can be either dynamic or static tests. Dynamic and Static Tests In a dynamic test, the scenario or program is executed, which is to be tested whereas in static test the quality of an object from it’s static definition is determined using it’s naming conventions standards that are slightly associated with static code. SCI Using this tool we can: 1 Check single objects and objects sets (OR or AND of two objects). 2 Combine individual checks easily into a set (i.e. check variant). 3 Save and reuse objects. 4 Achieve fast check execution as a result of check data sharing and optional parallel processing. As a result of these checks, a list is generated with messages (information, warning or error that refer to objects or statement in objects that appear to be problematic). Technically the code inspector can consist of two functional areas: 1. The test driver: The test driver defines the test tasks, execute them .Finally it stores and displays the results. 2. An extensible set of checks: It comes with a pack of many built in checks but also we can define our own. To use SCI we have to define its elements that define and control its operation. 1. Inspection (The test which is to be run) consists of the combination of an object set and a check variant. 2. Object set : Object can be any development object that exists in an SAP system and has an entry in the catalog of repository objects(table TADIR).e.g. we can choose reports ,function groups ,classes ,interfaces ,etc. 3. Check Variant: It is a combination of one or more individual checks .e.g. syntax, performance, security etc. Tcode: The transaction code for this tool is SCI. The above figure shows the initial screen .There are three sections as discussed. It also shows the person responsible here it is user dev06. Let give for e.g. the name ‘TESTOBJECT’, to our object set Object Sets can be created 1 Freely (from scratch) 2 Copy an existing object set and modify it 3 From an Inspection result 4 From a transport request Note: Object sets are automatically deleted after 30 days of creation. This is to avoid unnecessary chunking of data into server. To avoid this, change the Deleted On Date accordingly. Click create button. Now in the person responsible field enter SAP User Name. Note: Do not confuse with person responsible field at the top of the screen, which is the name of the person responsible for the object set. Select the “Selections Only” check box. Also give * in the class column to limit the object set to classes only. Otherwise it will include function groups, programs etc. Save the object set. In the status bar message will be displayed and we can notice that a version is also generated for the object set automatically. We can review it also by clicking display objects. Once we have created the object set we have to create a Check Variant which is used to decide what all checks we have to perform. The Standard Checks that are available with the code inspector are: 1. Syntax checks and Program Generation (e.g. ABAP syntax, program generation etc). 2. Security Checks(e.g. references to external units ,package checks etc) 3. Performance checks (e.g. analysis of database queries etc.) 4. Search operations (e.g. search for single tokens, complete statements etc). Enter the name as “Performance check” (for e.g.) in the check variant column. Click the create button… Select all the performance checks by selecting “Performance Checks” check box. We can get the information about checks also by clicking the “I “button in front of checks. Note: If you want this variant to be transported to other system landscapes mark the checkbox Transportable. Save it and click back. Now the only thing remaining is the inspection. Inspection can be of two types: 1. Anonymous Inspections: Their results are not stored persistently. They are useful for ad-hoc queries with only few objects max (50). 2. Named Inspections: Their results are stored persistently. It can handle object sets containing any number of objects and also runs either on the local server or in parallel tasks on a server group. Here let us create a named inspection,’ inspect’. Click create button. Now provide the object set name and check variant name and click the execute button A message is displayed on the status bar. To see the results click on the “results” button or press “shift + F6”. Result can be seen in the form as shown above comprising of all types of messages (error, warning and information). As discussed earlier that not only on local server but also a group of servers can be selected to do the same.Take an object set and check variant just create a new inspection. For e.g As discussed earlier the same name is used as shown in figure below and it can be easily noticed that system now introduced it’s version as 002 which earlier was 001. Now click on the “Execute To” button next to execute button. We can notice that option “Group” and on pressing F4 we can select a group of servers. Also we are capable of executing the inspection either immediately or in background. The inspection discussed here is Bottom up i.e. first we create object set then a check variant and finally the inspection is carried out where as in the Top-down approach the process is reversed. We also have the option of selecting individual programs or we can also join two objects. Moreover we can either have the OR or AND operation over these objects. For selecting individual programs click programs tab in the object selection and for performing the join of two objects click edit object sets Shortcomings of SCI A static check can rarely judge the relevance of a piece of code. It will never check the future data which is to be used by the program. Conclusion For best results use both the static tests (Code-SCI) as well as dynamic tests (using Code SE30 and ST05).
Would you like to access Full Article?
If you are already a member in this website, Please Click here to loginIf you are not yet a member, Please Click here to Sign up
if you have any questions don’t hesitate to contact us from the Button bellow
New NetWeaver Information at SAP.com