The unknown side of eclipse – ABAP programming language development tool in the field of enterprise management software

Time:2022-5-26

For Java practitioners, both novices and experts who have just started must be using or have used eclipse, which is an excellent IDE for writing Java programs

However, most Java developers may not realize that eclipse can also be used to develop another programming language famous in the field of enterprise management software development, which is ABAP

In March 2022, the latestTiobe programming language rankingIn, python, C and Java ranked in the top three, while ABAP ranked 42nd.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

The two languages before ABAP are PowerShell and typescript, which are also from powerful Microsoft

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

ABAP, the programming language, is the development language used by SAP, the enterprise management software giant and the largest software company in Germany. Its flagship product s / 4hana and R / 3, which used to be synonymous with ERP software, are developed based on ABAP.

At the beginning of the founding of SAP company, the writing tool of ABAP program is SAP GUI, an IDE with simple interface, as shown in the figure below:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

At first glance, the page layout design of sapgui IDE is a bit like the current visual studio code, but sapgui was born in 1992, which can be said to be the predecessor of visual studio code.

So why does SAP choose to transform eclipse into another development tool of ABAP after having sapgui? This is the content of this paper.

Based on the eclipse framework, sap has developed a series of plug-ins for ABAP development. This modified eclipse has a new name: ABAP development tools for SAP NetWeaver, which is often abbreviated as ADT in SAP official documents For the convenience of Java programmers, eclipse mentioned in the rest of this article, unless otherwise specified, represents ADT

The following figure shows the version number of the eclipse that pops up after clicking help – > about in ADT.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

The rest of this article introduces why eclipse (ADT) after SAP transformation can become a sharp tool for ABAP application development in the field of enterprise management software from the following aspects.

1. Working principle of ADT

After many Java developers from eclipse switch to ADT, the biggest problem is that ADT can’t be used offline. Even with the SDK in the Neo programming environment of SAP cloud platform, developers can publish it to sap cloud platform by using the command line or eclipse run as menu after completing the development locally. However, this usage does not work for ADT, because the latter is still the client side in a client / server mode. In essence, when developing ABAP, the difference between eclipse and SAP GUI is only reflected in the display and operation of development resources on NetWeaver server.

Because of this C / S architecture, every time we operate ABAP resources on NetWeaver in ADT, such as editing and saving an ABAP class, we actually complete it by consuming the restful API exposed in the ABAP background.

The consumption behavior of this restful API can be observed by opening the ABAP communication log view in ADT. Click the start logging button:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

Make some arbitrary changes in the source code, such as adding an empty line. It can be observed that this modification triggered many HTTP requests to the ABAP background:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

If you want to debug the specific implementation of these background operations, log in to the ABAP background with SAP GUI and use the transaction code SiCf to find the node / SAP / BC / ADT:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

Handle the method handle of the class at the node_ Set breakpoints in request to debug:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

After the HTTP request is sent to the background, the above method will call a unified entry function SADT_ REST_ RFC_ Endpoint, the interaction between this function and other processing logic of ADT background framework is shown in the following figure:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

Syntax checking of ABAP source code in ADT is actually to make a Base64 code of the whole code, and then send it to the background through HTTP post. The background will execute the corresponding check function, and the result will be returned to the ADT front end through HTTP response.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

Accordingly, if you are interested in ADT’s foreground java code, please move to the plugins folder under the ADT installation directory, decompile the jar package inside and read the source code.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

2. Relationship between sap GUI and ADT

In a word: the two complement each other.
On the one hand, for the development of many new functions of S / 4hana, such as CDs view and AMDP (ABAP managed database procedure), developers have no choice but to use ADT, because SAP GUI does not support the development of these new functions.

For example, even if you want to browse the content of CDs view in SAP GUI, you will receive a prompt:
Please use the ADT Tools in Eclipse to process DDL sources.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

AMDP is a special ABAP class, which can execute Hana sqlscript or stored procedure in ABAP method.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

You can view the source code of AMDP in SAP GUI, but you can’t develop it. When trying to edit in SAP GUI, you will encounter the above prompt message:

Class XX contains stored procedures which cannot be changed in SAP GUI

On the contrary, ADT does not support some traditional development in SAP GUI. Give some examples.
For screen development of traditional dynpro program, double-click screen number to open screen painter by clicking layout button, and then develop WYSIWYG screen layout:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

However, what happens if you try to edit this screen in ADT?

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

ADT will open a new tab, which will display an embedded SAP GUI window. For example, screen painter and other traditional ABAP development are carried out in this embedded SAP GUI.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

