3.2 ABAP Workbench Overview
As an ABAP developer, you’ll use the ABAP Workbench tools to work with various development objects, such as programs, functions, classes, tables, and so on. In this section, we’ll explore some of the important ABAP Workbench tools that you’ll use to develop ABAP programs. We’ll explore other ABAP Workbench tools as we progress through this book.
ABAP Workbench tools are integrated with development objects, and the ABAP Workbench provides forward navigation support to move between objects. For example, if you’re editing the program code in the ABAP Editor and come across a statement in which a function module is called, simply double-clicking the function module name will open the function module in the Function Builder tool.
Because you use different ABAP Workbench tools to design and develop various objects in an ABAP application, instead of juggling between ABAP Workbench tools in different screens, SAP provides an application called Object Navigator (Transaction SE80).
Object Navigator organizes all the development objects in a tree-like hierarchy, which makes it easy to edit the application’s different objects. We’ll look more closely at the structure of the Object Navigator screen in Section 3.2.7.
Let’s explore the ABAP Workbench tools and see how they’re integrated into the Object Navigator to provide an IDE.
3.2.1 ABAP Editor
One of the main components of ABAP Workbench is ABAP Editor, in which you write and edit ABAP code. The main transaction to open ABAP Editor is Transaction SE38, but the editor also is integrated into other ABAP Workbench tools, like Class Builder, Function Builder, and Screen Painter.
In ABAP Editor, you can choose one of three different modes:
-
Front-End Editor (New) (source code mode)
The new front-end editor is a universal programming tool optimized for ABAP since the release SAP NetWeaver 7.0 and is available with SAP GUI for Windows 6.40 patch level 10 or higher. It is fully integrated with the SAP environment and provides various features beyond those in the old editor, such as code completion, code templates, changing the color of ABAP keywords and the background color, auto-filling parameter interfaces for procedures, and so on. -
Front-End Editor (Old) (plain text mode)
The old front-end editor works in plain text mode and provides a basic feature set. When using this mode, the source code is loaded into the frontend and edited locally. Since the source code is edited locally, all the functions that do not require interaction with backend are performed faster. This editor is available in SAP GUI for Windows and SAP GUI for Java. -
Back-End Editor (line-based mode)
The back-end editor works in a line-based mode in which only one line at a time is edited. Even though this editor is not very user-friendly, it can be used in any operating system environment (unlike the front-end editor).
You can select a mode by following the menu path Utilities • Settings from any ABAP Workbench tool to open the User-Specific Settings dialog box (see Figure 3.7).
On this screen, select the ABAP Editor tab and then the Editor tab. Under the Editor tab, select the radio button for your preferred editor.
We recommend using the new front-end editor; it offers many powerful features for writing and editing ABAP code, such as syntax highlighting, code hints, and auto-completion. Figure 3.8 highlights some of the features of the new editor that are not available in other editor modes.
As shown in Figure 3.8, the new front-end editor supports bookmarking for fast navigation, highlights the changes to the source code when editing, provides code hints and auto-completion of language elements and structures, and displays element blocks that easily can be expanded or collapsed for legibility.
You can also quickly set a breakpoint by double-clicking the margin line. From within the settings, you can create user-defined source code templates to speed up the development process and avoid manually writing repetitive code.
3.2.2 Function Builder
Function modules are reusable software blocks that can be called from ABAP programs. The Function Builder is the ABAP Workbench tool that allows you to create and maintain function modules globally in the system. These function modules can be called by any ABAP program or remotely by external programs.
Function modules are called in ABAP programs or called remotely by external programs and never executed by the user directly. However, Function Builder provides a test environment to test the function modules without actually calling them in a program.
Function Builder also serves as a central library to search for existing function modules to use in your programs. You can also maintain documentation for each function module during development in the Function Builder, allowing other developers to understand the functionality and parameter interface of the function module when they use the module in their own programs.
Access Function Builder via Transaction SE37 or from the Repository Browser (Transaction SE80). Figure 3.9 shows Function Builder.
We’ll explain Function Builder in more detail and you’ll use it to develop function modules in Chapter 7.
3.2.3 Class Builder
Similar to how Function Builder is used to create and maintain function modules, Class Builder is an ABAP Workbench tool used to create, define, change, and test global ABAP classes and interfaces. ABAP classes are procedures that implement object-oriented programming concepts (see Chapter 8).
ABAP classes can be defined locally in an ABAP program or globally in the system using the Class Builder tool. Class Builder allows you not only to define and maintain global classes but to maintain relations such as inheritance between objects, redefine methods in subclasses, and maintain attributes, methods, and events for the class. Class Builder also provides the runtime to test classes and interfaces.
Access Class Builder via Transaction SE24 or from the Repository Browser (Transaction SE80). Figure 3.10 shows Class Builder. As you can see, the Class Builder includes multiple tabs to maintain various components of the class, such as methods, attributes, interfaces, and more.
We’ll explain Class Builder in more detail and you’ll use it to implement global classes in Chapter 7.
3.2.4 Screen Painter
Screen Painter is an ABAP Workbench tool used to create screens for ABAP programs and to maintain the screen flow logic. In ABAP, three types of screen can be defined for ABAP programs: selection screens, list screens, and general screens. Selections screens and list screens are automatically generated using specific ABAP keywords. General screens are designed and maintained using Screen Painter.
Screen Painter provides a graphical layout editor mode in SAP GUI for Windows, in which various screen elements, like input fields, text fields, and dropdown list boxes, can be defined easily via drag-and-drop functionality.
For operating systems that don’t support the graphical layout editor mode (e.g., SAP GUI for Java), an alphanumerical mode is also available to work with screen elements.
As shown in Figure 3.11, Screen Painter includes three tabs:
-
Attributes
In the Attributes tab, you can adjust the screen attributes, such as the description, type of screen, and default behavior. There are three types of screens: the normal screen, the subscreen, and the modal dialog box. A normal screen is shown in the SAP GUI window, a subscreen is shown in a specific area within the normal screen window, and a modal dialog box is shown as a pop-up window. You create the required type of screen depending on your requirements under Screen Type in the Attributes tab. -
Element list/Screen Layout
Under the Elements list tab, you maintain the screen elements and the layout. You can maintain a variety of screen elements, such as input/output fields, text fields, radio buttons, checkboxes, and push buttons. You can also maintain more complex screen elements, such as tab strip controls and table controls. This tab is automatically filled with the screen element list when you design the screen using the graphical layout editor. -
Flow Logic
In the Flow Logic tab, you can maintain the flow logic of the screen. The runtime environment triggers the code in the flow logic based on the screen events. For example, a process before output (PBO) event is triggered before the screen is shown to the user, so any code that you want to execute before the screen is shown (such as disabling a field) can be handled by maintaining a PBO event in the flow logic of the screen.
The graphical layout editor is only available in SAP GUI for Windows. This editor is shown in Figure 3.12.
Graphical Layout Editor
Screen Painter’s graphical layout editor is part of SAP GUI and works only with the SAP NetWeaver Application Server 6.10 with SAP GUI release 6.10 or later. In SAP NetWeaver 4.0, it works with SAP GUI release 6.20 or later, patch 56, or release 6.40, patch 8.
3.2.5 Menu Painter
Menu Painter is an ABAP Workbench tool with which you can design user interfaces for ABAP programs. As discussed in Section 3.1.3, various screen elements—such as items in the menu bar, the standard toolbar, and the application toolbar—can be designed using Menu Painter. For example, you can define the Back, Exit, and Cancel buttons for your screen or define application-specific menu options in the menu bar and define corresponding icons in the application toolbar for quick access. These items are collectively called the GUI statuses of the screen.
Figure 3.13 shows the Menu Painter screen on which various UI elements for a screen can be maintained. You can maintain the elements for the menu bar, standard toolbar, application toolbar, and function keys that can be used as keyboard shortcuts by the user.
We’ll explore Menu Painter further when we discuss dialog programming in Chapter 12.
3.2.6 ABAP Data Dictionary
ABAP Data Dictionary (see Figure 3.14) is a tool provided by SAP to centrally create and maintain data definitions. You can use ABAP Data Dictionary to create and maintain global user-defined types, like data elements, structures, and table types that can be used in any ABAP program.
You can use ABAP Data Dictionary to create objects (tables and views) in the underlying relational database, which facilitates central description of data without redundancy.
In ABAP programs, Open SQL statements process data from the underlying relational database. Open SQL statements consist of the Data Manipulative Language (DML) part of SQL that helps perform certain actions, like reading, modifying, or updating data in database tables.
To perform certain actions, like creating or deleting database tables or creating table indexes, you use the Data Definition Language (DDL) part of SQL, which requires using Native SQL statements. However, you only use Open SQL statements in ABAP applications; it’s highly recommended not to use Native SQL statements to define database tables or perform any actions on the underlying relation database.
Instead, use ABAP Data Dictionary to create and maintain tables and views or perform any actions that would otherwise require the use of Native SQL statements. This not only helps to avoid redundancy but also helps clarify how the logical structure of the objects used in application development are mapped to the underlying relational database.
All ABAP Data Dictionary objects are globally visible in the system and maintained centrally. For example, if many programs are using a particular data element and the definition of the data element needs to be changed due to a change in business requirements, the change will be automatically reflected for all the programs using the data element. Therefore, no program needs to be manually updated, because the runtime system automatically adjusts to the changes in ABAP Data Dictionary and ensures that all the applications and tools always access current data.
The most important object types in ABAP Data Dictionary are as follows:
-
Tables
Tables are created in the underlying relational database using definitions from ABAP Data Dictionary. When a table is activated in ABAP Data Dictionary, the system uses the structure of the ABAP Data Dictionary table to create a physical table in the underlying database with the same structure as the table in ABAP Data Dictionary. -
Views
Multiple tables can be combined to create a logical view. The structure of the view is created in ABAP Data Dictionary, and the view of the database is then created using this structure. -
Data types
You can create global data types in ABAP Data Dictionary to centrally maintain the definition of data objects that use these global types. When a data type is changed in ABAP Data Dictionary, ABAP Data Dictionary automatically reflects the change in all the programs using that data type. -
Lock objects
Lock objects provide logical locking functionality in ABAP applications to prevent more than one user from accessing or manipulating the same data at the same time. When you create a lock object in ABAP Data Dictionary, ABAP Data Dictionary generates a function module that can be used in ABAP programs to implement the logical locking functionality to restrict simultaneous data access by multiple users. -
Domains
Domains are used to maintain the technical attributes (type and length) for fields. When multiple fields share the same technical attributes, you can maintain a domain centrally and assign the domain to each field that shares the same technical description.
A value range for a table or structure component can be defined by maintaining a value range in the domain when the component refers to this domain. Domains are always assigned to data elements.
3.2.7 Object Navigator
The Object Navigator provides an IDE in which all the ABAP Workbench tools can be used centrally. For example, when developing an ABAP application that requires defining screens, GUI statuses, and ABAP Data Dictionary objects, these respective tools can be opened in the Object Navigator itself without having to leave the screen to access individual tools.
The Object Navigator helps organize your development objects during development and makes it easy to edit all related objects in an application in one place.
As shown in Figure 3.15, the Object Navigator includes two main areas:
-
Navigation area
The navigation area displays all the development objects of the application. All the objects are organized into folders with a tree structure. -
Tool area
The tool area is where the development objects are opened. It automatically opens the respective ABAP Workbench tool to open the object. For example, when you create or edit a screen, the Object Navigator automatically opens the screen using Screen Painter in the tool area.
Now that you’ve seen a general overview of the objects in the ABAP Workbench, the final section in this chapter will look at the other IDE that can be used with ABAP: Eclipse.