Show TOC

Importing ABAP Doc Descriptions from the Class BuilderLocate this document in the navigation structure

In ABAP Development Tools (ADT), you can import descriptions of ABAP classes or ABAP interfaces (including their attributes, methods, parameters, and so on) that are entered in the form-based editor of the Class Builder. This enables you, to add, edit, or display them also in ABAP Development Tools (ADT).

Prerequisites

  • The descriptions of components for ABAP classes or ABAP interfaces are entered in the form-based Class Builder of the ABAP Workbench.
  • You can only import and synchronize in the original language.
    Recommendation In accordance with the SAP programming guidelines, you should write program comments in English. So, you should be logged on in English as your ABAP project language.
  • If ABAP Doc contains special characters such as @ “ ! < > - >, you need to replace them by its ACSCII code. Otherwise these special characters are not imported.
  • Short texts may not contain more than 60 characters.

Context

Note

You can import them only once when you edit them at the first time in ADT.

The source code editor does not overwrite existing ABAP Doc comments for class or interface components that are already documented with ABAP Doc.

Example

In the source code editor of ADT, the definition of the cl_demo_importing_description ABAP class is displayed as follows:

CLASS cl_demo_importing_description DEFINITION.
  PUBLIC
  FINAL
  CREATE PUBLIC.
   
  PUBLIC SECTION.
   
  PROTECTED SECTION.
  PRIVATE SECTION.
   DATA: myself TYPE REF TO cl_demo_importing_description.
   DATA any_string1 TYPE c.
   METHODS method_with_variable.
ENDCLASS.

In the form-based Class Builder of the ABAP Workbench, the following description is saved for the METHOD_WITH_VARIABLE method of the same class:

Example of a method description that can be reused as ABAP Doc in ADT
Figure 1: Example of a method description that can be reused as ABAP Doc in ADT

Procedure

  1. In ADT, open the context menu in the source code editor of a class or interface.
  2. Choose Start of the navigation path Source Code Next navigation step Import ABAP Doc from Descriptions End of the navigation path.

Results

The source code editor imports all descriptions of the class or interface components from the Class Builder and inserts them as ABAP Doc comments at the appropriate position in the source code editor of ADT.

If you import descriptions in SAP NetWeaver 7.5 SP00 or higher, the corresponding ABAP Doc comments are surrounded with a <p class="shorttext synchronized"> tag. This tag defines possible changes are directly synchronized in the back-end when you save the object.

Example

In the source code of the cl_demo_importing_description ABAP class, the imported descriptions of the components are added as ABAP Doc comments:

"! <p class="shorttext synchronized" lang="en">Imported class description</p>
CLASS cl_demo_importing_description DEFINITION. 
  PUBLIC  
  FINAL  
  CREATE PUBLIC. 
   
  PUBLIC SECTION. 
   
  PROTECTED SECTION. 
  PRIVATE SECTION. 
   "! <p class="shorttext synchronized" lang="en">Imported attribute description</p>
   DATA: myself TYPE REF TO cl_demo_importing_description. 
   "! <p class="shorttext synchronized" lang="en">Imported attribute description</p>
   DATA any_string1 TYPE c. 
   "! <p class="shorttext synchronized" lang="en">Imported method description from the Class Builder</p>
   METHODS method_with_variable. 
ENDCLASS.