Page tree
Skip to end of metadata
Go to start of metadata

On this page:

Target audience:

CAST Administrators

Summary: this page provides detailed information about CAST's support for the SAP ABAP technology.

Detailed technology support

Language VersionSupportedComments
  • ABAP versions 4.6 - 7.5
  • Web Dynpro for ABAP

Note that ABAP 7.5 is supported in CAST AIP 8.2.10 only.

(tick)

The ABAP Analyzer supports all SAP ABAP products, running with SAP modules Basis and ABA of NetWeaver v7.

Supported SAP products:

  • ECC5, ECC6, S/4HANA
  • CRM v7
  • SRM v7
  • SCM v7
  • ISU v7

Unsupported SAP products:

  • CE
  • XI/PI
  • BW/BI
  • Mobile

Supported SAP technologies:

  • ABAP
  • ABAP Object
  • BAPI
  • Web Dynpro for ABAP

Unsupported SAP technologies

  • BSP
  • iDoc
  • SAPScript
  • Search Help
  • Smart Forms
  • Workflow
  • Web Dynpro for Java

Required third-party software

To successfully deliver and analyze SAP ABAP code, the following third-party software is required:

Install on workstation running the DMT (for extraction)
Install on workstation running CMS (for analysis)

Nothing required

Nothing required

SAP Extractor

CAST supports the analysis of ABAP client code and can also identify links from this client code to SAP tables/programs. To do so, information about the SAP tables and programs needs to be extracted from the SAP system and analyzed at the same time as the ABAP client code. To perform the extraction, a specific SAP extractor must be installed on the SAP instance BEFORE the extraction is actioned in the CAST Delivery Manager Tool. This extractor can be run from the SAP instance and extracts information into flat files: these files are then manually or automatically transferred onto a Windows workstation for packaging via the CAST Delivery Tool Manager. You can find out more about this process in the CAST SAP Extractor NG Admin Guide.

Note that in order for CAST AIP to save SAP tables and programs in the CAST Analysis Service during an analysis, the following must be true:

  • The SAP tables and programs must have been successfully extracted from the SAP system and analyzed with the ABAP client code
  • AND the SAP tables and programs must be referenced in the ABAP client code

If only one of these things is true then the tables and programs will not be saved in the CAST Analysis Service.

SAP ABAP objects and links

The following section lists the objects and links between objects that the SAP / ABAP analyzer is capable of detecting and storing in the CAST Analysis Service:

ABAP objects

ABAP Alias

ABAP Badi

ABAP Class

ABAP Class Pool

ABAP Constructor

ABAP Event

ABAP Event Block

ABAP Event Method

ABAP File Level Code

ABAP Form

ABAP Function

ABAP Function Pool

ABAP Include

ABAP Interface

ABAP Interface Pool

ABAP Macro

ABAP Member

ABAP Method

ABAP Module

ABAP Module Pool

ABAP Package

ABAP Program

ABAP Type Pool

ABAP Unresolved Folder

ABAP Unresolved Object

ABAP User Exit

SAP objects

ABAP Processing Screen

ABAP Selection Screen

SAP Project

SAP Table

SAP Transaction

SAP View

BAPI objects

BAPI

BAPI Attribute

BAPI Event

BAPI Key Field

BAPI Method

Web Dynpro for ABAP

Web Dynpro Action

Web Dynpro Application

Web Dynpro Attribute

Web Dynpro Component

Web Dynpro Component Controller

Web Dynpro Event Handler

Web Dynpro Inbound Plugin

Web Dynpro Interface Controller

Web Dynpro Interface View

Web Dynpro Method

Web Dynpro Outbound Plugin

Web Dynpro Supply Function

Web Dynpro View

Web Dynpro Window

Link typeWhen is this type of link created?Example
ACCESSEXECThis link is created when a piece of code calls a method.
CALL METHOD oref->method1...
MEMBERThis link is created when an object make an access to a member of another object.
METHOD mymethod.
   WRITE ref->attr
ENDMETHOD.
READThis link is created when an object reads a value of another object.
METHOD mymethod.
   X = ref->attr
ENDMETHOD.
WRITEThis link is created when an object modifies a value of another object.
METHOD mymethod.
   ref->attr = 10
ENDMETHOD.
BELONGS TOThis link is created when one object belongs to another object.
report abapReport
Function f
Endfunction

