S4Explorer is a S/4 HANA Fiori app for exploring and analyzing S/4 HANA business content.
With S4Explorer, architects, consultants, developers and system administrators can quickly find and understand S/4 HANA objects like CDS views, table functions and OData Services. S4Explorer gives you quick and clear insights in how CDS objects are built, and visualize their interconnections
In this series of blogposts, we highlight the main features of S4Explorer.
In this first issue of the series, we focus on how to use the S4Explorer Smart Search feature to quickly locate CDS objects in the CDS Object Catalog. S4Explorer Smart Search lets you enter simple yet powerful queries to locate exactly the objects you’re interested in.
CDS Object Catalog
A little bit of background information will be helpful before we can take a closer look at the S4Explorer Smart Search feature.
S4Explorer is organized into Object Catalogs. Currently S4Explorer provides two catalogs:
- The CDS object catalog: here you can find all kinds of CDS objects, like views, table functions, and view extensions.
- The OData Service catalog: here you can find OData services.
Object catalogs are available as tab pages in the sidebar on the left of the S4Explorer window.
S4Explorer Object Catalogs provide a toolbar, a results table to show the search results, and a status bar which lists the number of matching items retrieved by the current search criteria.
If no criteria are entered, the catalog appears to return the complete list of objects. S4Explorer does not actually materialize the entire list of objects: it only retrieves a subset – enough to populate the visible portion of the results table. New results are fetched and added as needed when scrolling through the list.
In this blogpost, we will demonstratie the Smart Search feature on the CDS Object Catalog. However, Smart Search is available for all Object Catalogs.
Basic Search by Name
The Object Catalog Toolbar provides an input field for quick and basic search by object name. In case of CDS objects, this basic search functionality lets you find objects by entity name.
To start searching for particular objects, focus the search field and simply type a search term. In this example, we entered the search term
To actually initiate the search, hit “Enter” after you typed your search term. By default, S4Explorer monitors changes in the search field, and executes the query automatically when needed. In this case, the search term matched 1218 results:
After hitting Enter, the search term is processed and turned into a display element called a “Token”, which appears as a light grey box containing a few icons and the search term text:
The ellipsis or “
...” icons that are visible on both sides of the search term text indicate that S4Explorer searches for objects where the search term appears anywhere within the object name. So the ellipsis indicates the variable part of the matched items. For example, in the search results, you will find entities like
A_BusSolnOrderFUPSalesOrder and so on.
By clicking on the “decline” icon (the X that appears at the far right side of the search token) you can remove the search term. You can also remove the token by pressing the Backspace key on the keyboard. That lets you remove whatever search token appears right before the position of the cursor.
Edit and refine your search
The basic “Contains” search behavior is often sufficient. But sometimes, you need something more specific and precise.
For example, our initial example search term
Sales gave us a number of matches ending with
A_BusSolnOrdItmFUPSalesOrder. Suppose that we now want to find only those objects that end with the term “SalesOrder”.
A single click on the search token reveals the Edit Search Term popup dialog that lets you edit the search term.
Comparison Method: contains, starts with, ends with
In the popup window, we can modify the search term text, and we can also choose the comparison method. The screenshot bellow shows we changed the search term to
salesorder and chose “Ends with” as comparison method.
When we confirm the edits to the search term by clicking the apply button, the popup closes and the search token is updated. The new query is executed automatically in response to the updated search token:
As you can see in the screenshot, the ellipsis icon in the search token now only appears before the search term text. This indicates that items will be matched only if they end with the search term. The query now yields 47 results, and each indeed ends with
Multiple Search Tokens
After entering a search term, the search field maintains its focus, and the cursor is positioned immediately after the search token. This is convenient as it lets you type multiple search tokens.
When multiple search tokens are present, S4Explorer’s default behavior is to apply all search tokens in an inclusive manner (logic
OR). For example, suppose you’re interested in finding views about materials and products. You could enter the search terms
material, and this will find you all CDS objects whose name contain either “product” or “material” (or both).
Comparison Mode: include and require
For yet more advanced search capabilities you can control how multiple search terms affect the query.
We just mentioned that by default, multiple search terms are applied inclusively, meaning that items that match either of the search terms (or both!) are included in the result (logic
OR). But sometimes you want to consider only those items that contain all of the search terms.
For example, suppose we’re interested in objects whose name contains the text
SalesOrder, but which are also prefixed with a certain string.
Searching by prefix can be very useful as standard SAP objects adhere to a naming convention where the prefix conveys information about the intended use of the view. For example, the prefix
I_ indicates that this is an intermediate object, not intended for direct consumption, whereas a prefix
C_ indicates the object is likely suitable for consumption by a report or application.
Suppose we are interested in views prefixed with
C_ , which also contain the search term
SalesOrder. We can achieve this by first entering a search term for
C_ and choosing the “Starts with” comparison method:
As second search term, we would then enter
SalesOrder, using the default contains comparison method. But because we want to find objects that both start with
C_ AND contain
SalesOrder, we need to choose the “require” mode:
You might notice that the Search Token for
SalesOrder is rendered in light green hue. This indicates that this token uses the “require” mode.
This combination of search terms will now return only objects that start with
C_ and contain the search term
Comparison mode: exclude
We can take it one step further and add another search term to exclude items matching specific search terms.
For example, suppose that we want to exclude those objects that contain the text
item. We can achieve this by adding another search term to exclude it:
Note how the
item search token is rendered in a reddish hue, and the search term itself is struck out by a red line. This indicates that items that contain the text
item are excluded from the search results.
Smart Search was designed to fully support editing with only the keyboard. Once you enter a search term, the search field remains focused, so you can immediately enter another search term.
Using the arrow keys, you can navigate the search tokens, and select a particular one. The Edit Search Term popup dialog of the selected search token may be opened by pressing the spacebar. You can also remove the selected search token using only the keyboard by pressing the Backspace key.
In addition, both the Comparison method and the Search Mode can be specified directly as you enter a search term by using special operator symbols. You may have noticed this by looking at the Edit Search Term popup:
- to specify objects starting with prefix
C_, use the circumflex, like so:
- to specify objects ending with postfix
_Test, use the dollar sign, like so:
- to specify objects must match
SalesOrder, use the plus sign, like so:
- to specify objects must not match
item, use the minus sign (dash), like so:
SAP-style “asterisk” Wildcards
As bonus, S4Explorer also supports SAP-style “asterisk” wildcards.
For example, upon entering
C_*SalesOrder, two search tokens are created, one to require the results match the prefix
C_, and another to require that results match the postfix
SalesOrder. This makes it even quicker to enter multiple search tokens!
Beyond Simple Search By Name
So far, we’ve seen we can easily create quite sophisticated queries using only the name field.
But what about all the other attributes that we might want to use to locate objects? For example, suppose you want to find objects by package, or application component? Or what if you want to find only those CDS objects that are based on a particular base table?
Rest assured – S4Explorer has got this covered. However, this is a topic for another post. So stay tuned for a next edition of the S4Explorer feature highlights!
I hope this post helped you to understand S4Explorer’s Smart Search feature. If you want to learn more about S4Explorer, then consider these resources:
This article belongs to
- Roland Bouman