The SAP ABAP module is simple


Anyone who takes a closer look at SAP will sooner or later come across the term SAP ABAP. It is mostly known that it is a programming language. But what are the differences to other languages? How did SAP ABAP come about, how is it used in practice and is it still relevant in the age of SAP S / 4 HANA? This article deals comprehensively and comprehensibly with these and other questions relating to SAP ABAP.

What is SAP ABAP?

SAP ABAP is SAP's in-house (proprietary) programming language. It was introduced in 1983. When written out, the abbreviation once meant "General report preparation processor", since companies were originally only able to program reports with this language. However, changes to the database table were not possible. This was followed by further developments of the language scope of ABAP, in the course of which the meaning of the name ABAP was finally changed to "Advanced Business Application Programming". This expresses that SAP ABAP is intended for the development of commercial applications. All SAP modules have been based on ABAP since 1990 and the introduction of SAP R / 3. Another important addition was ABAP Objects (ABAP OO for short), as this enabled object-oriented programming.

What can be implemented with the SAP ABAP programming language?

First, of course, SAP ABAP is used by the programmers at SAP SE to develop new applications and instructions, function modules and updates to existing program parts. We are also talking about the so-called SAP standard. Despite the wealth of variants and numerous industry solutions, the language scope of this standard is often not sufficient to completely cover the individual requirements of companies. This is where internal or external SAP programmers come into play, who use SAP ABAP to develop solutions to close this gap. The possibilities are diverse and include, in addition to the system base, all SAP modules such as finance, human resources, production, logistics, sales and purchasing. Just a few examples of the possible uses of ABAP are:

  • Development of own database tables
  • Programming of individual user interfaces
  • Development of own transactions
  • Design of reports
  • Generation of specific lists
  • Creation of new processes and instructions

What are the properties of SAP ABAP from a technical point of view?

In its syntax, SAP ABAP is similar to the programming language COBOL, which was created in the 1950s and is still in use. COBOL (Common Business Oriented Language) is clearly based on natural language and is used in particular for commercial applications. The situation is very similar in SAP ABAP. In addition, SAP ABAP is a so-called 4GL language (fourth generation language). Programming languages ​​of this type are designed to create code as quickly as possible and with a few lines of code. Furthermore, SAP ABAP is ideally suited for processing large amounts of data within commercial applications.

While elementary languages ​​place their functions in libraries, SAP ABAP takes a different approach, which is characterized as follows:

  • Database accesses are integrated into the source code via Open SQL statements.
  • SAP buffering ensures optimized performance for database access.
  • Mass data in the main memory is stored dynamically in internal tables.
  • OLTP (Online Transaction Processing) enables numerous users to access the database table at the same time.

In addition, there are essentially two interfaces for SAP ABAP:

  • Interface to other programming environments via RFC (Remote Function Call); enables functions to be called from remote systems
  • XML interface

The integration of these functions and instructions improves the speed and verifiability of programs, but the multitude of language elements also makes SAP ABAP complex.

Do SAP ABAP programs have downward compatibility?

SAP ABAP is originally a procedural programming model based on individual function modules and subroutines. As of ABAP Release 6.10, however, object-oriented commands (classes and interfaces) can also be used. This is done under the term ABAP Objects, or ABAP OO for short (details in the next section).

From the very beginning, SAP has followed the principle of downward compatibility with ABAP. That means: old instructions do not lose their validity if they are replaced by new instructions. So old instructions still exist, which over time leads to a considerable amount of language. The old elements should no longer be used, but this is definitely possible. It should also be mentioned that ABAP and ABAP OO can be used together, i.e. are interoperable. If ABAP OO is used, old SAP ABAP language elements can continue to be used (with a few exceptions).

The advantage of this approach is obvious: functions and programs developed in-house always remain functional. Existing developments do not have to be updated. When programming, however, you should make sure that you no longer use the old components, but rather that you use current and more powerful ABAP language elements. It is also possible to combine old and new components. Procedural elements can be used in object-oriented source code. The reverse is also possible (object-oriented elements in the procedural coding of ABAP). If old and new components are combined in a targeted manner, this can increase the effectiveness of the ABAP programming language.

What is ABAP Objects (ABAP OO)?

ABAP OO is an extension of SAP ABAP. It adds object-oriented concepts and elements to the programming language. The aim is to simplify application development through modularization. In simple terms: source code can be encapsulated in clear, reusable modules of instructions, which significantly reduces costs. In addition, ABAP OO can be used to abstractly predefine the structures of objects and to pass them on to subclasses. ABAP OO has been fully integrated into the SAP standard since Release 4.6. Before, it was only possible to combine function blocks of instructions into so-called function groups.

