Professional Documents
Culture Documents
Abap Editor New
Abap Editor New
Regular Feature
Under Development
With all their new features, the latest versions of the ABAP Editor and Debugger (available with SAP GUI 6.40 patch level 10 for SAP NetWeaver 2004s) are generating quite a buzz but dont just take my word for it. Both the ABAP Editor and Debugger won first prize at the SDN Jam Session demo competition at the 2005 SAP TechEd conferences in both Vienna and Boston. To help show what the excitement is all about, this article looks at the new editing and debugging tools (see Figure 1), and highlights some timesaving features:
Automated and customizable syntax coloring, bookmarking, and collapsible code views to help better organize
Code templates, dynamic content, and auto-correct options that understand what developers are coding
For example, I admit that I didnt like the early Java development tools, as they were inherently slower than typical Windows applications. But when Eclipse arrived on the scene using Windows resources more or less natively for Java development, I instantly became enthusiastic. A cool development environment makes a big difference!
Figure 1
Some Sample Views of the New ABAP Editor and Debugger Environments
More sophisticated, state-of-the-art user interfaces, including split windows and customized screens, to compare different sections of a program and speed development and debugging
experience with Web Dynpro ABAP in conjunction with the new editor and debugger, and even allows you to share your findings in SDN forums. All the screenshots and examples in this column are taken from this demo version, so you can use this article as a reference as you explore the ABAP Editor and Debugger on your own screen.
of controls sophistication. From a technical standpoint, the new ABAP Editor, like its predecessor, relies on ActiveX controls technology. But this time, this technology knows about ABAP syntax and can better predict and support the ABAP developers actions.2 Like previous versions of the ABAP Editor, the new editor is tightly integrated into the classic Workbench tools, meaning all the familiar server-side features such as activation, global
2
To get a taste of the new ABAP Editor and Debugger for yourself, simply download the latest Sneak Preview version of the ABAP application server (based on SAP NetWeaver 2004s), available on the SAP Developer Network (SDN) at www.sdn.sap.com/irj/sdn/ downloads. This will give you some
The control implementation is independent of the ABAP syntax bindings. As a consequence, it is also used in other tools that require a different syntax, such as eCATT.
search, navigation to other tools, proper embedding into all major tools like class and function builder are still fully available. To get started with the new editor, simply switch on the Front-End Editor (New) preference setting (as shown on the left screen in Figure 2) and log on as usual to the ABAP Editor. Youll also be able to set yourself up to use the new debugger in the Workbench settings, under the Debugging tab. The New Look of the ABAP Editor Figure 3 reveals the new ABAP Editor. Compare this to earlier versions the only thing that looks familiar is the actual ABAP code! The most obvious change is all the color; automated syntax highlighting color-codes different syntactical elements. Keywords, such as DATA and CHECK, are shown in blue; string constants are green; custom code is in black; and comments are italicized and all of these can be customized, which Ill explain in the next section. There are other features that developers will welcome:
Figure 2
In the leftmost column of the editor screen, developers can insert symbols, such as breakpoints, to indicate stopping points throughout the program there was no way to display these control icons in the previous version of the editor To indicate newly added or changed code, triangles appear to the right of the corresponding line numbers where code has been edited Numbered bookmarks can be easily inserted and manipulated using a context menu to more flexibly navigate to important points within your program Figure 3
New ABAP Editor Features Include Syntax Coloring, Line Numbering, Bookmarks, and Breakpoints display, including errors and breakpoints. Other customization features include the ability to:
Customization Options The ABAP Editors color and style assignments are certainly not fixed. If
you prefer alternate colors and shading, you can customize the editor by simply clicking the customize button in the lower right corner of the main ABAP Editor window, which brings you to the Options menu. Figure 4 on the next page shows the various customization options, which include changing the color for breakpoints (in this case, setting it to dark red). Here you can also change the various types of items you can
Set auto-correction options for frequently occurring misspellings Establish rules for pretty printing, including indentation settings Format code using font, color, wordwrapping styles, etc.
Split Screens for Easier Maintenance Clicking the split bar button at the top right of the main ABAP Editor screen allows you to see two views of the same program, as shown in Figure 5. This split view helps you maintain related parts of a program within the same window for example, you can program data definitions and the affected sections of code in parallel instead of having to open a second SAP GUI window to do so. Clearer Views of Even the Most Complex Programs Another outstanding feature of the new code editor is its support for outlining syntactical structures such as CASEENDCASE and METHOD ENDMETHOD (see Figure 6). With the + and - buttons, you can easily collapse and expand the body of syntactical structures within your code, and therefore better follow the inner structure of your programs by hiding details that are currently out of scope. Features to Make Development More Efficient Code templates are a powerful means to abstract recurring syntactical patterns. With templates at hand, the system can provide hints while you enter code that a template is available. For example, if you type the keyword select, the system will automatically suggest to use the code template for select. If you simply press CTRL+ENTER, the suggested template will be inserted. (Misspellings can be corrected on the fly in the same way.) The new ABAP Editor comes with a large selection of common, predefined template patterns (such as FORM ENDFORM). But you can also define custom templates on your own, helping enforce customized programming guidelines and the like. Figure 7 shows the template editor, which is integrated within the customizing dialog in the Options menu. The template mechanisms also allow you to insert
Figure 4
Figure 5
Split View Eases Program Maintenance I could go on for quite some time about additional new editing capabilities, but lets press on to look at the features of the new ABAP Debugger. As you explore the new debugger, note that the new features of the ABAP Editor are fully integrated into the debugging tool, and vice versa. Now communication between the two tools is seamless.
dynamic fields (such as date/time) and integrate dialog input (such as the form name) to provide fully flexible templates. Additional Editing Features Other features that have been enhanced for the new ABAP Editor include:
Extended dialogs for find and replace A clipboard that holds code fragments cut during your editing session Capabilities to print and export code snippets or full programs in multiple formats (HTML, PDF, etc.) for sharing code in SDN, for example
point of view, this meant that the debugger shared its context data with the application being debugged, and vice versa.3 These limitations of the classic debugger are solved by a two-process architecture in the new ABAP Debugger, where the debugger and the debugged transaction run in cleanly separated external modes using different windows that communicate with each other. All debug controls, such as single step and continue until next breakpoint, are now done in separate windows, while the debugged transaction runs in its own window. When a debug condition is met (for example, when the program hits a breakpoint in the code), then the debugger window is ready for input and links back to the original program. The transaction window is blocked until program execution is resumed in the debugger and the next screen is displayed in the transaction window.4 This new architecture is not completely new it was first introduced in SAP Web Application Server 6.40. But with this architecture come lots of new features for the ABAP Debugger, including advanced user interface control. A More Sophisticated Look and Feel Like its classic counterpart, the new debugger explicitly comes up when you enter /h in the command field of any application. Figure 8 on the next page shows the main window of the new debugger. Note the differences. With the new debugging architecture, the brand-new ABAP Editor control is used, bringing the latest features (such as syntax highlighting) right into your debugging environment. On the right side of the screen, you see the variables display. I picked a
3
Figure 6
Collapsing and Expanding Code Sections for a Clearer View of Program Structure
Figure 7
that developers will see and benefit from immediately. In the past, debugger screens were viewed as part of the screen flow of a transaction whenever some breakpoint or watchpoint condition was met. The advantage of this approach was its speed: I have never seen a debugging environment come up that fast. While other debuggers typically appear, slowly initialize the debug environment, and load a lot of symbolic information, the classic ABAP Debugger screens displayed
immediately since the debugger was part of the ABAP runtime environment. On the other hand, the debugger was limited from a user-interface perspective. The debuggers UI control was implemented inside one work process in the kernel, meaning that the debugger and the process being debugged ran in the same internal session. For the user, this meant that the classic debugger appeared in the same SAP GUI window as the application being debugged which was often confusing. From a technical
An ABAP-based implementation was not possible, as the debugger and the debugged transaction ran in the same internal mode, causing interference between debugger and debuggee. For more details on how the new debugger works, see Introducing the next generation of ABAP debugging the New ABAP Debugger by Boris Gebhardt and Christoph Stck in the January-February 2006 issue of SAP Professional Journal (www.sappro.com).
couple of variables from the running transaction with the traditional doubleclick, but you can also easily hover over the code and a transient window pops up, immediately showing the variables value. Customization Options to Tailor Debugger Desktops to User Preferences Another major difference is the way the new debugger lets the user configure desktops to his needs and switch to
specialized desktops for certain debugging tasks. Each desktop is a collection of tools that you can easily customize. For example, if you want to control the flow of execution and display two internal tables simultaneously, you can open the tool dialog and select the appropriate tools. I selected the table tool twice; the result is shown in Figure 9. With the two internal tables displayed side by side, it is now fairly easy to find and correct errors.
Other Debugging Features The debugger offers a variety of additional tools, including a Diff tool to compare variables or internal tables in parallel and a tool to display the inner structure of objects, as well as special features including stack display, an overview of breakpoints, the capability to set watchpoints, and more. You can also transfer the actual parameter of a function module call into the test environment for function modules. A complete discussion of all the new features is certainly beyond the scope of this column. Again I invite you to test drive the 2004s download, available from SDN at www.sdn.sap.com/irj/ sdn/downloads.
Summary
Variables display
Figure 8
All the buzz around the new ABAP Editor and Debugger is well deserved. The new features and design of the ABAP Editor and Debugger better understand the syntactical elements of the language, greatly enhancing the productivity of your ABAP development teams. As always, the tools are integrated into the familiar environment of an ABAP Workbench. But unlike earlier versions, the tools are now integrated with each other the new editing environment is fully reflected in the debugging environment, and vice versa. Whats more, the tools also offer many new customization capabilities to personalize each users designtime and runtime environment. This is cool, time-saving stuff for ABAP developers!
Karl Kessler joined SAP in 1992. He is the Product Manager of the SAP NetWeaver foundation, which includes SAP NetWeaver Application Server, Web Dynpro, ABAP Workbench, and SAP NetWeaver Developer Studio, and is responsible for all rollout activities. You can reach him via email
Figure 9
at karl.kessler@sap.com.