Algorithms in ABAP

Theorists and experts like to discuss the question of whether ABAP® is a ‘full-fledged’ programming language.

I would answer yes to this question.

The only thing that is syntactically missing in ABAP® is a construct that is essential for almost all standard algorithms in computer science (e.g. Dijkstra, Stable Marriage, Knuth-Morris-Pratt, Bellman-Ford): the array.

So the question arises as to how one can translate the classic algorithms of computer science into ABAP.

I haven’t found any examples of this in either the literature or the Internet (hints are welcome!), So I started the project of writing these algorithms in ABAP myself.

I chose the MiniWebAS 6.20 system as the system environment. This is a complete SAP system and has a veritable test environment with the well-known flight data model.

MiniWebAS 6.20 is free of charge, e.g. B. available as a supplement to some Galileo Press books.

Dijkstra’s algorithm
The Dijkstra algorithm is the most practical method for calculating the shortest or cheapest complex connections between two goals. This is based on a table of individual connections, the so-called adjacency matrix.

I implemented the algorithm in ABAP in the flight data model.

The individual connections correspond exactly to the individual flights that are stored in tables SPFLI and SFLIGHT. Complex connections are all transfer connections (e.g. Berlin-Tokyo via Frankfurt), whereby either the price or the route can be optimized. The program simply finds the shortest or cheapest flight connections between two cities.

This leads to an ABAP example program (runs under MiniWAS 6.20 if this data element is created with this search help).

Um unsere Seite fortlaufend für Sie zu verbessern, verwende wir Cookies. weitere Informationen

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close