Grok all the things

grok (v): to understand (something) intuitively.

ABAP

🙄  Cynics & grumps

ABAP: The 80's Called, They Want Their Programming Language Back

The programming language that thrusts you back into the wonder years of 1980s software development. Created by the German software behemoth that is SAP, Advanced Business Application Programming (ABAP) was their baby, tailored for developing software on their flagship product, the SAP R/3 system. A classic example of "if you can't beat 'em, join 'em," SAP simply couldn't resist crafting their own delightfully convoluted and verbose language.

Syntax and Semantics: Where Less is Definitely Not More

Why bother with the simplicity and elegance of modern programming languages when you can indulge in the sheer verbosity of ABAP? Let's take a look at how one might display the famous "Hello, World!" in ABAP:

REPORT zhello.
WRITE: 'Hello, World!'.

Just look at that beautiful syntax. We couldn't just print() or console.log() like lesser mortals; no, we had to WRITE: with a colon and everything. And don't get me started on the cryptic REPORT line. Brevity may be the soul of wit, but apparently, it has no place in ABAP.

Data Types: Because Who Needs Consistency?

In ABAP's defense, it was conceived in an era when computing was far more limited than it is today. Take its data types, for instance—wouldn't it be such a shame to miss out on the quirky distinctions between C, D, T, N, and X? In modern languages, most developers are perfectly content with strings, integers, and floats, but ABAP enthusiasts revel in the complexity of:

  • Character-like for alphanumeric data (C)
  • Numeric character for storing numbers as text (N)
  • Integer for whole numbers (I)
  • Float for floating-point numbers (F)
  • Date for, well, dates (D)
  • Time for times (T)
  • Hexadecimal for binary data (X)

Embrace the chaos and inconsistency, my friends.

Error Handling: It's a Feature, Not a Bug

In a normal language, you'd use exception handling to gracefully recover from errors. But why make life easy for yourself when you can rely on the joys of ABAP's error handling instead?

Behold, the magnificent SUBMIT statement—take a moment to appreciate the poetry of a language that doesn't even have exception handling built in. Rather, error messages are displayed to the user by default, and you'll need to handle it on your own with the message classes and other arcane constructs.

Internal Tables: Bringing Masochism to Data Storage

If you've always dreamed of manipulating data in a table format while programming, ABAP's got you covered. Internal tables give you the power to store data in a tabular format within your ABAP programs. Of course, this wonder is achieved through the joys of nested loops and other assorted masochistic programming practices.

Given their complexity, internal tables require nothing short of a dedicated, multistep ritual to initialize and populate. First, you must define the table's structure and then declare a work area that must be used when inserting data into the internal table. The cherry on top? Using cryptic commands like APPEND, MODIFY, or—brace yourselves—LOOP AT to manipulate the table's contents. What could be more satisfying?

DATA: BEGIN OF itab OCCURS 0,
        col1 TYPE c,
      END OF itab.

DATA: wa LIKE LINE OF itab.

You know you love it.

The ABAP Ecosystem: Laws of Attrition

Have no fear; you're never alone in the ABAP world. Well, maybe you are, because let's face it: compared to the bustling communities surrounding languages like Python or JavaScript, the ABAP developer community can be a bit, erm, exclusive. But on the bright side, that exclusivity comes with a delightful layer of job security—provided you don't mind sticking to the SAP ecosystem like glue.

So there you have it. ABAP, a language that harkens back to a time before the internet and sleek, modern programming paradigms. It may be verbose, cryptic, and at times downright infuriating, but hey—at least you're not working with COBOL. Or are you?

Grok.foo is a collection of articles on a variety of technology and programming articles assembled by James Padolsey. Enjoy! And please share! And if you feel like you can donate here so I can create more free content for you.