In addition to simplified programming, ABAP OO improves application performance. Unnecessary database queries are avoided. In addition, competing access to databases can be reduced.

Compared to other programming languages ​​that are based on objects, ABAP OO has some special features. A class always has two constructors - an instance constructor and a static constructor. Constructors are procedures that are used to create objects. The instance constructor is automatically executed each time objects are created and thus initializes individual instances. The static constructor, on the other hand, is only executed once before a class is accessed for the first time.

Other special features of ABAP OO are:

  • Single inheritance: Each class can only inherit structures from one superclass. However, several subclasses are possible.
  • Combination of interfaces: Several existing interfaces can be combined in a new interface.
  • Object Services Framework: Contains a persistence service, a transaction service and a query service, which simplifies the development of object-oriented applications.

How does programming with SAP ABAP work?

The creation of new programs with SAP ABAP takes place in several process steps:

  • Programming in the development environment
  • Transport of the changed objects to a test / consolidation environment
  • Test, release and transport into the production system

SAP programmers provide a development environment for writing source code in ABAP. This is called ABAP Workbench. Existing programs are shown here in the form of a tree structure - broken down according to content.

From a technical point of view, code and data types are strictly separated from one another in SAP ABAP. If globally valid tables and data types are to be defined, this is done in the so-called data dictionary. In addition to the technical program properties, documentation for data types is also stored here.

The SAP ABAP programs themselves are stored in the central SAP database table. This distinguishes ABAP from other programming languages, in which applications are often separate files. On the one hand, the code is available within the database as source code that can be displayed with the ABAP Workbench Tools. On the other hand, it also exists as a generated code in a binary representation (similar to Java bytecode).

Since SAP must be able to run at all times, the development of source code is not carried out in the production system. New programs must therefore be imported from the development environment into the subsequent systems using so-called transport requests. The time of these transports can be precisely defined. In the case of more extensive changes in particular, this often takes place at night or on days off.

ABAP in Eclipse as the successor to the Workbench

The ABAP Workbench was repeatedly criticized for its moderate ease of use. Small aids such as forward navigation, where you can jump directly to table definitions or variable declarations with a double click, did not contribute significantly to the improvement. With the new ABAP development environment "ABAP in Eclipse", however, SAP has been offering an alternative or a successor to the Workbench since 2012.

SAP ABAP in Eclipse was specially designed for agile software development. In addition to the existing ABAP Workbench functions, some new features have been added. Examples are:

  • Syntax highlighting (highlighting of syntaxes)
  • Code Completion (autocompletion of source code)
  • Refactoring (structural improvement of source texts, can also be used for renaming variables and methods)

In addition, ABAP in Eclipse can be adapted very flexibly to individual scenarios with the help of plugins. Tests for higher code quality can also be implemented. A new debugger rounds off the modern ABAP development environment in Eclipse.

SAP ABAP and security

As in any application, there can also be security gaps in SAP ABAP programs. These arise mainly from the ignorance and carelessness of the ABAP developers or from a lack of transparency, since the enormous amounts of code can hardly be overlooked manually.

The most common error in ABAP in-house developments is a missing or poorly programmed authorization check. This makes it possible for unauthorized employees to access certain information and misuse the data. However, vulnerabilities through which external attackers can gain control of SAP systems are even more dangerous. In this case, criminals are potentially able to manipulate, delete or steal entire SAP databases.

Several measures are required to minimize risks from missing ABAP source codes. The following aspects should be mentioned in particular:

  • Ongoing safety training for internal programmers
  • For external service providers: Include code quality standards in agreements
  • Scan of the self-developed ABAP codes for weak points (possible with special software)
  • Import security patches promptly
  • Establish contingency plans in the event of successful attacks

What role does ABAP play in SAP S / 4 HANA?

With the introduction of SAP S / 4 HANA technology, a new age has dawned for SAP software. Both the user guidance and the data models have been significantly simplified. The database is no longer located on a database server, but with the program data in the main memory of the application server. The database and application are therefore merged with one another in SAP S / 4 HANA. This has resulted in various changes for ABAP developers.

Initially, the focus shifted from command statements to a functional orientation. For performance reasons, we also recommend programming in SAP S / 4 HANA with Native SQL (formerly Open SQL). The source code has been moved from the programs to the database layer. This means that programming takes place directly on the database, which is no longer possible with the familiar SAP ABAP. Developers therefore had to learn and use SQLScript as a new programming language for SAP S / 4 HANA.

Since the introduction of SAP S / 4 HANA, however, SAP ABAP programming has been significantly simplified. In the beginning, complex data modeling (analytical views) had to be carried out for data selections. Today, the simpler ABAP CDS views are sufficient. Predefined data models ensure that developers can conveniently access related data while programming