ABAP consultants who use SAP GUI for development should understand the differences between these three sessions:

  • User Session
  • ABAP Session
  • Internal Session

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

Every time we log in to a system with SAP GUI, a new user session will be generated. If / O is used to open a new transaction code in each user session, a new ABAP session will be opened in the user session

A user session can open up to 6 ABAP sessions by default. The maximum number can be expanded to 16 by modifying system parameters.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

So what is the type of session started behind the tab embedded with SAP GUI window opened in ADT? The answer is user session

The following figure shows the two tags opened in ADT and their corresponding two user sessions, which are distinguished by different colors.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

3. Some unique features of ADT compared with SAP GUI

Since it is an IDE based on eclipse, ADT still has some unique features compared with SAP GUI.

First, ADT is based on eclipse, a more modern ide than SAP GUI, which is closer to Java / C + + programmers in terms of usage habits.

Taking ABAP class as an example, the information of each dimension can be displayed simultaneously in one screen in ADT, and the information dimension displayed on one screen in SAP GUI is very single.

If you want to view other dimension information, you can only jump by double clicking. After viewing, you can return to the working interface by pressing the back button.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

For another example, st22 information of all systems added with attention can be monitored in one place:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

Second, ADT provides many code refactoring assistants. Java and C + + developers will not be unfamiliar with the refactoring functions of these classes.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

Some common code refactoring functions are as follows:

  • Delete unused variables:
    Quickly delete all defined but unused local variables in a method. This function is very practical and is not supported by SAP GUI.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

  • Extract methods: if a piece of code appears repeatedly, you can consider extracting it with the method in refactoring technology and encapsulating it into a method.

Of course, developers who are still using SAP GUI can also use ABAP reconstruction wizard. The entry is slightly different according to different versions of SAP GUI.
In SAP GUI 740, the refactoring wizard is accessed through the Utilities menu.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

In versions prior to 740, the refactoring wizard was opened in much the same way:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

Third, native support for some common functions of SAP GUI.

The so-called native support refers to using eclipse native pages to provide functions previously implemented in SAP GUI.
For ABAP development consultants, the operation that needs to be performed in SAP GUI almost every day is the debugging of ABAP classes and reports.

Some friends who used to be engaged in java development always felt uncomfortable when they first started using the debugger of SAP GUI after turning to sap GUI. Once you use the ADT debugger, the familiar flavor comes back. Debugging ABAP in ADT is exactly the same as debugging Java programs in eclipse.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

Unit test and branch / statement execution coverage in SAP GUI:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

ADT also provides native support for unit testing and various coverage reviews:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

Transaction code in SAP GUI and native support of sat in ADT:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

The usage method is no different from that in SAP GUI.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

Fourth, convenient SQL console function.

In the past, in SAP GUI, sometimes for testing purposes, if you want to write some simple SQL language for verification, you have to create a report and then write it in the report. In ADT, you can directly use SQL console to save unnecessary report creation:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software
The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

Fifth, the improved code version comparison function.

Some friends reported that the code comparison tool in SAP GUI is not very easy to use:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

Now in ADT, ABAP developers can finally enjoy the convenient code version comparison function provided by eclipse like Java programmers:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

4. Other small functions of ADT worth mentioning

  • ADT Link

For example, any resource that can be viewed in ADT has a so-called ADT link, which can be viewed through the menu share link:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

This link format is as follows:
adt://AG3/sap/bc/adt/vit/wb/object_type/tabldt/object_name/ZORDER
Through the open ADT link menu, entering the above ADT link can directly open the corresponding resources, instead of running the correct transaction code like SAP GUI, and then opening the resources after entering the transaction code.

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

  • Customize editor colors

How can you make your ide different from other programs? One way is to personalize the font and background color. For example, the font must use the program specific constant width open source font inconsolata:

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

The color personalization of SAP GUI is a little troublesome and needs to be set manually one by one. Because ADT is based on eclipse, it is much easier to personalize the theme. If you think the following dark theme is not cool enough,

The unknown side of eclipse - ABAP programming language development tool in the field of enterprise management software

By installing a plug-in called eclipse color theme, you can use dozens of preset themes of this plug-in to really change one theme every 54 weeks a year.

summary

As an old programmer with 14 years of ABAP development experience, in the author’s mind, SAP GUI and eclipse are excellent ABAP ides, each with its advantages and suitable occasions. By making a horizontal comparison of the development features provided by SAP GUI and ADT one by one, this paper hopes to help developers perceive the development direction of the integrated development environment itself, which continues to evolve with the development of the times, improve and continuously improve the use experience of developers.

I wish every ABAP developer can happily use SAP GUI and ADT and be handy. Thanks for reading.