abapDOC – Free Documentation Generator for ABAP Repository Objects


When it comes to me I prefer “Working software over comprehensive documentation” (Agile Manifesto). Writing documentation is time-consuming. Its value is also disputable and usually decreases over time if it’s not updated regularly and with care. After all the code/system is always the ultimate source of truth for me. I don’t know about you but I’d rather spent time refactoring my code, making it more readable, than writing documentation for it.

…but wait a minute…what if we had a tool to create documentation automatically from the SAP system? Wouldn’t that be great? What a time-saver! Alright, you convinced me…

abapDOC by indevo is a free tool that generates documentation (currently in HTML format) for ABAP repository workbench objects. The generated documentation resembles JavaDocs for Java 14 (screenshot above) . A sample documentation created with the tool can be seen here.

Installation


The program is delivered as an abapGit project. Please install abapGit into your system and follow the documentation to import the project. You can import abapDOC as an offline repository (Download below) or as online repository from GitHub abapDOC project.

DETAILS

Language
ABAP, XSLT, HTML, CSS

Tested with
SAP ABAP 7.02

License
MIT

License


The tool is free (also for commercial use) and distributed with the standard MIT license.

The following text should also be displayed in all generated files:

Generated with abapDOC by indevo

Please contact us if you’d like to modify the tool beyond the license.

User Guide


Selection Screen

Dictionary Objects

Dictionary Type – enter Data Element, Domain, Structure or Table

Type Group – currently not supported (future use)

Complex Objects

Program – currently not supported (future use)

Function Group – all function modules will be included

Package – the program will create documentation for all objects of the package (only supported types).

Class/Interface – all methods, attributes and events are documented

Objects from Tr. Request

Request/Task – all objects of the request will be included (only supported types)

Options

Custom Transformation (HTML) – enter the name of a custom XSLT transformation (the default transformation ZID_OBJECTS_2_HTML is used if the field is empty)

Create package index – creates an index (index.html) in package directory. The index contains all objects included in the package for which documentation was generated

Save XML files for objects – the option is useful for developers creating/modifying XSLT stylesheets

Show not supported objects – normally, the log displays only the objects for which documentation was generated (see the list of supported Object Types below). If you’d like to see objects that were skipped, select this option.

Usage

Start the tool by calling transaction ZID_ABAP_DOC (or executing report ZID_ABAP_DOC from SE38/SE80).

Enter the criteria for the repository objects to be selected and Execute (F8).

You can generate documentation for a single object (Class/Interface, Data Element, Table) or a Package (as in the screenshot below).

In the “Browse for Files or Folders” dialog select the Directory for the documentation and confirm with “OK” button.

The program will generate the documentation in the selected folder and display the processing log:

The generated documentation files are grouped by packages (each package is a separate folder).

Go to any package (sub-folder) and open index.html  (Package Summary) or a file generated for specific object.

Customization and Contribution


The tool was developed using ABAP, XSLT Transformations, CSS and HTML. In its current state, the solution meets the requirements of our customers, so it’s rather unlikely that we’ll be extending/updating it on a regular basis (sorry…)

We are well aware that much still can be improved:

  • add more Object Types
  • incorporate ABAP Doc comments and standard documentation
  • add different output formats (e.g. DOCX)
  • generate auto-references to other types (cross-links)
  • add different styles
  • etc. etc….

If you like the tool, but it doesn’t match your needs you simply have two ways forward: extend it yourself or contact us to prepare a customized version just for you (as a paid service).

You’re free to modify and extend the tool to fulfill your specific requirement as long as you comply with the License (see above).

In particular:

License cannot be removed and shall be included in all copies or substantial portions of the Software

All generated files should display the following text: Generated with abapDOC by indevo

Contribution

If you amended the tool and want to share your updates with the community don’t be shy and drop us an email

Design Overview


The solution consists of the following objects:

  • Report ZID_ABAP_DOC – the main program (currently the only one). It’s based on Two-Step-View approach. First Objects are selected from the Repository. Each objects is transformed to XML (method TO_XML in LCL_OBJECT_* classes). Next documentation in XML format is generated by class LCL_ABAP_DOC for objects (it includes one or several Objects). Finally XSLT Transformation for each documentation unit is called to produce HTML files, which are downloaded locally.
  • XSLT Transformation ZID_OBJECTS_2_HTML – converts documentation in XML format to a user-friendly HTML format
  • CSS abapdoc-j.css – stylesheet which resembles Java documentation, stored in MIME Repository (SE80) in folder SAP/PUBLIC/CSS. The file is always attached to the generated documentation.

List of supported Object Types:

CLAS – Class (ABAP Objects)
DOMA – Domain
DTEL – Data Element
FUGR – Function Group
INTF – Interface
TABL – Table

Change Log


04-June-2020, Release 1.0.1

  • Added new parameters to the selection screen: Custom XSLT Transformation, option to update package index

26-May-2020, Release 1.0

  • Initial version generating HTML documentation

Not exactly what you need?

Would you prefer a customized version of the tool? We are ready to help.
Get in touch and ask for an offer.