4 Comments
User's avatar
Name (Required)'s avatar

Aliases are part of SQL only for one reason: When you have the same table twice in a join e.g. when you join it with itself like in

SELECT v1~vebln FROM vbak as v1 JOIN vbak as v2…

And they should be only used when really needed!

However, in Next Generation ABAP (tm) it is mainly used from programmers to do things like

'''

SELECT someobnoxiosnamefwvqer ~vbeln from

vbak as someobnoxiosnamefwvqer

join vbap as someobnoxiosnamefvwqer

where someobnoxiosnamefwvqer~vbeln EQ someobnoxiosnamefvwqer~vbeln...

'''

because 4 letter table names are just to much COBOL feeling for the aspiring modern developer.

(Yes, there is a difference in the table aliases which every code maintainer supposed to spot immediately)

Expand full comment
Jelena Perfiljeva's avatar

Ha! Funny enough, this is not explained at all in ABAP documentation, even now. I had no idea it was actually feasible to JOIN same table multiple times. Only then aliases began to make at least some sense.

Worry not though, all table access is being replaced by I_someobnoxiosname CDS views. :)

Expand full comment
Name (Required)'s avatar

SAPs idea of best everything integration reminds me of how google engineers envisioned how your light switch supposed to work in future:

https://www.thousandeyes.com/img/blog-legacy/2018/06/Figure-2-API-architecture-light-bulb.png

Maybe the idea is to make everything so complicated only an AI (Joule?) can manage this?

Expand full comment
Jelena Perfiljeva's avatar

"Make everything more complicated, so that AI can solve it" - old trick straight from the retailers' "jack up regular price before the sale" playbook. :)

Expand full comment