Skip to content
Jul 13 14

Evaluating the Quality of Your ABAP with Code Inspector – Part 3

by admin
Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest

Tony CecchiniAnthony Cecchini is the President of Information Technology Partners (ITP), an SAP consulting company headquartered in Pennsylvania. ITP offers comprehensive planning, resource allocation, implementation, upgrade, and training assistance to companies. Anthony has over 17 years of experience in SAP R/3 business process analysis and SAP systems integration. His areas of expertise include SAP NetWeaver integration; ALE development; RFC, BAPI, IDoc, Dialog, and Web Dynpro development; and customized Workflow development. You can reach him at ajcecchini@itpsap.com.

 

Standard Checks That Come with the Code Inspector

In this final installment, I’d like to show you some of the built-in checks that come with Code Inspector. They can be grouped into categories, like the one’s below…

Syntax checks
Program generation
Security checks
Performance checks

To help you get the most out of the Code Inspector right away, we want to introduce you to the most important checks in these categories. Remember that you can display the online documentation for an individual check to learn more about it.

 

Syntax Checks

This category contains checks that are associated with the ABAP Syntax Check. All checks are standard tests that are also available individually from the ABAP Workbench. The advantage of applying the checks in the Code Inspector is that you can combine them with other checks and perform them on a set of programs at the same time.

The checks in this category are:

Normal ABAP Syntax Check

This check performs the ABAP Syntax Check, which is also available from most workbench transactions. You control its behavior by setting the following parameters:

-One or Several Errors: Normally the syntax check terminates after the first error is detected, but you can also choose to proceed. If a fatal error is detected or the maximum number of 50 errors is exceeded, the check is terminated.

-With or Without Warnings: In addition to error messages, the syntax check also returns warnings for minor syntax problems, such as missing implementations of interface methods. You can turn these warnings on or off.

Extended Program Check

This check uses the same set of checks that is available with the workbench transaction SLIN for single objects. It processes static checks that are too complicated or too time-consuming for the normal syntax check. The first operation of this check is a normal syntax check. If any error is detected, no further checks are performed. You can learn more about the SLIN transaction by clicking HERE.

The checks can be broken down into the following…..

References to program external units:Verifies that the external program units exist and interfaces are used correctly.  This would include ABAP statements such as CALL TRANSACTION ‘tcod’,  PERFORM form IN PROGRAM program, MESSAGE Ennn, SUBMIT ‘report’, CALL METHOD ‘method’, and of course CALL FUNCTION ‘func’ .

Multi-language enabling: Searches for constructs that hamper the use of a program in different languages — for example, text literals without text IDs. Text literals appear in the language in which they were typed, and are not processed by translation services.

Package check: Detects the illegal use of objects from other packages.

EBCDIC/ASCII portability: Detects whether a program behaves differently in EBCDIC and ASCII (e.g., the comparison of character fields).

Statements in wrong context: Scans for statements that are used in an inappropriate language context. For example, the COMMIT WORK statement within a SELECT … ENDSELECT loop leads to the loss of the database cursor.

Unnecessary items: Searches for form subroutines that are not used in a program, or fields that do not have read access.

read more…

Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest
Jun 15 14

Evaluating the Quality of Your ABAP with Code Inspector – Part 2

by admin
Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest

Tony CecchiniAnthony Cecchini is the President of Information Technology Partners (ITP), an SAP consulting company headquartered in Pennsylvania. ITP offers comprehensive planning, resource allocation, implementation, upgrade, and training assistance to companies. Anthony has over 17 years of experience in SAP R/3 business process analysis and SAP systems integration. His areas of expertise include SAP NetWeaver integration; ALE development; RFC, BAPI, IDoc, Dialog, and Web Dynpro development; and customized Workflow development. You can reach him at ajcecchini@itpsap.com.

  

Calling the Code Inspector

 Last month we examined the Code Inspector Framework, which should have given you a good foundation on the components of a Code Inspector inspection process. Lets look then this month on using the Code Inspector day to day to help us write better code.

BDT TipThis blog will focus on the code inspector prior to EhP2 for SAP NetWeaver 7.0 support package stack 12 (SAP Basis 7.02, SAP Kernel 7.20) and EhP3 for SAP NetWeaver 7.0 support package stack 5 (SAP Basis 7.31, SAP Kernel 7.20). The reason I bring this to your attention is because after the above, we now have a NEW solution for quality management called the ABAP TEST COCKPIT. The ABAP Test Cockpit is a new ABAP check toolset which allows you to run static checks and unit tests for your ABAP programs. In order to ensure a smooth migration and comparable check results throughout your company, the ABAP Test Cockpit is compatible with SAP’s Code Inspector. This means you can reuse your custom Code Inspector checks and variants in the ABAP Test Cockpit.

Back to our Blog…..

When you are working on a program, function module, or class, you typically call the ABAP Syntax Check directly from the editor iteratively as we code. But wouldn’t it also be nice to have the performance or security checks of the Code Inspector at your disposal while coding? As of Web AS 6.10, you can call the Code Inspector for the object you are working on from the menu of the ABAP Workbench (SE80), the ABAP Editor (SE38), the Function Builder (SE37), or the Class Builder (SE24). When called from these workbench transactions, the Code Inspector automatically applies the DEFAULT check variant to the examined objects and the inspection results are not persisted.

Select <Object>=>Check =>Code Inspector where <Object> represents  a “Program,” “Function module,” or “Class.”

Code Inspector 

