Tuesday 4 April 2017

Searching the ABAP Keyword Documentation

The ABAP Keyword Documentation is what appears when you hit F1 on ABAP statements in the ABAP Editor in SAP GUI (SE80, SE38, SE24, …) or in ADT. Hitting F1 triggers a search. The ABAP Keyword Documentation framework analyzes the context of the current cursor position and tries to find the most appropriate document(s). That works rather good for ABAP keywords. It is a bit less reliable in expressions.

The basis of the search is an index table that is generated from keywords attached to the documentation topics. E.g., if you use F1 on DO, there is an entry like “DO, ABAP Statement” in that table and the context sensitive search will recognize that the cursor is placed on the first word of the statement and will directly call the respective document.

If you are not content with the search result (e.g. for an expression) or you want to search further, you can enter search items in an input field of the documentation display.

SAP GUI:

SAP ABAP Tutorials and Materials, SAP ABAP Guide, SAP ABAP Certifications

Note the two buttons. The second allows to switch to a full text search or a search in the source codes of the example library. A full text search can also be achieved by using double quotes in the input field.

Eclipse:

SAP ABAP Tutorials and Materials, SAP ABAP Guide, SAP ABAP Certifications

Here, the full text search can be invoked by using double quotes in the input field only.

As long as no full text search is invoked, the search then analyzes
  • The above mentioned keyword index
  • A subject list (a database table that maps subjects to documents, as e.g., “ABAP Dictionary”, “CDS”, “ABAP Objects”, …)
  • The headers of the ABAP Example Library
  • The ABAP Glossary (a list of ABAP terms with declarations)

A search result accordingly can look as follows (here in ADT):

SAP ABAP Tutorials and Materials, SAP ABAP Guide, SAP ABAP Certifications

In SAP GUI, you can additionally search the ABAP Keyword Documentation by calling transaction ABAPHELP or select the blue i-Button in the ABAP Editor. Furthermore, the web version of the ABAP Keyword Documentation (used by ADT internally) that can be called with program ABAP_DOCU_WEB_VERSION also offers an input field.

What about the portal version?


And since those are only HTML files, there is no ABAP-based search behind. And that’s why there in no input field for search terms in that version. One might think about doing something in JS but that will take its time (any recommendations are welcome).

But for the time being there is a workaround. The above mentioned search resources
  • keyword index
  • subject list
  • example list
  • glossary

are all available as HTML files (the HTML is generated from the search resources). These are shown in all versions of the ABAP Keyword Documentation and especially also in the portal version:

SAP ABAP Tutorials and Materials, SAP ABAP Guide, SAP ABAP Certifications

You can use these files for searching. E.g., if you want to search the documentation for a keyword, say “UNION”, open the ABAP Index, use your Browser’s Ctrl+F and find all respective keywords:

SAP ABAP Tutorials and Materials, SAP ABAP Guide, SAP ABAP Certifications

No comments:

Post a Comment