My CDS view self study tutorial – Part 12 CDS view source code count tool
- Part1 – how to test odata service generated by CDS view
- Part2 – what objects are automatically generated after you activate one CDS view
- Part3 – how is view source in Eclipse converted to ABAP view in the backend
- Part4 – how does annotation @OData.publish work
- Part5 – how to create CDS view which supports navigation in OData service
- Part6 – consume table function in CDS view
- Part7 – unveil the secret of @ObjectModel.readOnly
- Part8 – my summary of different approaches for annotation declaration and generation
- Part9 – cube view and query view
- Part10 – How does CDS view key user extensibility work in S4/HANA
- Part11 – CDS view test double framework
- Part12 – this blog
- Part13 – CDS view authorization
For development complexity and draft effort estimation I need a tool to calculate the total line number of the CDS views belonging to a given package. Currently there is only the counting tool for ABAP source code: An ABAP tool to get ABAP source codes line number.
However no tool available for CDS view. So I write one. You can download its source code from my github.
Execute the public RUN method, specify the package number:
And it will print the line of source code for each view and the total count per package:
Two private methods of this tool class:
- GET_PACKAGE_LIST: get all subpackage belonging to current input package
- FILL_VIEW_NUMBER_PER_PACKAGE: get the view list of a given package, fetch the source code of each view from database table DDDDLSRC ( I have already explained this table in part 2 what objects are automatically generated after you activate one CDS view ) and perform the line number calculation.
If you have further requirement to parse the annotation contained in the view source code, you can refer to two demo reports shipped by SAP standard: