Thursday 10 August 2017

An ABAP tool to get ABAP source codes line number

You can use this tool ( an ABAP report ) to get the line number of your ABAP source code.

How to use this tool


Just specify the criteria based on which the source code will be scanned and line number will be calculated.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Guides

Execute and it will show you detail statistics about line number and the total count. Double click on the ALV list item and you can navigate to method source code.

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Guides

How to get the source code of this tool


This tool consists of the following ABAP objects ( as also listed in above picture):
  • report ZTOOL_CODE_LINE_COUNT
  • include ZTOOL_DEV_OBJ_SELSCR1
  • class ZCL_TOOL_RS_SERVICE
  • class ZCL_TOOL_SRC_CODE_ANALYZE
  • class ZCL_TOOL_SRC_CODE_LOCATION
  • class ZCL_TOOL_SRC_CODE__ANALYSIS
  • interface ZIF_TOOL_SRC_CODE__ANALYSIS
  • table ZTOOL_METRICS_LO
You can get all their source code from this github repository. Feel free to change the source code to fulfill your own requirement.

Text Symbols:

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Guides

Selection Texts:

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Guides


Table structure

SAP ABAP Tutorials and Materials, SAP ABAP Certifications, SAP ABAP Guides

No comments:

Post a Comment