(f belongs to abapReport).

CALLThis link is used to describe a function that is called in a code block.
Function f
Perform g
Endfunction

(f calls g)

This link is created when a SAP transaction calls another SAP transaction.This information is extracted from the SAP system.
This link is created when a SAP transaction calls the processing screen or the selection screen of an ABAP program.This information is extracted from the SAP system.
This link is created when an ABAP program calls a SAP transaction.
CALL TRANSACTION SA10 AND SKIP FIRST SCREEN.
...
LEAVE TO TRANSACTION SA10.
This link is created when an event block of a screen calls an ABAP module.
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
*
PROCESS AFTER INPUT.
CHAIN.
FIELD: SDYN_CONN-CITY, SDYN_CONN-COUNTRY,
SDYN_CONN-CARID, SDYN_CONN-MARK.
MODULE USER_COMMAND.
ENDCHAIN.
This link is created when an ABAP component calls a screen.This information is extracted from the SAP system.
INCLUDEThis link is used when a file includes another file.
Report abapReport
Include include_name
INHERITEXTENDThis link is created from a class A to a class B if A inherits B.
CLASS subclass DEFINITION
   INHERITING FROM superclass.
ENDCLASS.
OVERRIDEIf a method of a class overrides a method belonging to a parent class, then this link is created between the two methods.
METHODS mymethod REDEFINITION.
IMPLEMENTThis link is created from a class to an interface when the class implements this interface.
CLASS myclass DEFINITION.
PUBLIC SECTION.
INTERFACES: interf1, interf2 ... 
ENDCLASS.
If a class implements an interface, this link is also created between the method belonging to the class and the corresponding method belonging to the interface.
INTTERFACE status.
METHODS write.
ENDINTERFACE.

CLASS counter DEFINITION.
PUBLIC SECTION.
INTERFACE status.
...
ENDCLASS.

CLASS counter IMPLEMENTATION.
METHOD status~write.
...
ENDMETHOD.
...
ENDCLASS.
RAISEThis link is created when a method activates an event.
RAISE EVENT evt EXPORTING ...
RELY ONThis link is created when a method is a handler for an event.
METHODS handler FOR EVENT evt OF {class|interf}
IMPORTING ... ei ...[sender].
USE-This link is created when a processing screen or a selection screen is used in conjuncton with an ABAP program.This information is extracted from the SAP system.
-This link is created when a SAP transaction calls an ABAP program.This information is extracted from the SAP system.
-This link is created when an ABAP component calls a screen.This information is extracted from the SAP system.
-This link is created when a processing screen or a selection screen is used in conjuncton with an ABAP program.This information is extracted from the SAP system.
SELECTThis link is used when a code block contains an SQL request with a select statement (in the case of embedded SQL or native SQL).
Report abapReport
Select col from table
UPDATEThis link is used when a code block contains an SQL request with an update statement (in the case of embedded SQL or native SQL).
Report abapReport.
Update table set col=’a’
DELETEThis link is used when a code block contains an SQL request with a delete statement (in the case of embedded SQL or native SQL).
Report abapReport
Delete from table
INSERTThis link is used when a code block contains an SQL request with an insert (in the case of embedded SQL or native SQL).
Report abapReport
Insert into table values vals

Quality Rules that support SAP recommendations for HANA

SAP HANA is the "in-memory" DBMS from SAP. This technology increases application performance significantly and is strongly promoted by SAP.

However, even if existing ABAP custom code and Open SQL queries will continue to function once moved to a SAP HANA system, SAP recommends that users respect specific guidelines to avoid impacting system performance and to avoid unexpected behavior in the application logic.

The respect of these recommendations can be controlled with a dedicated set of Quality Rules. Some of the existing AIP Quality Rules match, fully or partially, the SAP recommendations or other HANA-related topics. The value they provide can be used by AIP users to study migration to HANA and to check the custom code once this one has been moved. Additional Quality Rules will be proposed in future AIP releases.

Already matching Quality Rules

The following Quality Rules provide value (through a full or a partial support) related to some of the recommendations done by SAP regarding the custom code moved or to be moved to SAP HANA systems. 

SAP Recommendation
AIP Quality Rule
Minimize the amount of transferred data7530: Avoid "SELECT *" or "SELECT SINGLE *" queries
 7878: Avoid Open SQL SELECT queries without WHERE condition
 7542: Avoid using FOR ALL ENTRIES IN without emptiness check
 7664: Avoid using FOR ALL ENTRIES IN without emptiness check on XXL Tables