read more…

Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest
May 16 14

Evaluating the Quality of Your ABAP with Code Inspector – Part 1

by admin
Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest

Tony CecchiniAnthony Cecchini is the President of Information Technology Partners (ITP), an SAP consulting company headquartered in Pennsylvania. ITP offers comprehensive planning, resource allocation, implementation, upgrade, and training assistance to companies. Anthony has over 17 years of experience in SAP R/3 business process analysis and SAP systems integration. His areas of expertise include SAP NetWeaver integration; ALE development; RFC, BAPI, IDoc, Dialog, and Web Dynpro development; and customized Workflow development. You can reach him at ajcecchini@itpsap.com.

 

Options for Determining Program Quality

You and I as ABAP developers understand that aside from design and code reviews, the most efficient technique for controlling program quality is during testing. By using the debugger, SQL Trace, and testing with real data, you can effectively monitor program performance, which of course, strongly depends on the dynamically executed code and the processed data.

I would like to continue the discussion from last month’s blog, focusing again on a preventive approach by using Static checks first to evaluate the quality of an object from its static definition. Good candidates for static checks include naming conventions, layout style guides, and other simple programming standards that are tightly associated with the static code. To some extent, you can also use static checks to look for the use of statements related to system stability and security.

Performance is NOT normally a problem on the development system, where adequate test data rarely exists, but it can quickly become one in the production system. Fortunately, you can make some assumptions about program performance based on static analysis. For example, by analyzing both the source code and the data dictionary definition, you can determine whether an Open SQL statement might become a performance bottleneck because of a badly coded WHERE clause, FOR ALL ENTRIES, or missing database index.

To perform static quality checks, you really need a tool for scanning a lot of source code and other object definitions efficiently. Starting back with SAP Web Application Server (Web AS) Release 6.10, we were given such a tool with the new SAP Code Inspector. It checks programs, function groups, classes, and other repository objects.

Whether you an experienced developer or a brand new one, my hope in this 3 part blog is to introduce you to the Code Inspector, so you can begin to utilize and leverage it’s power to help your ABAP development be the highest quality it can be.

This blog will loosely follow a 3 part format as outlined below:

- Present the Code Inspector SAP framework.

- Explain how to work with the SAP Code Inspector tool

- Introduce you to some important checks that are built-in and ready to use now.

read more…

Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest
Apr 12 14

The Quality of your ABAP Development

by admin
Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest

Tony CecchiniAnthony Cecchini is the President of Information Technology Partners (ITP), an SAP consulting company headquartered in Pennsylvania. ITP offers comprehensive planning, resource allocation, implementation, upgrade, and training assistance to companies. Anthony has over 17 years of experience in SAP R/3 business process analysis and SAP systems integration. His areas of expertise include SAP NetWeaver integration; ALE development; RFC, BAPI, IDoc, Dialog, and Web Dynpro development; and customized Workflow development. You can reach him at ajcecchini@itpsap.com.

 

Why Use SAP Tools for Quality and Performance

ABAP is a powerful language for building sophisticated applications. But as any developer understands, even the most carefully written and tested objects can wind up terminating with a runtime error, producing unexpected messages, returning incorrect results, or causing application performance problems. As a result, SAP provides a comprehensive set of specialized tools for performing static code checks, coverage analysis, post-mortem analysis, runtime traces, and debugging as part of the standard delivery of SAP Web Application Server (Web AS).

A Systematic Approach to Testing ABAP Objects

Let’s assume that you have already removed all syntax errors from your SAP ABAP Program, so you can at least activate and execute it. However, you still cannot be sure that the program will not produce a runtime error or that the program will deliver the intended results. What are the next steps? What tools are available for further source code checks and runtime testing to validate the runtime behavior of the program?

read more…

Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest
Mar 16 14

Debugging ABAP for Functional Teams – Part 2

by admin
Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest

Tony CecchiniAnthony Cecchini is the President of Information Technology Partners (ITP), an SAP consulting company headquartered in Pennsylvania. ITP offers comprehensive planning, resource allocation, implementation, upgrade, and training assistance to companies. Anthony has over 17 years of experience in SAP R/3 business process analysis and SAP systems integration. His areas of expertise include SAP NetWeaver integration; ALE development; RFC, BAPI, IDoc, Dialog, and Web Dynpro development; and customized Workflow development. You can reach him at ajcecchini@itpsap.com.

 

Recap from last Month

In last month’s blog we discussed why debugging is important for discovering root cause when SAP transactions are behaving badly. We also went through some ways to trigger debugging, and took a look at the debugger screen, navigation and Break-Points.

Debugging for Various Scenarios

This month we will look at one common scenario that may cause you to need the debugger. Let’s start with Standard SAP Messages.

Please understand that for teaching purposes, I am using a VERY SIMPLE example, but the idea behind it applies to more complex transactions as well. Let’s get started!

Your are executing a simple PO Browse using ME23 and you get an error message explaining that the PO you entered does not exist. You are not sure why this message has appeared, and there is no long text available in the message. (see Below)

ME23 Debug

 You want to know why the SAP system has sent this error, so you need to debug the logic for this message. So lets use what we have learned. To activate the debugger enter transaction /h in the command prompt. Go ahead and enter your PO number and press Enter.  We will be at the debugging screen (see below)

Debugger

Now here is where a little ABAP knowledge pays off….

read more…

Recommend This Post! Tweet about this on TwitterShare on FacebookShare on LinkedInShare on Google+Pin on Pinterest