Deprecated: Creation of dynamic property Pusher\Log\Logger::$file is deprecated in /html/wordpress/wp-content/plugins/wppusher/Pusher/Log/Logger.php on line 18

Deprecated: Creation of dynamic property Pusher\Log\Logger::$file is deprecated in /html/wordpress/wp-content/plugins/wppusher/Pusher/Log/Logger.php on line 18

Deprecated: Creation of dynamic property Pusher\Dashboard::$pusher is deprecated in /html/wordpress/wp-content/plugins/wppusher/Pusher/Dashboard.php on line 68

Deprecated: Creation of dynamic property Pusher\Log\Logger::$file is deprecated in /html/wordpress/wp-content/plugins/wppusher/Pusher/Log/Logger.php on line 18

Deprecated: Creation of dynamic property Pusher\Log\Logger::$file is deprecated in /html/wordpress/wp-content/plugins/wppusher/Pusher/Log/Logger.php on line 18
ABAP Archives - j&s-soft

Category: ABAP

ABAP ist die Haupt-Programmiersprache bei SAP.

  • Drei Schritte zur Migrations­fähigkeit

    Drei Schritte zur Migrations­fähigkeit

    Es gibt drei verschiedene Möglichkeiten, ein S4/HANA ERP-System aufzusetzen. Ganz klassisch on Premise (auch auf einem Hyperscaler), in einer privaten Cloud (Cloud Private Edition) oder in der Public-Cloud (Cloud Public Edition).
    Im HCM-Umfeld streben die meisten Kunden eine Conversion ihres bestehenden HR-Systems auf ein on Premise H4S4-System (H4S4 = das HCM for S4/HANA) an.*
    Der folgende Text geht deshalb auf die Systemvoraussetzungen für dieses Migrationsszenario ein.

    Ihr System bleibt nach der Konvertierung erhalten, konkret heißt das, die SID (System Identification Number) Ihres ERP bleibt gleich.

    1. Voraussetzung Release

    Ihr Quellsystem muss mindestens den Release Stand SAP ERP 6.0 haben.

    Release Stand Information im SAP System finden:
    SAP Easy Access > System > Status > SAP-Systemdaten Lupe bei Produktversion > Installierte Produktversionen

    2. Ihr Quellsystem muss ein Unicode System sein

    3. Ihr ERP muss ein reines ABAP-System sein

    Ein Dual-Stack-System (SAP NetWeaver AS ABAP und AS Java) muss zuerst zu einem ABAP Single-Stack umgewandelt werden.

    Ein Beispiel über ein Single Stack System sehen Sie hier.
    Single AS Instance, d. h. kein Dual-Stack (ermittelbar über Transaktion SM51)

    Unser Beispiel System erfüllt also alle drei Voraussetzungen für eine Systemkonvertierung zu S/4HANA.
    Gut zu wissen: Eine HANA DB ist keine Voraussetzung für eine Konvertierung.

  • Modern ABAP Tools for Calculated Fields in HANA

    Modern ABAP Tools for Calculated Fields in HANA

    A significant portion of ABAP programming is selecting data from database tables and reconstructing them for specialized use cases. Information shown to the consumer of the program is temporary fields, calculated using persisted data as input. Since the development of the HANA database, SAP changed the approach to accessing and calculating data in their programs and advises developers to do so as well. Most notably, the “Code to Data” paradigm aims to move unnecessary data retrieval and calculations from the application server to the database server. Calculated fields – be it through arithmetic calculations, string manipulations or complex case expressions – can now be provided without even accessing the ABAP layer. This is still a relatively new concept to many developers, as most of the code they have written so far juggles the retrieved data in ABAP code. For maximum time efficiency, new methods must be learned, some of which I will briefly explain. This blog does not contain an introduction with examples of either method, but merely describes the function and its cases of use.

    CDS Views Core

    Data Services (CDS) is the key component of all data modeling in HANA. While widely known, some developers still treat it as a mere join on database tables, unaware that CDS is a fully-fledged SQL language, that is also relatively easy to learn. Anything previously done in Open SQL can be directly implemented in the view without the use of any ABAP. It also provides annotations a consumer can utilize. Multistep operations might require the use of several CDS views, creating a view stack that can become hard to read.

    ABAP Code

    In special cases, it might still be necessary to use ABAP code to retrieve and calculate data. In fact, some of the new HANA tools are made specifically for ABAP.
    CDS custom entities are data definitions that do not use SQL. Unlike CDS views, they have no data source but gather the data from ABAP code (which, of course, can include data sources). It requires a dedicated class that implements the query in detail, including counting and paging. Custom entities are primarily used when SQL is incapable of retrieving the requested data, for example, from a remote data source that can only be accessed by ABAP code or when the business logic is simply too complex for SQL. The finished custom entity can then be used like any other data source. It is like a temporary data view that is calculated in the ABAP code.
    In the context of RAP, CDS views can make use of virtual fields that are calculated in dedicated ABAP classes. The regular fields of the view are used as input to calculate the virtual field for each row individually. A simple example would be an adjusted price to a base price that is fetched from the database. In contrast to customs entities, they are only single fields of a view, not an entire data source.

    SQLScript Code

    For cases when CDS views are not sufficient to push down ABAP code to the HANA database, methods to directly program on it have been developed. The HANA database has its own version of SQL, SQLScript, which is considerably closer to a full programming language than ABAP SQL. Database developers that create HANA views are already familiar with this language, but the ABAP language also provides access to it.
    Special methods called ABAP-managed database procedures (AMDP) allow the use of SQLScript code. It is written on the application layer but executed on the database layer. One dedicated use of AMDPs is table functions. They fetch and calculate data on the database through SQLScript and provide the result as a temporary table. In contrast to customs entities, all of this happens on the database. It provides more capabilities than CDS and Open SQL and even allows the use of special HANA tools like machine learning libraries. If optimal performance is desired, AMDPs should be preferred over the ABAP code. Of course, it requires learning a new language, which has a lot more depth to it than other SQL languages.

  • Parallel Processing in ABAP

    Parallel Processing in ABAP

    Parallelisierung von Programmen ist typischerweise kein Problem, mit dem sich ABAP-Entwickler häufig beschäftigen müssen. In den meisten Fällen haben Datenbankzugriffe durch OpenSQL einen deutlich größeren Einfluss auf die Performance eines Reports als die Verarbeitung und Ausgabe der Daten. Nichtsdestotrotz gibt es Szenarien, in denen Parallelisierung die Verarbeitungsgeschwindigkeit dramatisch beschleunigen kann. Um die prinzipielle Funktionsweise des Parallelisierungsprozesses zu demonstrieren, habe ich mir die Visualisierung des Mandelbrot-Fraktals ausgesucht. Das Mandelbrot-Fraktal ist wahrscheinlich der bekannteste Vertreter seiner Art und ein hervorragendes Beispiel für einen parallelisierbaren Prozess. Aber zuerst müssen die Grundlagen geklärt sein: Was genau ist Parallelisierung und welche Voraussetzung muss ein Prozess haben, um von Parallelisierung profitieren zu können?

    Serielle und parallele Prozesse

    Normalerweise werden ABAP-Programme und Reports seriell verarbeitet. Das bedeutet, das Programm wird Zeile für Zeile nacheinander abgearbeitet. Ein typischer Report liest Parameter vom Selektionsbildschirm ein, selektiert entsprechende Daten von der Datenbank, verarbeitet diese und gibt sie aus. Häufig werden Loops genutzt, um die Datenverarbeitung vieler Elemente zu realisieren. Das Programm arbeitet so alle Datenbankeinträge nacheinander ab, wie in der folgenden Grafik zu sehen ist:

    Abbildung 1: Serielle Verarbeitung

    Solche Loops sind ein gutes Indiz, dass Verarbeitungsschritte parallelisiert werden können. Die Voraussetzung hierfür ist, dass die Prozessschritte unabhängig voneinander sind, das heißt, ein Durchgang des Loops ändert nicht das Ergebnis eines anderen Durchgangs. Dies kann man zum Beispiel erzwingen, indem man separate Tabellen für die gelesenen Daten der Datenbank und für die Ergebnisse nutzt und dabei eine 1:1 Zuweisung macht. Der Ablauf eines parallelisierten Reports könnte wie folgt aussehen:

    Abbildung 2: Parallele Verarbeitung

    Da die im Bild dargestellten Verarbeitungsschritte alle zeitgleich erfolgen, wird die Programmlaufzeit dramatisch kürzer. Parallel ablaufende Programmteile werden auch Threads genannt. Leider lassen sich nicht alle Prozesse gleich gut parallelisieren. Einen Programmablauf zu konzipieren, der sich parallel verarbeiten lässt ist eine Wissenschaft für sich, aber hier sind ein paar Beispiele für besser und schlechter parallelisierbare Prozesse:

    Besser ParallelisierbarSchlechter Parallelisierbar
    Für viele Personen das Gehalt berechnenFür eine Person das Gehalt und die Lohnsteuer berechnen
    Für eine Person das Gehalt und Restanzahl Urlaubstage berechnenDie Summe aller Gehälter der Mitarbeitenden berechnen

    ABAP-Threads

    Als nächstes stellt sich die Frage, wie man in ABAP-Prozesse parallelisieren kann. Die Programmiersprache an sich stellt keine einfache Syntax zur Verfügung, die parallele Abarbeitung von Programmteilen zu beschreiben. An dieser Stelle kommt das Framework ABAP-Threads ins Spiel. Es ermöglicht eine parallele Verarbeitung über einen Mechanismus, der für jeden Thread einen neuen Dialogprozess im Hintergrund startet. Das bedeutet, dass die maximale Anzahl tatsächlich gleichzeitig ablaufender Threads von der Maximalanzahl von Dialogprozessen des Systems abhängt. Wenn man zu viele Threads startet, kann es auch passieren, dass für andere Benutzer keine Dialogprozesse mehr übrigbleiben. Das sollte man im Hinterkopf behalten. Im Zweifelsfall kann man sich über die Transaktion RZ11 den Parameter rdisp/wp_no_dia ansehen. Dieser enthält die Information über die maximale Anzahl von Dialogprozessen des Systems. Die Threads nutzen immer einen Dialogprozess, auch wenn der Report im Hintergrund als Batchprozess gestartet wurde.

    ABAP-Threads lässt sich über ABAP-Git in das System einspielen. Hier ist der Link zum GitHub Repository: ABAP-Threads

    Das Programmierkonzept von ABAP-Threads basiert auf sogenannten Workern. Für jeden Thread muss ein Worker-Objekt erzeugt werden. Dieses Objekt ist die Instanz einer Worker-Klasse, in der der parallel auszuführende Programmcode implementiert ist. Die Worker Klasse erbt von der abstrakten Klasse ZCL_THREAD_RUNNER_SLUG und hat die folgenden Kernkomponenten:

    • Ein einziges Attribut (Membervariable), in der sowohl alle für die Teilaufgabe erforderlichen Parameter als auch die Ergebnisse gespeichert werden. Es stellt die Daten-Schnittstelle des Workers dar und sollte eine Struktur als Datentyp haben.
    • Die Methode CREATE, die die Workerinstanz erzeugt und die Parameter in das Attribut kopiert. (Der Constructor kann aus technischen Gründen nicht genutzt werden)
    • Die Methode GET_STATE_REF, welche die Referenz zum Attribut zurückliefert
    • Die Methode RUN, welche den parallel auszuführenden Programmcode enthält
    Abbildung 3: UML der Worker-Klasse

    Das Attribut der Worker-Klasse stellt die einzige Schnittstelle für den Datenaustausch zwischen dem Hauptprogramm und dem Worker dar. Dadurch wird auch implizit sichergestellt, dass es keine Kommunikation zwischen den Worker-Instanzen geben kann. Diese Einschränkung hilft dabei, typische Fallstricke von paralleler Programmierung, wie beispielsweise Race-Conditions oder Deadlocks, zu umgehen, allerdings bedeutet sie auch, dass die Teilergebnisse der Worker nach der Verarbeitung gegebenenfalls in eine lokale Variable des Hauptprogramms kopiert werden müssen, was etwas Overhead mit sich bringt.

    Der Programmablauf für die parallele Verarbeitung mithilfe von ABAP-Threads sieht dann typischerweise so aus wie in der Abbildung dargestellt:

    Abbildung 4: Schritte eines parallelen Programms mit ABAP-Threads

    Implementierung am Beispiel des Mandelbrot-Fraktals

    Parallelisierungsstrategie

    Um einen Prozess parallelisieren zu können, muss man eine Strategie entwickeln, ihn auf viele kleinere Teilprozesse aufzuteilen. Als erstes sollte man sich ansehen, welche Abhängigkeiten es im Prozess gibt. Beispielsweise wäre es nicht möglich, das Nettogehalt vor dem Bruttogehalt zu berechnen, da sich der Wert des Nettogehalts aus dem Bruttowert ergibt. Im Fall des Mandelbrot-Fraktals ist praktisch jeder Pixel des Bildes unabhängig von den anderen, deshalb gibt es viel Spielraum die Arbeit auf nahezu beliebig viele Worker aufzuteilen. In diesem Beispiel wird das Bild horizontal getrennt und auf die Worker aufgeteilt.

    Die Bilddaten werden über eine Hilfsklasse erzeugt, welche eine Datei im Bitmap-Format generieren kann. Dabei ist die Farbe jedes Pixels direkt steuerbar und kann im Binärformat oder als HSV (Hue, Saturation, Value) beschrieben werden. Zum Algorithmus zur Darstellung des Mandelbrot-Fraktals gibt es dutzende Quellen im Internet.

    Die Worker-Klasse

    Als Datentyp des Attributs der Worker-Klasse wurde die Struktur t_data_and_parameters definiert. Sie enthält sowohl die Parameter, welche für die Bildgenerierung notwendig sind, als auch die Bilddaten des horizontalen Ausschnitts des Bildes. Die Definition befindet sich in der public section, da sie auch außerhalb der Klasse gebraucht wird.

    Das Attribut selbst sollte dann in der private section definiert werden:

    Die Methoden CREATE und GET_STATE_REF werden nach Schema redefiniert und implementiert. In der Redefinition der Methode RUN wird der Algorithmus ausprogrammiert, der anhand der Parameter im Attribut das Teilbild erzeugt und wieder im Attribut speichert. Dabei wird durch die Pixel der Bildzeilen iteriert und die Farbe jedes Pixels über eine Mandelbrot-Helferklasse bestimmt.

    Der Report

    Nachdem die Worker-Klasse fertig implementiert wurde, kann sie in einem Report genutzt werden. Dafür werden als erstes die Worker-Instanzen über einen Loop erzeugt. Anschließend können sie über die Methode RUN_PARALLEL gestartet werden. Um später den Zugriff zu vereinfachen, werden die Referenzen auf die Worker in einer Tabelle gespeichert. Im Codeausschnitt wird die Worker-Klasse LCL_PARALLEL_RENDERER genannt.

    Jetzt muss gewartet werden, bis alle Worker fertig sind. Ein Worker hat seine Arbeit beendet, sobald er seine Methode RUN verlassen hat. Über die Methode IS_READY kann dies überprüft werden.

    Anschließend können die Teilergebnisse zu einem Gesamtbild zusammengesetzt werden. Das Ergebnis ist eine vollständige Darstellung des Mandelbrot-Fraktals, das als Bitmap im SAP-GUI angezeigt werden kann:

    Performance

    Jetzt zum Interessantesten Teil: Wie viel Mehrleistung lässt sich durch die Parallelisierung erreichen? Um das zu beantworten, wurden mehrere Benchmarks auf einem Testsystem durchgeführt. Für jede Threadanzahl wurden 5 Messungen gemacht und der Durchschnitt gebildet. Das System läuft in einer virtuellen Maschine mit 24 V-Cores. Die Anzahl der Dialogprozesse ist auf 8 beschränkt, wobei einer für den Report selbst gebraucht wird.
    Die Ergebnisse sind in den folgenden beiden Diagrammen dargestellt. Die Standardabweichung der Messwerte ist hier so vernachlässigbar klein, dass sie in der Darstellung nicht berücksichtigt wird.

    Es ist deutlich zu erkennen, dass die Verarbeitungsgeschwindigkeit durch die Parallelisierung steigt. Das Verhältnis von Threadanzahl zu Performancesteigerung ist allerding nicht linear. Das liegt daran, dass die Parallelisierungsstrategie noch Verbesserungspotential hat. Der naive Ansatz, jedem Worker gleich viele Bildzeilen zuzuteilen ist nicht optimal, da der Algorithmus für die Generierung des Bildes rekursiv ist. Bildbereiche, die die schwarzen Pixel beinhalten, haben eine deutlich höhere Berechnungsdauer als der Rest. Der Flaschenhals ist derjenige Worker, der am längsten braucht. Aus diesem Grund steigt auch die Bearbeitungsgeschwindigkeit jenseits von sieben Workern. Auch, wenn immer nur sieben Worker gleichzeitig arbeiten, können die Threads, die bereits mit ihrem Bildausschnitt fertig sind, den nächsten Teil übernehmen. Der Overhead durch die Erstellung der Worker-Instanzen und das Kopieren der Bilddaten ist in diesem Beispiel vernachlässigbar klein.

    Fazit

    Abschließend kann gesagt werden, dass Parallelisierung mithilfe von ABAP-Threads eine gute Möglichkeit darstellt, die Verarbeitungsgeschwindigkeit von Prozessen erheblich zu steigern. Der Performancegewinn steht und fällt allerdings mit der Parallelisierungsstrategie. Außerdem sollte man Kenntnisse über die Systemhardware und Konfiguration der maximalen Anzahl an Dialogprozessen haben, um Konflikten mit den anderen Benutzern des Systems zu vermeiden.

    Die Parallelisierung ist vorrangig für Offlineszenarien sinnvoll, wenn keine Last auf dem System ist. So können beispielsweise Updates oder zeitkritische Prozesse beschleunigt werden, die ansonsten möglicherweise im verfügbaren Zeitraum nicht möglich wären. Im Normalbetrieb eines Produktivsystems kann es allerdings andere Prozesse blockieren und die verfügbare Rechenleistung für andere Nutzer reduzieren, weshalb Parallelisierung hier mit Vorsicht zu genießen ist.

  • An Introduction to ABAP Based on Basics of Internal Tables (ITABs) Example

    In this section, we explain some basic uses of ITABs with an example and their results. Let’s assume, a friend is coming on a short visit to Germany, seeking to explore both vibrant places and scenic hiking trails. To meet the perfect itinerary, we have compiled the following list of ten popular places to visit in Germany that offer nearby hiking opportunities:

    StatePlaceTrail
    BrandenburgBerlinBriesetal
    BavariaSchloss NeuschwansteinAllgaeu
    Baden-WuerttembergBlack ForestBlack Forest
    HessenRuedesheimRheinsteig
    BavariaMunichPartnach Gorge
    SaxonyDresdenPainter’s Way
    BavariaNurembergGoldsteig
    Baden-WuerttembergHeidelbergAlbsteig
    North Rhine-WestphaliaCologneEifelsteig
    Rhineland-PalatinateTrierMoselsteig

    Based on this table, we are going to explore the basic uses of ITABs by answering the following questions:

    1. How can we add the values to the internal table?
    2. How can we append a new row to the ITAB?
    3. How many lines does the ITAB contain?
    4. How can we sort the ITAB?
    5. How can we read a row from the ITAB that contains a specific value?
    6. How can we delete one row from the ITAB?
    7. How can we delete duplicate rows?

    Step 0: 

    At the beginning, we defined a structure ‘place_type’ which includes three fields: state, place, and trail with respective data type. Next, the ‘itab_popularplaces’ is declared as the data type for the ITAB, which allows multiple lines and maintains the entries in the order they were inserted. Finally, the ‘popularplaces’ is the variable that represents the actual internal table, instantiated using the ‘itab_popularplaces’ data type. It will hold the data records, where each entry will follow the structure defined by ‘place_type’.

    1. How can we add the values to the internal table?

    Solution: We populate the ITAB component by component with VALUE operator.
    Here is the sample program to populate the ITAB.

    We can print the ITAB in the ABAP console using the commands:  

    The output:

    2. How can we append a new row to the ITAB?

    Suppose we have a new suggestion about a place, and we want to append the row to the ITAB.

    StatePlaceTrail
    Saxony-AnhaltMagdeburgGoethe way


    Solution: We can append a new row at the end of the ITAB with APPEND operator.  

    The output:

    3. How many lines does the ITAB contain?

    We can count the lines contain the ITAB by using following sample program:

    The output:

    4. How can we sort the ITAB?

    In ABAP, we can sort the ITABs by using SORT operator. This sorting can be done based on column and ascending-descending order. In this example, we have sorted by column ‘state’ in ascending order.

    The output:

    5. How can we read a row from the ITAB that contains a specific value?

    There are multiple ways to read any specific row from the ITAB, providing flexibility in how the data is retrieved and manipulated. In this example, we have used a loop…endloop statement to read the specific row in the ITAB that contains the place ‘Berlin’.

    The output:

    6. How can we delete one row from the ITAB?

    We can delete any row from ITAB by using DELETE operator, including specifying the row number. For example, we can delete index 11 with the following command line.  

    The output:

    7. How can we delete duplicate rows?

    In ABAP, the DELETE ADJACENT DUPLICATES statements give us the ability to remove all consecutive lines, excluding the first occurrence. Prior to utilizing these statements, it is essential to perform suitable sorting of the data. For this example, we have chosen state column and the duplicate states (e.g., Bavaria) are deleted.

    The output:

    In conclusion, ITABs are a crucial part of ABAP and particularly important to store and format data from a database table within a program. Are you ready to dive into ITABs – the essential building block of ABAP development? Keep your eyes on our beginner blog series!

    Additional information.

    For more information, see the SAP documentation:
    English: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenitab_guidl.htm 
    German: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/de-de/abenitab_guidl.htm

  • An Introduction to ABAP based on a Prime Factors Example

    The following exercises will help you understand some basic concepts in ABAP. 

     “Tell me and I forget, teach me and I may remember, involve me and I learn.”

    Benjamin Franklin

    On exercism.org you will find 40 ABAP exercises. These are common programming exercises such as Word Count, Tic-Tac-Toe, Scrabble Score and so on that you will probably come across in one way or another when learning a programming language. We recommend that you register there and start doing all these exercises to build up your knowledge of programming and ABAP.

    What our blog series Introduction to ABAP will do for you:

    • Discuss the task and the considerations you need to make to solve the exercise without having to look up a published solution.
    • Randomly show you some ABAP peculiarities that come up in each exercise, so that you understand ABAP better and better.

    Learn by example: Prime Factors

    https://exercism.org/tracks/abap/exercises/prime-factors

    1. The job.

    Work out the prime factors of a given natural number.

    A prime number is only evenly divisible by itself and 1.

    Note that 1 is not a prime number. Some more useful school knowledge: Factors are the numbers you multiply together to get another number. For example: Factor 2 * Factor 3 = 6. “Prime factorisation” is working out which prime numbers can be multiplied together to make the original number.

    2. An example to help you understand in depth.

    What are the prime factors of 147?

    It’s best to start with the smallest prime, which is 2, so let’s see:

    Can we divide 147 exactly by 2? 147 ÷ 2 = 73½
    No, you can’t. The answer should be an integer, and 73½ is not an integer.

    Let’s try the next prime number, 3: 147 ÷ 3 = 49
    That worked, now we try to factor 49.

    The next prime number, 5, does not work. But 7 does, so we get 49 ÷ 7 = 7.

    This is as far as we need to go, because all the factors are prime numbers.
    147 = 3 × 7 × 7

    Now you have a better understanding of this problem. Have you?

    3. What are the constraints of the task?

    There is no need to scroll up to see the task again. Here it is:

    Calculate the prime factors of a given natural number.
    A prime number is only evenly divisible by itself and 1.
    Note that 1 is not a prime.

    line of codeconstraintcoding
    1an input (natural number) is given.input (natural number)
    2there will be an output of prime factor(s)output
    3The smallest prime is 2, that is why we will start prime factorization with divisor 2.divisor = 2
    4How do you get only evenly divisible numbers?
    Answer: by using the modulo operation (“MOD” or “%” in many programming languages).
    The modulo operation is the remainder of the division.
     
    For example, 5 mod 3 = 2, which means that 2 is the remainder when you divide 5 by 3.
    If there is a remainder, the number hasn’t been divided equally.
    For our problem, we would need 5 mod 5 = 0. No remainder, so evenly divisible.
     
    More generally:
    Input MOD divisor < > 0, tells us that the input is not evenly divisible by this divisor and therefore we can’t proceed, we need to change the divisor.
    if input MOD divisor < > 0
    5We try the next possible divisor, so add 1 to it and try again.do divisor + 1, start again at line 3
    6If input MOD divisor = 0, store divisor as prime factor in our output or in other words: if line 3 of the code is not true (else) store divisor as prime factor in our outputelse write divisor as prime factor in our output
    7Since we have found a prime factor, we can proceed, so we actually divide the given input by the divisor: input = input DIV divisor, starting again with the “new” input at line 3.input DIV divisor
    start again at line 3
    8When do we need to stop this loop?
     
    As you can see, our first input (line 1) is getting smaller and smaller. It has to stop when there is no prime factor left. That is, when the input is equal to 1.
     
    Stop this calculation block when the input is 1. Right? If you reverse this constraint:
    Run as long as input is greater 1. 
    start again until input > 1

    Once you understand this, it is actually quite simple. 8 lines of code.

    Okay, you’re right, we’re not done yet. Actually, we need 12 lines of code to translate our reflections into ABAP. As you can see here:

    4. Our solution translated in ABAP.

    Note: On exercism.org you will find solutions using classes and methods to calculate prime factors. As our blog series is aimed at complete programming beginners, we skipped the object-oriented programming (for now) and wrote a simple ABAP report.

    5. Basic ABAP knowledge you need to know to understand the ABAP code above.

    ABAP Syntax

    Typically, an ABAP statement starts with a keyword and ends with a period. For example:

    Unlike other languages such as Java or C#, ABAP is not case-sensitive. This means that you can use the ABAP keywords and identifiers in uppercase or lowercase.

    Data declaration

    A typical procedural ABAP program consists of type definitions and data declarations. The data declarations describe the data structure that the program uses when it runs.

    Parameters are components of a selection screen that are assigned a global elementary data object in the ABAP program and an input field on the selection screen.

    So, after running our example. In a SAP GUI system or in eclipse you would have to press F8 to run a program, before you should have saved (Ctrl + s) and activated (Ctrl + F3) your program. After these three steps, you will see that parameters is a data declaration that opens an additional screen (dynpro) in the SAP GUI that receives your input variable.

    ABAP has three main types of data: elementary types, complex types and reference types. In our example, only elementary types are used. Therefore, we will only give a brief overview of them in the following table:

    Data TypeDescriptionInitial SizeValid SizeInitial Value
    CAlphanumeric characters1 character1 – 65,535 charactersspace
    NDigits 0-91 character1 – 65,535 charactersCharacter zero
    DData character YYYYMMDD8 characters8 charactersCharacter zeros
    TTime character HHMMSS8 characters8 charactersCharacter zeros
    XHexadecimal field1 byte1 – 65,535 bytes
    PPacked Numbers8 bytes1 – 16 bytes0
    IIntegers Range 2^31-1 to 2^314 bytes4 bytes0
    F8 bytes8 bytes0
    STRINGLike C, but has a variable length
    XSTRINGLike X, but has a variable length
    Overview elementary types in ABAP

    DO/ENDDO and WHILE/ENDWHILE

    In ABAP there are two loops that could have helped us solve our prime factor exercise: while/endwhile or do/enddo.

    DO/ENDDO: Unconditional and indexed loops:

    The block of statements between DO and ENDDO is executed continuously until the loop is exited using exit statements such as EXIT. Specify the maximum number of loop passes, otherwise you may get an infinite loop.

    WHILE/ENDWHILE: Header-controlled loops

    The statement block between WHILE and ENDWHILE is executed until the specified condition is no longer true. The condition is always checked before the statement block is executed.

    WRITE

    One of the very basic ABAP statements used to display data on the screen is the WRITE statement.

    In our example, the backslash starts a new line for each output number.

    Additional information.

    For additional information, see the SAP keyword documentation:

    English: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenabap.htm
    German: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/de-de/index.htm

  • 20 Jahre j&s-soft GmbH – das ist erst der Anfang

    20 Jahre j&s-soft GmbH – das ist erst der Anfang

    Die j&s-soft startet wie alle erfolgreichen IT-Startups in einer Garage bzw. im Keller eines Privathauses. Dirk Jennerjahn und Christian Schmitt, der eine freiberuflich im Bereich SAP in der ABAP-Entwicklung tätig, der andere im Bereich Java, J2EE, lernen sich kennen. Als die SAP beginnt, Java in die SAP-Welt zu integrieren, beschließen die beiden, ihre Kompetenzen zu bündeln und gründen 2003 die j&s-soft GmbH.
    Zuerst noch in den eigenen Projekten mehr als beschäftigt, stellen Dirk Jennerjahn und Christian Schmitt 2005 ihren ersten Mitarbeiter ein. Der Fokus der j&s-soft liegt bereits auf SAP-Projekten im Personal- also HCM-Bereich und die Projekte werden mehr. Zwei Jahre später ziehen die beiden j&s-soft Gründer mit drei Mitarbeitern in ein Büro in Walldorf.

    Die j&s-Gründer Christian Schmitt und Dirk Jennerjahn


    Das Büro befindet sich direkt neben einer der SAP-Kantinen. Beste Lage also für ein junges Unternehmen, das Kontakte knüpfen möchte. Da die j&s-soft bereits von Anfang an auch direkt für die SAP tätig ist, entstehen viele kollegiale Freundschaften. Wenn im j&s-soft Büro freitagnachmittags das legendäre „Bier um vier“ stattfindet, kommen regelmäßig SAP-Kollegen aus den umliegenden Gebäuden vorbei. Manche von ihnen wechseln später zur j&s-soft. In der Zeit in Walldorf entsteht das erste eigene Produkt: j&s Enterprise Documents®.


    Trotz der Weltfinanzkrise stellt die j&s-soft 2009 besonders viele neue Mitarbeiter ein. Eine Entscheidung, die sich in den Jahren danach noch auszahlen wird. Denn während viele Unternehmen Mitarbeiter entlassen, kann die j&s-soft mit vollem Einsatz ihre Großkunden versorgen.
    Im Jahr 2013 wird eine Mitarbeitergesellschaft gegründet. Das Team ist nun mit 10 Prozent an der Firma beteiligt.


    Aus persönlichen Gründen verlässt Geschäftsführer Christian Schmitt 2015 die Firma. Nun alleiniger Geschäftsführer, plant Dirk Jennerjahn die j&s-soft weiter gesund wachsen zu lassen. Projekte und Mitarbeiter werden ständig mehr. Das Büro in Walldorf wird zu eng und entspricht nicht den aktuellen Standards. Dazu kommt, dass die Suche nach neuen Mitarbeitern stärker in den Fokus rückt. Ein attraktives Büro an einem ebenso attraktiven Standort ist die logische Konsequenz. Heidelberg steht als mittelgroße Universitätsstadt mit hoher Lebensqualität bei Uni-Absolventen aus der ganzen Welt hoch im Kurs. Die Wahl fällt auf ein Gebäude in der Bahnstadt, einem neuen Stadtteil Heidelbergs, der Wissenschaft und Wirtschaft zusammenbringt. Das Büro im Sky Angle, einem nach Passivstandards gebauten, modernen Bürogebäude, wurde nach Google-Vorbild mit vielen unterschiedlichen Spaces für die Zusammenarbeit eingerichtet. Ein Ort zum Arbeiten und Wohlfühlen.

    j&s-soft GmbH Büroräume


    Im September 2019 zieht das Team ein. Alle sind begeistert – und dann kommt Covid. Das Büro steht fast leer. Parallel haben sich zuvor bereits Kontakte nach Magdeburg entwickelt. Die j&s-soft sucht schon länger nach einem nördlich gelegenen Standort. Mit seiner Universität, der angenehmen Größe und den bereits bestehenden Kontakten zur Otto-von-Guericke Universität, eröffnet der Standort Magdeburg 2021. Inzwischen ist das Team in der Landeshauptstadt sieben Mitarbeiter:innen stark.

    Auch ein j&s-soft Standort: Magdeburg


    Im Zuge der Internationalisierung findet die nächste Neugründung in Serbien statt: In Novi Sad, europäische Kulturhauptstadt 2022 und der zweitgrößten Stadt des Landes, sind in der j&s-soft Balkan d.o.o. aktuell vier Mitarbeiter:innen dabei, einen Kundenstamm mit serbischen Unternehmen aufzubauen. Die j&s-soft Balkan gehört als Schwesterunternehmen, wie auch die j&s-soft GmbH, zur j&s-soft Group.

    j&s-soft Balkan d.o.o. befindet sich Novi Sad


    Aber auch inhaltlich stellt sich die j&s-soft GmbH breiter auf. 2022 veröffentlicht das Unternehmen die Lösung enmeshed zur sicheren Verschlüsslung digitaler Kommunikationspartner mit App und Wallet als Open Source Angebot. Die Lösung mit großem Mehrwert ist für SAP-Anbindungen interessant, aber auch für alle anderen Systemlandschaften. enmeshed eröffnet der j&s-soft damit einen ganz neuen Kundenkreis, der in der Anfangszeit vor allem aus Akteuren der Bildungslandschaft besteht.

    enmeshed bei j&s-soft


    Was ist für die nächsten 20 Jahre geplant? Die j&s-soft GmbH steht für Offenheit gegenüber allen neuen technologischen Entwicklungen, um mit innovativen Lösungen den Bedürfnissen der Gesellschaft und der Märkte gerecht zu werden. Das bedeutet ständige Weiterentwicklung und stetigen Wandel. Was spannend und sinnstiftend für das Team ist, ist ebenso vorteilhaft für die Kunden: Geplant ist, weiter offen, flexibel und mit viel Know-how und Elan den Herausforderungen der Zukunft zu begegnen.

  • Data Modeling Options in ABAP – A Beginners Overview

    Data Modeling Options in ABAP – A Beginners Overview

    Development in ABAP, a programming language used for ERP purposes, will unavoidably intersect with the task of data modeling. While the ABAP application itself contains the processing logic of the data, the modeling can be done in various ways, either within or outside the ABAP code. This article is aimed at new developers that have yet to see the many options for creating data models to be consumed by ABAP programs. It is not intended to provide a detailed explanation of each modeling method, but rather to provide a quick overview of their usage and capabilities.

    Data modeling is the task of gathering data from various sources and combining and processing it into more concise data for the end user. As different data sources are often used in a similar context for different tasks, creating reusable models that can be consumed by different applications becomes a routine task. Reusable data modeling in ABAP-based programs is done using views. Like database tables, views are consumed in ABAP programs using Open SQL calls. In the following, we will be discussing the ABAP Dictionary View, the CDS View and the HANA exclusive Calculation View.

    ABAP Dictionary View

    The view most developers will be introduced to first is the ABAP Dictionary View. It is created with the ABAP Dictionary (SE11). It provides the option to choose several database tables (1) and collect them into a new table by choosing the desired columns (2). This is done by providing the shared columns (Join Conditions) of the underlying tables (3) and simple selection conditions (4). It does the bare minimum of data modeling; choosing which data should be displayed in a single table. The SQL equivalent of this is an inner JOIN. If your goal is to simply queue a few columns of related tables to be consumed by your ABAP code, the dictionary view is an easy way to do so.

    ABAP Dictionary View
    Fig. 1: Creating an ABAP Dictionary View with the ABAP Dictionary (left) and providing data sources and conditions for the view (right).

    While the ABAP Dictionary has some additional features like choosing the buffering type and inheriting field labels from its underlying data sources, any further processing of the data and supplementing technical information will have to be done in the ABAP program itself, either through lengthy SQL calls on the view or the ABAP List Viewer. The goal of data modeling is to reuse as much of the model as possible without having to code for each program individually. This makes the dictionary view the least efficient option but the easiest to understand and access since it is a simplified standard tool of the SAP GUI. It does not require any additional program or coding experience but has the fewest options.

    CDS View

    With the introduction of the powerful HANA databases, SAP developed views, designed for pushing computational tasks from the application layer (the ABAP program) to the database. These new views provide a lot more SQL features that not only improve performance but were also attractive for modeling purposes. But these Core Data Services (CDS) Views are not exclusive to HANA. A generic version, ABAP CDS, can be used database-independently and still provides most features of the HANA-specific CDS Views. They have a crucial role in modern SAP architecture. SAP S/4HANA uses models specifically built around CDS Views e.g., building entire Fiori Apps with the Restful ABAP Programming model. Even today, CDS is further evolving with quality-of-life improvements like CDS View Entities, a new, advanced CDS View type that provides more features and removed some redundancies of CDS Views.
    Creating and maintaining CDS Views is only possible with the ABAP Development Tools (ADT) accessible through Eclipse, but viewing them is still possible with the SAP GUI. They can be consumed by any ABAP program with Open SQL.

    Modeling and features

    So, what are these features, and what does a CDS View look like? An example can be seen in the image below. The first noticeable difference to ABAP dictionary views is: It is code-based. Every detail about the view is written down in a new line of code instead of clicking through menus and buttons. This is not limited to just the content of the view but also its technical properties. Let us start by looking at the core of a basic CDS View. You provide the source tables, the columns to be displayed, optional aliases, and a filtering condition for the data to be retrieved. One might say that it is just an SQL code. Because it is.

    CDS View
    Fig. 2: Creating a CDS View in ADT (left). Core structure of a CDS View (right)1.

    As with SQL in ABAP programs, CDS Views include features like expressions and functions. The example below shows how a CDS View defines a new column (1), whose value (2) depends on a more complex logical case expression (3) using data (4) from the underlying source tables. Arithmetic expressions (additions, divisions, etc.) and functions (rounding, modulo function, etc.), string functions (substring, word length, etc.), aggregations, and many other SQL features are, of course, also possible.

    within a CDS View
    Fig. 3: Complex case expression within a CDS View

    Annotations

    CDS features are not limited to the capabilities of SQL. The View can be enriched with semantic information using annotations. Annotations are simply expressions that define a property of the entire view or one of its elements, preceded by an “@“. Examples for both can be seen in the image below:

    • Setting buffering options for the view.
    • Specifying access control for when an ABAP program calls the view.
    • Defining the relationship between a column containing a value and the column containing the corresponding unit or currency. 
    Fig. 4: Annotations in CDS Views.1

    These make up only a very small fraction of all annotations. The possibilities range from general technical information to Framework-specific annotations e.g., how a User Interface should display an element of the view. They allow the Backend Developer to design entire SAP Fiori App UIs with relative ease. The image below showcases example annotations on the TravelID and AgencyID columns of the classical SAP ‘Travel Scenario’ to define some UI properties without any frontend coding:

    • @UI.lineItem to add the element to the list view of entries
    • @UI.Identification to add the element to the object page of a selected entry
    • @UI.SelectionField to add a search field for the element to the UI
    UI in CDS View
    Fig. 5: Designing UI elements in CDS with annotations.

    Some additional features

    Listing all the capabilities of CDS views would take too long and is not in the scope of this simple introduction. But to finish off, here are a few further interesting capabilities of CDS:

    • CDS Views can define input parameters that the consuming ABAP program can then provide.
    • They allow you to define which data should be accessible to which user roles. Before, this had to be done within the ABAP program itself (statement ‘AUTHORITY-CHECK’).
    • CDS Views can be enhanced. For example, a customer can create an Extention View (same structure and syntax) that adds further columns and semantic information to the view.
    • CDS Views can use other CDS Views as data sources. This is not possible with ABAP dictionary views.
    • Building views is not limited to just consuming database tables on the system. CDS Views can for example, queue data remotely through OData services.
    • A new, advanced type of relationship between data sources, called ‘Associations’. Compared to Joins, they can provide further information, like the cardinality between data sources. Furthermore, they act like a ‘Join on demand’, meaning the view can just show the ‘main’ data source and only joins the additional sources, if they are requested.

    Calculation View

    As SAP HANA completely changed the capabilities of databases, the design principles for previous programs and services became obsolete and inefficient. The goal of HANA is to push as much workload as possible away from the application layer to the database. To do this, SAP created a dedicated view called HANA Views, the most prominent one being Calculation Views. Both CDS Views and Calculation Views are designed to create the data model and all its logic on the database and send the results to the consuming program. CDS HANA Views are handled on the application layer but generate the actual model on the database, while Calculation Views are handled directly on the database and then consumed by the program. A more important difference for the developer is the modeling.

    Modeling

    The most glaring difference is that it is graphical. For most purposes, modeling of calculation views can be done almost exclusively without any code. Like with dictionary views, you set properties by clicking through menus, but it comes with a more intuitive graphical interface. Calculation Views can only be created, edited, and viewed in HANA Studio (deprecated) and SAP Web IDE (new versions).

    Each modeling step is done with a node. To get an overview of the modeling, let us look at the image below, which shows a simple case of joining two data sources. The first layer consists of two Projection nodes. Each of them selects columns from one data source to be projected to the next layer. On the second layer, a Join node combines the data sources. By navigating to the Join menu, the Join Condition and additional details like cardinality and Join type are set. On the next layer, the data is aggregated; only the sum, maximum, minimum, etc. of grouped entries is displayed by carefully defining the aggregation order and conditions. At the top level is always the Semantic node that is used to define the behaviour and meaning of each column of the final view to be consumed. Similar to annotations of CDS Views, the Semantic node can be used to provide a large variety of technical information to individual columns, like currency codes, labels, data types, data masking, and many more.

    Fig. 6: Layers for the creation of a calculation view (left)2 and Join Definition for a Join node (right)3. Images unrelated to each other.

    While modeling Calculation Views can take some time to learn simply due to their many features, an advantage over CDS Views is that they require no coding experience. Learning it can be more intuitive, making it especially attractive for data modelers who are not necessarily ABAP developers.
    Another possible advantage of calculation views can be considered by looking at the image below. Convoluted models with many Join and processing steps could be confusing to work with. Having the entire model displayed in one diagram could be easier to follow than an equivalent script-based model. To further simplify this, calculation views allow the modeler to follow a column at higher node levels to track back to its origin.

    Calculation View
    Example of a more complex Calculation View (left) 4.  Showing the Lineage of a view (right).3 Images unrelated to each other.

    Some last points

    The features provided by Calculation Views are numerous. Like with CDS Views, entire books are written about their capabilities. This article is merely a short overview but some further noteworthy points regarding Calculation Views:

    • Like with CDS Views, parameters can be defined.
    • Calculation Views can use other Calculation Views.
    • You can provide access control at the database level through so-called Analytic Privileges.
    • More complex features, that are not covered in the graphical model, can be supplemented with Functions and Procedures, reusable blocks of SQLScript code, that can be consumed in any Calculation View and even be used directly in ABAP programs using special methods called ABAP managed Database Procedures (recommended) or by creating a proxy object for the procedure (outdated).
    • HANA Views fully utilize the capabilities of SAP HANA. They are designed to get the best performance out of its in-memory technology but also have full access to the integrated Application Function Libraries, a series of C++ procedures designed to handle complex computations with great performance. Note that the usage of each library (Business Function Library, Predictive Analysis Library, Automated Predictive Library, Extended Machine Learning Library) requires its own license.
    • During the early phases of HANA Views, Analytic Views and Attribute Views were used to handle the measures (quantities) and the corresponding dimensions (elements describing the measures like customers, products etc.), respectively. These were later integrated into Calculation Views and are now obsolete. Also deprecated is the fully scripted Calculation View.

    A disadvantage of Calculation Views is that they cannot be used with Open SQL. For an ABAP program to consume them, it will require an intermediate step. Some of those are:

    • A Native SQL interface like ABAP Database Connectivity (ADBC) must be called within the program.
    • Creating a Proxy Object for the view, an External View, which can be consumed with Open SQL.
    • Consume the Calculation View in a CDS View using a CDS Table Function, then consume the CDS View in the ABAP program.
    • While Calculation Views can be used by ABAP programs, they are not managed by ABAP and thus require a separate lifecycle.

    Summary

    Let us summarize the advantages and disadvantages of each option:

    • ABAP Dictionary Views are easy to understand and available as a standard tool in the SAP GUI, but provide very few options. Further modeling requirements will unavoidably have to be done in the ABAP program. Good for beginners who only want simple Joins.
    • CDS Views have far more features that not only provide more capabilities but are also more comfortable to use once one is used to them. They are perfectly usable with ABAP but require ADT and knowledge of SQL-sublanguages (DDL, DCL and DML) to code them properly. Good for experienced data modelers that want to use the full scope of modeling features in ABAP programs.
    • Calculation Views are a code-free alternative to CDS Views regarding its features, but they can be only used with HANA databases. It requires the use of the SAP Web IDE, and consumption in ABAP code needs an intermediate step. Good for data modelers who are not experienced in ABAP and CDS or simply prefer graphical over scripted modeling.

    References:
    1. Sap Learning Course S4D430
    2. http://teachmehana.com/sap-hana-scripted-calculation-view-sql/
    3. Sap Learning Course HA300
    4. https://businessintelligist.com/2019/04/22/sap-hana-connector-tip-to-improve-performance/

  • ChatGPT: AI-enhanced ABAP Learning and Development

    ChatGPT: AI-enhanced ABAP Learning and Development

    Introduction

    After the launch of the public beta of the ChatGPT chatbot in November 2022, the news spread that this AI was not only convincing and competent as an assistant, but could also write meaningful working code in several programming languages. Some people have gone so far as to say that this AI marks the beginning of the end of programming as we know it today.

    As an ABAP beginner, I considered ChatGPT as a learning assistant. By simplifying the search for SAP-specific questions and providing meaningful examples, it might be able to help me on my learning journey. To find out if this was possible, I asked the bot about its APAP programming capabilities. The ChatGPT release I used was dated 9 January 2023.

    That was a humble answer. Now I wanted to put its ability to the test.

    Hello ABAP-World!

    As is tradition, I began with a “Hello World” program, or in this case, “Hello Person”.

    This looked promising. The AI gave the code and then explained how it worked and how to use it on an SAP system. The syntax highlighting is spotty, but this would not be a problem after copying the code into a real ABAP editor. It even paid attention to naming conventions such as all keywords being capitalised, prefixes for variable names and the z-namespace.

    A sharp-eyed ABAP programmer might notice that this code has invalid syntax. The “TO OUTPUT” statement makes no sense at this point and will produce a syntax error. I went ahead and told the AI the error message given by the editor.

    The AI was very polite and corrected its mistake. Now it was a working ABAP report.

    First Programming Steps: Fibonacci

    The first exercise was very simple, but the AI still had a rough start with the syntax. I then asked it to calculate the Fibonacci series to see how competent it is with more sophisticated problems.

    Again, the chatbot seems to have an idea of how the program should work, but could not produce a report with valid syntax. The loop statement is incorrect. After this was pointed out, the AI tried to replace it with a do statement, which also has the wrong syntax.

    Even after telling the AI multiple times where the syntax error was, it was unable to create a working program. This was very disappointing. Also, the naming convention for variables is missing here.

    (Before writing this blog, I tried this exercise on an older version of ChatGPT from 15 December and it was able to generate a working report. The ABAP programming capabilities seem to fluctuate from version to version instead of improving each time.)

    Knowledge Test: HCM and Infotypes

    Human Capital Management (HCM) is a major cornerstone of SAP and ABAP. As a beginner, it can be difficult to understand all the things you need to know to manage administrative tasks, for example. I wanted to see if ChatGPT knows about infotypes and the corresponding structures and tables:

    The AI seemed confident in its answer, but infotype 0001 is not for storing personal data, but for organisational assignment. Nevertheless, it is possible to get the name from it.

    The AI continued to give incorrect answers with confidence. This is not helpful and would confuse beginners rather than educate or inform them.

    I tried other HCM related questions but most answers were flawed with many wrong facts.

    More modern Paradigms: Object Orientation and ADT

    After the AI struggled with the last task, I was not sure if it can cope with some of the newer features of ABAP, but I wanted to see if it knows how to write ADT-specific, object-oriented code.

    Unfortunately, this code does not solve the problem. The bot wrote that this class should be instantiated and the run method should be called in a report. The AI seems to know how a class is structured in ABAP, but lacks knowledge of ADT, its functions, classes and interfaces. I tried to specify the task more precisely:

    It tried to make the changes I requested, but at the same time introduced new mistakes. It also insisted that the main method had to be called from a report in order to use this class. At this point, it would have made more sense to just write the code myself, so I moved on to something else.

    Commenting Code

    The AI seems to still need some improvement in its programming capabilities,but I thought it might be able to help a beginner to understand the code he or she might be confronted with. To test this, I wrote a simple report that uses a circle class to calculate the area and circumference for a given radius.

    The AI misunderstood my request and just explained the given code snippet. The explanations are good, so I asked it to add them as comments within the code. This resulted in the AI copying the full texts as comments, but I expected them to be more compact and readable:

    The result was the typical redundant comments that a senior developer would probably frown upon, but which might be helpful to a novice faced with a new language element. I think this is a valid use for the chatbot.

    Creating practice Excercises

    Sometimes I get tired of the sample exercises from the SAP Learning Journeys and try to come up with more interesting tasks to try to get a better understanding of ABAP and SAP systems. This can be difficult when you don’t really know how it all works and it consists of trial and error exercise definitions. Sometimes this can get a bit frustrating, so I thought maybe the chatbot could give me some interesting exercises.

    This all makes sense, but there are no concrete tasks.

    The MARA table is not maintained on every system and the ALV function module is, to my knowledge, out of date, but for a complete beginner this could be a useful exercise. After completing the task, a sample solution would be helpful.

    As expected, the AI was unable to generate working ABAP code. The function call is wrong and will result in a runtime error. I think we should just let ChatGPT create the task description and evaluate the solutions ourselves.

    Virtual ABAP Runtime

    I was surprised by ChatGPT’s ability to pretend to be a Linux command line (https://www.engraved.blog/building-a-virtual-machine-inside/). Not all ABAP beginners have a working ABAP environment to play and test with. Perhaps this could be an alternative to a trial cloud environment. I have tried to create a virtual ABAP environment based on the Linux terminal example.

    This was a very disappointing answer, but I have heard that you can trick the bot into answering you by hiding your request in a what-if question.

    This seemed to work, so I tried a more complex program. I used a modified version of the sample report from a future blog post on this website, which is a work in progress (link to the post here when available), to calculate the prime factors of a given number:

    It worked, but the output was wrong (the correct numbers are 3,3,7,13,23,41,61). The chatbot warned about its inability to run ABAP code, so this was no surprise. A virtual ABAP environment in ChatGPT seems to be impossible for now.

    Conclusion

    As it turns out, ChatGPT is not yet the almighty tool that will disrupt the programming industry, at least in the ABAP space. Its capabilities in other programming languages do not translate to ABAP, probably because the reach of ABAP on the Internet is not even close to that of more popular languages. However, this does not mean that it can never achieve this goal. The potential for language models to take care of mundane and repetitive programming tasks can be seen. Sooner rather than later, a new language model specifically trained for this purpose will emerge. Then programmers will need to shift their attention from repetitive coding to more conceptual or design work.

    For ABAP beginners like me, the assumption that ChatGPT could be a valuable help in its current state seems far-fetched. The chatbot can give example exercises and comment code, but it is tedious to get it to do this correctly. I still believe that the chatbot will get better at this in the future and change the way we learn programming. Until then, we ABAP beginners should stick to our books, learning journeys and asking seniors for a meaningful learning experience.

    Image was synthesized by the AI Stable Diffusion

  • Lernen für die eigene Entwicklung

    Lernen für die eigene Entwicklung

    Wir unterstützen unsere Mitarbeiter:innen dabei, sich ständig weiterzuentwickeln. Deshalb finanzieren wir den Erwerb von Zertifikaten und Weiterbildung vom Junior bis zum Senior-Level und schaffen Zeit zum Lernen: Mit einem Trainingsanteil des Teams von 14,4 Prozent liegen wir im Branchenvergleich weit vorne. Daher freuen wir uns, dass unsere Kolleg:innen Momtaj Annar, Erdem Genc und Nikola Vojislav Vetnić in den letzten Wochen die Zertifikate zum „Development Associate – ABAP with SAP NetWeaver 7.50“ & „Development Specialist – ABAP for SAP HANA 2.0“ erfolgreich abgeschlossen haben.  

    Mit den neu erworbenen Fertigkeiten z.B. aus den Bereichen Data Types, SQL Statements oder Guided Performance Analysis spezialisieren sich die drei weiter im HCM SAP Umfeld, um die Bedarfe bei der Entwicklung und Beratung unserer Kunden noch besser abzudecken.  

    Wir gratulieren!  

  • Das war die ABAPConf 2022

    Das war die ABAPConf 2022

    Am 7. Dezember war es wieder so weit: ABAP-Entwickler vom Anfänger bis zum ABAP-High-Sophisticate trafen sich bei der ABAPConf mit Vortragsthemen wie “ABAP Quickfixes for S4/HANA” oder “4 abapGit Use Cases That Will Blow Your Mind” (siehe Programm). Die kostenlose, online stattfindende Veranstaltung deckt in zwei parallelen Streams eine große Bandbreit an ABAP Themen ab und richtet sich in den Sprachen Deutsch und Englisch an ein Internationales Publikum. Alle Sessions sind auf dem youtube channel und über die ABAPConf-Website abrufbar.

    Unser Kollege Sören Schlegel veranstaltet das ABAP-Event mit Tobias Hofmann, Dominik Bigl und Johann Fößleitner. Mehr über die Organisatoren und Hintergründe hier.