ABAP程式碼靜態分析工具SQF - Support Query Framework

i042416發表於2020-07-08

如果系統裡沒有SQF這個tcode,可以參考note 1814328: SQF: Plug-In for Source Code Scans進行安裝。

ABAP static analysis tool SQF is a static code analysis tool developed in package SUPPORT_QUERY_FRAMEWORK in software component SAP_BASIS.

It contains lots of handy tool or short cut to other system utility tools. The most attractive function which is worthy to put it into my toolset is the static code analysis.

  1. use tcode SQF, double click on “Source code Analysis”

ABAP程式碼靜態分析工具SQF - Support Query Framework


  1. Maintain the ABAP object which you would like to do static analysis.

In this example it is function module CRM_PRODUCT_GETLIST2. Specify the object type as well, which could be found in table TADIR. The Analysis Depth 6 means: for example in the implementation of the FM, it calls another FM or subroutine, these delegated calls will also be analyzed by the tool. Say FM calls A and A calls B, B calls C, C calls D, D calls E, E calls F and F calls G, depth = 6 means any further calls starting from F calls G will be ignored.

ABAP程式碼靜態分析工具SQF - Support Query Framework

  1. Click save button and it is automatically navigated back to SQF main view. Click F8 to execute.

ABAP程式碼靜態分析工具SQF - Support Query Framework

The progress will be displayed in the bottom, the bigger size of depth specified, the more time the analysis will take.

ABAP程式碼靜態分析工具SQF - Support Query Framework

After execution, the color of icon changes from white to blue, which means the analysis result is available.

ABAP程式碼靜態分析工具SQF - Support Query Framework

  1. The analysis results are categorized into four groups:

a. Call hierarchy, something like the one in SAT.

ABAP程式碼靜態分析工具SQF - Support Query Framework

b. the table read access in static call. Those table read access done via dynamic coding will be listed in group d.

ABAP程式碼靜態分析工具SQF - Support Query Framework

Compare with DB access list analyzed by runtime trace SAT, there are far more entries than the static one. This is not surprising, as in CRM product, the set type access is implemented in a highly dynamic way.

ABAP程式碼靜態分析工具SQF - Support Query Framework

c. interface call:

ABAP程式碼靜態分析工具SQF - Support Query Framework

d. Dynamic coding

ABAP程式碼靜態分析工具SQF - Support Query Framework

要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":

ABAP程式碼靜態分析工具SQF - Support Query Framework


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2703102/,如需轉載,請註明出處,否則將追究法律責任。

相關文章