Supported by
Supported by Inetum

ABAP, the lobotomizer

images/thumbnail.jpg - Thumbnail

João studies Computer Science at his College where he learns Java, polymorphism, encapsulation and a lot of other programming techniques and best practices. When he graduates, he decides to join a company to work in SAP. At the introduction training which his new company offers, the first thing he learns is how to make a program in ABAP. Here’s how they teach it:

_“Go to transaction SE38, create program ZJOAO and then create includes ZJOAO_TOP, ZJOAO_FRM and ZJOAO_SEL. You declare all variables in _TOP, the selection screen you put in _SEL and all the FORMS must go into FRM. Then write START-OF-SELECTION and under that put all the SELECTs and finally write END-OF-SELECTION and there you show the results in an ALV. It’s that simple. Welcome to ABAP."

Finally João is ready to start working in a real customer. Once he’s there, he realises that, indeed, almost all programs have a _TOP, a _SEL and a _FORM and start with START-OF-SELECTION. Although he is intrigued because only some have END-OF-SELECTION.

One month later João is already quite at ease with SE38. By now he barely recalls what he learned in college. One year later he’s become a trusted programmer, delivering serious and complex work. His programs have thousands of lines, divided into multiple FORMs with hundreds of lines each (which he dutifully writes in the _FRM). His forms don’t use parameters because it would be foolish to keep passing the variables from one FORM to the other when they are already accessible by all since they’re declared in the _TOP include anyway. And thus, the _TOP include of his programs has several pages and dozens of variables.

And then one day someone tells him about encapsulation and he says:

“What? You mean reusable Function Modules in SE37? Yeah, I could make some, but I’m quite sure that no one will ever use these things again so it’s not worth it."

And then one day someone tells him about ABAP OO and transaction SE24 and he says:

“Oh, classes? I know, I know, but firmly believe classes in ABAP are bad because they take much longer to make, it’s a lot of extra work and much worse to debug and in this client I would never have time for that. And besides I don’t see any advantage in using them."

So he carries on, adding more and more lines to his beloved _FRM and _TOP includes.

And then one day someone tells him about Software Design Patterns and João says:

“Man! I had to learn UML in College and I hated it. It’s useless. No one uses it in real life. And besides, those are classes and in SAP I don’t think classes make any sense."

And then one day someone tells him about the virtues of SOLID and he says:

“Hum… that looks interesting. I wish I had the time to learn it. But not for SAP because ABAP is different and that doesn’t apply to the way we program in ABAP."

And then one day someone tells him about ATC (ABAP Test Cockpit) and he says:

“What’s that? I tried running it on the program I made and the list of errors was so long and useless that I didn’t have the patience to look into it. Anyway my program is working fine."

And off he goes, back to his SE38, filling his includes, oblivious of vulnerabilities, naming conventions, semantic flaws, uncaught exceptions, unreachable code, etc.

And then one day someone tells him about TDD (Test Driven Development) and ABAP Units and he becomes confused and says:

“Test what? I already saw those ABAP Units somewhere in SE80 but never really cared to understand what they are. Anyway, I usually ask a functional person for some test data to do my tests and then, if it works, I just tell them it’s ready and let them do most of the tests."

And then one day someone tells him that Shared Objects are a great way to cache data across processes and he says:

“Cache? When I need to cache something I usually create a table ZRESULTS and INSERT all the cached data into that table and then SELECT from it whenever I need it. It’s fast and it works. And then I make a program that deletes the cache once per month. No one ever complained."

And then one day someone tells him about SAP Package Concept and the advantages of using Package Interfaces and he says:

“Packages? If it’s FI I put it in package ZFI, if it’s SD it goes into package ZSD and all MM stuff goes into package ZMM. This way I never get it wrong."

And then one day someone tells him about ADT (ABAP Development Tools) and Eclipse and he says:

“I used Eclipse in College. But that was for Java. I don’t see any advantage in using it for ABAP. That’s silly."

And then one day someone tells him about abapGitm an open source project which lets you use the wonderful git with ABAP, and he says:

“But I can already make versions in ABAP! And besides, when I need to store versions of my programs or copy them to another system I use NOTEPAD.EXE and it never failed me."

And because, in the SAP world, customers almost never care about the quality of their code, don’t have to comply with coding industry standards, rarely enforce any kind of quality control (and when they do, it’s done by someone who thinks like João), 10 years later João is still proudly chained to his SE38, creating _TOP, _FRM and _SEL includes.

And then one day someone asks him what he does for a living. And he says:

“I am a Computer Engineer.”

Não he’s not.