CDSs tend to become spaghetti

images/thumbnail.png - Thumbnail

I know everyone loves CDSs and that it’s a sin to speak ill of them, but please let me get this off my chest.

Use UNION ALL whenever possible

images/thumbnail.jpg - Thumbnail

In SQL, UNION is used to combine the results of two queries. But in many cases, UNION ALL should be used instead.

I was not notified of several comments

images/thumbnail.jpg - Thumbnail

I’ve just realised that I wasn’t receiving notifications for comments.

Replace value of an internal table field

images/thumbnail.jpg - Thumbnail

Now that ABAP has comprehensions, there are a number of superpowers that aren’t always obvious. Here, I’ll show you how to change the value of a single field in all, several or just one record of an internal table.

Who triggered the exception?

images/thumbnail.jpg - Thumbnail

Exceptions can be passed back, method by method, bubbling up, and caught by a method that has nothing to do with the one that raised it. And how will you find it?

Attributes that are global variables in disguise

images/thumbnail.jpg - Thumbnail

There’s nothing worse than seeing code that abuses variables. They’re so delicate, and yet they’re treated so badly. Poor things. And to those who have to read them. The worst way to treat a variable is to make it global. It’s hard to believe, but in 2025 this crime continues to plague our systems. Well, here’s a way to show them some love.

I hate magic numbers

images/thumbnail.jpg - Thumbnail

Those who work in SAP think it’s normal for everything to be represented by obscure codes that mean nothing. But it doesn’t have to be this way. Stop it! Create human-readable codes please.

VALUE #( ) and nothing else

images/thumbnail.jpg - Thumbnail

I once wanted to test a class whose constructor took several parameters, each requiring an instance of a different interface. These instances weren’t easy to create and weren’t relevant to the test. After some experimenting, I found a way to work around the problem.

Test boolean methods implicitly

images/thumbnail.jpg - Thumbnail

A quick reminder. I thought this was obvious but I keep seeing IF statements that explicitly test the result of a boolean method against ABAP_TRUE or using INITIAL. There’s no need! ABAP is clever in this regard.

Thank you, Martin Jonen

images/thumbnail.jpg - Thumbnail

It’s great to find peers who are equally interested in improving and evolving, not just as a programmer but also as a human being. I recently found one.