ABAP Search CDS View Tool – Version 2, also finds RAP Objects
2024-1-5 00:50:50 Author: blogs.sap.com(查看原文) 阅读量:7 收藏

The initial goal of the tool is to search hierarchically the Released Basic CDS views of Database Tables.

The goal is extended to generally search hierarchically for parent views of a data source (Database table, CDS view or DDic view). That made it possible to also search for Root CDS views which are used in RAP behavior definitions.

Also showing a list of all CDS views is now possible. Filtering can be done in the selection screen and in the IDA ALV grid.

Version 1 used SAP table DDLS_RIS_INDEX, however the table does not specify which data source is the main data source. So therefor the tool needs it’s own index database table (ZSCV_CDS_REL) containing only the main data source (on other words the sql FROM) of a CDS view. The tool is now precise and faster.

In the list search method filtering on the Main Database Table name is also possible, because it is also buffered in the Index database table of the tool (ZSCV_CDS_REL).

Start the tool

  • Transaction ZCDS_VIEW_SEARCH.

Index Table

The program uses a custom index table. So if you want new or changed custom CDS views in the results, than than you have to click the button “Delta update CDS Index Table” to update the index.

After a SAP upgrade the program ZSCV_SEARCH_INDEXER should be executed in background. See chapter “After SAP upgrade”.

Search Method

There are two Search Methods. For the Hierarchy search one child data source (Database table, CDS view or DDic view) must be entered, so that tool can search hierarchically all parent data sources (CDS views and DDic views).

The List search shows all CDS views. The selection screen can filter the list and the results in the IDA ALV grid can be filtered.

Filtering on one Main Database Table should result in the same CDS views.

Scenario: Find Basic Views of DB table

We need for Business Object Sales Order stored in database table VBAK the Basic CDS view.

By the parameters are set to find the released basic CDS views:

This result can also created by using Search Method List.

Scenario: Find all not released basic views of DB table

If you don’t find a Released Basic CDS View, than it could be that a Basic CDS View is not yet released by SAP.

Scenario: Find all related views of DB table

Scenario: Find all Basic cds views

This can be done by using the List Search Method.

  • Restart the tool.
  • Select the List Search Method.

Scenario: Find Released RAP Object for Business Object Sales Order stored in DB table VBAK

When no released RAP Root entity is found, than you can search for unreleased RAP Root entity by clearing the API State fields by pushing on button “All statuses”.

Below you see a diagram starting from CDS View I_SalesOrder to it’s main source I_SalesDocument and so on till it’s main source table VBAK.

  • [1] The most important new feature is that the tool has now it’s own CDS View index database table (ZSCV_CDS_REL) containing the relation between the CDS view and the main data source, which is retrieved from the SQL FROM. The tool was based on SAP CDS index database table DDLS_RIS_INDEX, which contains relations to all related CDS views, also the JOINs and COMPOSITIONs and ASSOCIATIONs, without indicating which data source is the main data source. Therefor this new index table is needed. On a S/4HANA 2022 Core system there are about 90.000 CDS views. Filling the index table takes about 1 hour. After that you start searching.
  • [2] The second new feature is that the main database table name is buffered in the new index table. For example the main database table of I_SalesOrder is VBAK. For all the CDS views the hierarchy search is executed to determine the main database table. It takes about 10 hours to fill all main database table names.
  1. Use ABAP Git to install the software.
  2. Download code from GitHub: https://github.com/alwinvandeput/zscv_search_cds_views
  3. Start in background task program ZSCV_SEARCH_INDEXER. Now wait for about one hour.
    • In the search program you can that the indexer is stil running.

After a SAP upgrade the program ZSCV_SEARCH_INDEXER should be executed in background with Delta update.

  • Start program ZSCV_SEARCH_INDEX_TOOLS
  • Select “Reset run statuses” and set the From date and time to time point just before the last time the indexer ran.

文章来源: https://blogs.sap.com/2024/01/04/abap-search-cds-view-tool-version-2-also-finds-rap-objects/
如有侵权请联系:admin#unsafe.sh