SAP ABAP
ABAP is a proprietary programming language that was developed for programming applications in the SAP context. It is basically similar to the COBOL programming language.
What is SAP ABAP?
SAP ABAP is SAP's in-house (proprietary) programming language. It was introduced in 1983.
Written out, the abbreviation once meant "general report formatting processor", since companies could originally only program reports with the language. However, changes to the database table were not possible.
Further developments of the ABAP language scope followed, in the course of which the name meaning of ABAP was finally changed to "Advanced Business Application Programming". This expresses that SAP ABAP is intended for the development of commercial applications.
Since 1990 and the introduction of SAP R/3, all SAP modules have been based on ABAP. An important addition was also ABAP Objects (ABAP OO for short), as this enabled object-oriented programming.
Stefan Burghardt, Head of Connectivity + Development
Call or write me if you have any questions about ABAP.+41 79 533 47 16
What can be implemented with the SAP ABAP programming language?
First of all, SAP ABAP is of course used by SAP SE programmers to develop new applications and instructions, function modules and updates to existing program parts. This is also referred to as the SAP standard.
Despite the wealth of variants and numerous industry solutions, however, the language scope of this standard is often not sufficient to fully cover the individual requirements of companies. This is where internal or external SAP programmers come into play, who develop solutions using SAP ABAP to close this gap.
The possibilities are manifold and include not only the system basis but also all SAP modules such as financial accounting, 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
- Generate specific lists
- Creation of new processes and instructions
What are the technical features of SAP ABAP?
In its syntax, SAP ABAP is similar to the COBOL (Common Business Oriented Language) programming language, which was created as early as the 1950s and is still in use. COBOL is clearly based on the natural language and is used in particular for commercial applications.
SAP ABAP is very similar. 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 as few lines of code as possible (less code for the same functionality). Furthermore, SAP ABAP is ideal for processing large amounts of data within commercial applications.
While elementary languages place their functions in libraries, SAP ABAP takes a different approach, characterized as follows:
- Database accesses are integrated into the source code via Open SQL statements - access to special libraries is therefore not necessary.
- SAP buffering provides optimized performance for database access.
- Mass data in the working memory is stored dynamically in internal tables.
- OLTP (Online Transaction Processing) enables numerous users to access the database table at the same time.
There are also two main interfaces for SAP ABAP:
- Interface to other programming environments via RFC (Remote Function Call); enables calling of functions from remote systems
- XML interface
Although the integration of these functions and statements improves the speed and verifiability of programs, the large number 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. Since ABAP Release 6.10, however, object-oriented commands (classes and interfaces) can also be used. This is called 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. This means that old statements do not lose their validity when they are replaced by new statements. Old statements therefore continue to exist, resulting in a considerable amount of language over time.
Although the old elements should no longer be used, this is certainly possible. It should also be mentioned that ABAP and ABAP OO can be used together, i.e. they are interoperable. If ABAP OO is used, old SAP ABAP language elements (with a few exceptions) can therefore also continue to be used.
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, care should be taken not to use the old components, but to use current and better-performing ABAP language elements.
Furthermore, it is possible to combine old and new components. In object-oriented source code procedural elements can be used. The reverse case (object-oriented elements in procedural coding of ABAP) is also possible. 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 goal is to simplify application development through modularization.
Put simply, source code can be encapsulated in clear, reusable modules of statements, significantly reducing effort. In addition, ABAP OO allows the structures of objects to be abstractly predefined and inherited by subclasses.
ABAP OO has been fully integrated into the SAP standard since Release 4.6. Previously, it was only possible to combine function modules of statements into so-called function groups.
In addition to simplified programming, ABAP OO improves application performance. Unnecessary database queries are avoided. In addition, concurrent accesses 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 executed automatically each time objects are created and thus initializes individual instances. The static constructor, on the other hand, is executed only once before the first access to a class.
Other special features of ABAP OO are:
- Single inheritance: Each class can inherit structures from only one superclass. However, several subclasses are possible.
- Grouping of interfaces: Several existing interfaces can be grouped together in a new interface.
- Object Services Framework: Includes a Persistence Service, a Transaction Service, and a Query Service, simplifying 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 changed objects into a test/consolidation environment
- Test, release and transport into the production system
SAP provides programmers with a development environment for writing source code in ABAP. This is called ABAP Workbench. Existing programs are displayed here in the form of a tree structure - structured according to content.
From a technical point of view, code and data types are strictly separated 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, where applications are often separate files.
Within the database, the code exists on the one hand as source code that can be displayed with the ABAP Workbench tools. On the other hand, it also exists as generated code in a binary representation (similar to Java bytecode).
Since SAP must be executable at all times, source code is not developed 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 defined exactly. Especially in the case of more extensive changes, this often takes place at night or on non-working days.
ABAP in Eclipse as Successor to the Workbench
The ABAP Workbench has repeatedly been criticized for its moderate ease of use. Small help features such as forward navigation, where you can double-click to jump directly to table definitions or variable declarations, have not been able to make a significant contribution to improving the situation.
However, with the new ABAP development environment "ABAP in Eclipse", SAP has been offering an alternative or successor to the Workbench since 2012.
SAP ABAP in Eclipse was designed specifically for agile software development. In addition to existing ABAP Workbench functions, some new features have been added. Examples are:
- Syntax Highlighting (syntax highlighting)
- Code Completion (autocompletion of source code)
- Refactoring (structural improvement of source texts, also applicable for renaming variables and methods)
In addition, ABAP in Eclipse can be adapted very flexibly to individual scenarios with the help of plug-ins. 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, security gaps can also exist in SAP ABAP programs. These arise mainly from ignorance and carelessness on the part of the ABAP developers or from a lack of transparency, since the enormous amounts of code are almost impossible to keep track of 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.
Even more dangerous, however, are vulnerabilities that allow external attackers to gain control of SAP systems. In this case, criminals are potentially able to manipulate, delete or steal complete SAP data sets.
Several measures are required to minimize risks from missing ABAP source code. In particular, the following aspects should be mentioned:
- Ongoing safety training for internal programmers
- For external service providers: include code quality standards in agreements
- Scan of self-developed ABAP codes for vulnerabilities (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/4HANA technology, a new era has dawned for SAP software. Both the user interface 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. Database and application are thus merged in SAP S/4HANA. For ABAP developers, this has resulted in several changes.
First, the focus shifted from command statements to a functional orientation. Also, for performance reasons, it is recommended to program with Native SQL (formerly Open SQL) in SAP S/4HANA.
The source code was moved from the programs to the database layer. Thus, 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/4HANA.
However, since the SAP S/4HANA launch, SAP ABAP programming has been significantly simplified. Modern ABAP development is based on technologies such as Core Data Services (CDS), Business Object Processing Framework (BOPF) and OData.
Whereas, for example, complex data modeling (analytical views) was initially required for data selections, the simpler ABAP CDS views are now sufficient. Here, predefined data models ensure that developers can conveniently access related data during programming.
The SAP Business Technology Platform (BTP) ABAP Environment also makes ABAP available to developers in the cloud. Existing ABAP know-how can therefore also be used in the cloud.
It should be noted, however, that the "new" ABAP can no longer be compared with the "old" ABAP in many respects. For example, it is no longer possible to access complete artifacts in the system.
Conventional call screens and screen processing are also not on the positive list - so they are no longer available. In addition, agile development methods are becoming increasingly important. With the DevOps programming model, the ABAP environment is based on a new programming model - developments should become easier this way, as well as faster and as a higher quality of the software.
Stefan Burghardt, Head of Connectivity + Development
You have questions about the development of an individual solution? Call me or write to me!+41 79 533 47 16