Every day I get a “Google Alert” of all the news stories about SAP.
Yesterday one came up saying a company in Hungary were giving away a free add-on to the ABAP editor which improved the “pretty printer” function.
Without further ado, here is the link:-
You notice it says “buy” – this is actually free, but the “price” you have to pay is to share the fact you have downloaded this on a social media site such as Facebook or Linked In. I chose Linked In because this is a work related thing.
Anyway, this does not do that much, but it does automate a few things I spend a lot of time doing manually, e.g.aligning DATA statements such as when I am declaring structures and what have you.
Anyway I downloaded it, it does what it says on the tin, and it has not blown up my sandbox system.
More interesting to me is seeing HOW it works, which is an implicit enhancement to function module PRETTY_PRINTER. I had to go into the enhancement and add a comment, and then activate the ehancement again before it worked, it might work for you straight off, if not try that method.
I won’t be able to stop myself enhancing this further, the best example I can think of is the automatic commenting of local classes and methods, to match what standard SAP does with PERFORM routines.
Rant Time! If SAP was REALLY serious about making people use object orientated programming, they would make it as easy as procedural programming e.g. it would be good if when I double clicked on a method defintion then a skeleton implemenatton would be generated with comments saying what the signature was – basically I want the exact same thing that happens when you double click on a call to a PERFORM that does not yet exist.
ABAP OO came out in the year 2000, so SAP has had 13 years – THIRTEEN YEARS – to unify this behaviour i.e. improve the creation of local methods so they are as good as local PERFORM routines, and it has not bothered. What does that tell you about the level of commitment?
Someone is going to say “oh, you can do that in ABAP in Eclipse” well hooray, in five years time when we upgrade again I’ll be able to use that. In the meantime I think playing with this new toy may well solve the problem, I will go farther I will add what I want using the same mechanism.
Anyway, ranting aside, the link above takes you to a page where there is some documentation about what this free tool does, and videos and what have you.
This business model is getting more and more common – companies giving away free things to try and get you hooked, a bit like drug dealers do, for example SALT which is quite a reasonable product given it is free, and I wholeheartedly approve!
Thus far we have discovered that the imrpoved pretty printer mangles the archaic ABAP command “AT END-OF” which used to be used in LOOPS. That command is strongly discouraged from future use as it can give unpredictable results in some situtaions, but nonetheless that’s a bug. An easy fix I imagien, I’ll be able to fix it in our system, no problem, and then I’ll add how to fix it intot his blog.
P.S. We have found one bug so far, the new pretty printer mangles the archaic statemtn “AT END OF” which can be used in loops but should not be as it gives weird results. Anyway, a one line code fix:-