Minimize the number of data transfers7572-7584: Avoid accessing multiple times the same SAP Table or View (Insert, Update, Delete)
 7544: Avoid using SELECT ... ENDSELECT statement
 7666: Avoid using SELECT ... ENDSELECT statement on XXL Tables
 7532: Avoid nested SELECT ... ENDSELECT statements
 7868: Avoid Open SQL queries in loops
 7866: Avoid SELECT ... BYPASSING BUFFER
 7876: Avoid using SELECT ... FOR UPDATE
Keep the result sets small7820: Never use SQL queries with a cartesian product

Other topics related to HANA are supported by existing Quality Rules:

Topic
AIP Quality Rule
Possible SQL compatibility issue7882: Avoid using Native SQL
Possible impact on application logic7536: Avoid using AT Events in combination of LOOP AT ... WHERE constructs

Notes

The following section lists technical and functional aspects with regard to analysis of SAP / ABAP source code:

Syntax support

The following syntax (which is permitted in ABAP source code) is now supported in CAST AIP 8.2.3 and future 8.2.x releases):

  • "ENVIRONMENT TIME FORMAT" or "ENVIRONMENT FORMAT" (options for WRITE statements)
  • "EXEC SQL" with comments between EXEC and SQL
  • ~ character now supported in SORT clauses
  • Preprocessing when ":" is inside parentheses
  • A full expression in the FROM clause is now supported
  • When an integer is present in a FROM clause
  • When a macro is called with another macro name as a parameter
  • RISK
  • CONNECTION
  • CLASS RANDOM DEFINITION

Generic transaction support

The ABAP analyzer supports the following generic transactions and creates links from the initial transaction to the object that is passed to the generic transaction via a parameter:

  • START_REPORT which allows programs to be run from custom transactions via parameters
  • SE16

ABAP files ignored during an analysis

Any files that have CP or CT at the end of their name will be ignored during an analysis, for example:

  • *CP.abap
  • *CT.abap

SQL ABAP Metrics

Metrics are only calculated on Open SQL. No metrics are calculated on ABAP Native SQL. However, ABAP Native SQL is detected for quality purposes.

Quality Rule limitations

7526 - Avoid using Harcoded paths

The Quality Rule "7256 - Avoid hardcoded paths" will return false positive violations when a custom ABAP object (surrounded by single quote marks) is contained in a custom ABAP namespace, for example: ‘names/a_namespace/a_name’. This is a known limitation of CAST AIP and the recommendation is to exclude these violations from the next snapshot. Note that when single quote marks are not used to surround the custom ABAP object, no false violation will be reported.

Empty or syntactically erroneous files

  • Even if a "Program" or "Include" is empty, i.e. it does not contain any code, a corresponding object is still created in the CAST Analysis Service.
  • If the analysis of a file yields a syntax error, an object of type "Include" is created in the CAST Analysis Service. The object's name is the filename without extension. This object has no children as the analysis of the file's contents failed due to the syntax error.

Line count of comments inside macros

If an object calls a macro and the called macro contains comments, as expected, the macro's comments are not counted as comments of its calling object. However, if a macro contains a literal string and there is a comment inside the literal string, the comment inside the string is not removed before the macro is expanded in the object calling the macro. This comment is counted as many times as the macro is called by the object. Example of a macro with a string containing a comment:

DEFINE MyMacro.
   	MyString = 'Start of string
	* any comment
	End of string'.
END-OF-DEFINITION.

Dynamic references

Dynamic references based on variables are not resolved by the analyzer  - a link to an object named UNRESOLVED is created instead. A dynamic reference is a reference to an object whose name does not appear statically in the code but is the value of a variable. In this case, the variable name is placed between parentheses. Example: Select * from (varTable) where varTable is the name of a variable containing a table name. Such dynamic references often involve SAP tables and functions.

Unreachable code

In a program, the lines of code which are not attached to a sub-object and which are located after the first sub-object, are treated as unreachable. The lines of code are counted in the new artifact but they are not attached to it. Note that lines of code not attached to a sub-object and which are located before the first sub-object ARE taken into account by the ABAP analyzer via the creation of an ABAP File Level Code sub-object.

  • No labels