ABAP Feature Set Backport 7.X to 7.02 – ABAP Compiler
The ABAP compiler was improved in the following ways. The improvements are backward compatible. You don’t have to do anything with your programs but can simply benefit from the improvements.
Multi Pass Compiler
You might have not noticed it, but the ABAP compiler up to Release 7.01 has some flaws. Before the dawn of ABAP Objects it operated with one pass processing only. With the introduction of ABAP Objects, a restricted two pass processing was introduced, Nevertheless, when developers started to create complicated relations between classes and interfaces it was found that some correct programs do not compile. In fact, this can be shown by a rather simple example of two public classes with cross references:
CLASS cl_test_1 DEFINITION PUBLIC.
PUBLIC SECTION.
TYPES type11
TYPE cl_test_2=>type22.
TYPES type12
TYPE i.
ENDCLASS.
CLASS cl_test_2 DEFINITION PUBLIC.
PUBLIC SECTION.
TYPES type21
TYPE cl_test_1=>type12.
TYPES type22
TYPE i.
ENDCLASS.
In Release 7.01 there are syntax errors in both classes (even after activating them)!
This is solved in Release 7.02. After the introduction of a robust multi pass processing for global classes, global interfaces and type pools, the syntax errors do not occurr any more.
Load on Demand
Up to Release 7.01, the ABAP compiler could only load external definitions (e.g. TYPE-POOLs, classes and interfaces) at certain times. The definitions were loaded as soon as possible to minimize compilation errors. If definitions refer to other definitions, further definitions had to be loaded in the same moment. As a consequence, a significant amount of definition were loaded that were not needed. Further consequences were a costly dependency administration, a high recompilation frequency (e.g. changes of dictionary types affected many ABAP loads that didn’t really use the type), and code instability (syntax errors in definitions “far away” affected many programs that didn’t really need these definitions). Workarounds that avoided such dependencies were dynamic techniques and usage of unsafe types, e.g. parameters typed REF TO OBJECT. Those techniques bypassed static checks and negatively affected code robustness and maintainability.
This issues are solved in Release 7.02, because external definitions are only loaded when actually required (i.e. on demand). Example:
DATA: obj TYPE REF TO iface. “Definition of iface not loaded
…
var = iface=>const. “Definition of iface loaded
…
As an interesting consequence for ABAP developers there is no need for some explicit usage declarations any more and the following statements became obsolete:
- TYPE-POOLS
- CLASS … DEFINITION LOAD
- INTERFACE … LOAD
These statements are ignored by the ABAP Compiler as of Release 7.02 and can be deleted (no need of TYPE-POOLS statement any more, see http://help.sap.com/abapdocu_702/en/index.htm?url=abaptype-pools.htm).
Performancce
Even if you never stumbled over syntax errors as shown above or you don’t care about load on demand, you will benefit from the new ABAP compiler which is more robust, economic and – last but not least – fast: Compilation times are reduced by 60%!
You mentioned "Compilation times are reduced by 60%". It's an amazing value. What about CPU/memory consumption? Is it increased or basically the same as before?
Thanks,
Peter
it is mainly the load on demand that helps to increase performance. Memory consumption is also improved due to less dependencies. CPU consumption is basically the same but compilation is faster.
Best
Horst
Thanks for the quick answer.
Please also forward my congratulation to the ABAP team for this nice improvement.:)
Best regards,
Peter
More goodies in so less time...I'm really impressed and happy...ABAP was the great language and now it's better than ever -:)
Greetings,
Blag.
This feature has been in other compilers for ages and along with this there are many other features that most developers take for granted in Microsoft and Java environments, yet they still remain missing from the ABAP editor.
I would like to see SAP bring more innovation then simply implementing popular features of other paradigms and then bragging about it.
good point indeed! But things in ABAP are as they are for many reasons (I myself was involved in so many ABAP renovation projects that never came to light, it's sometimes frustrating). Nevertheless I plan to brag about the fact that you can finally write
IF a + b > c - d.
even in ABAP in an upcoming blog 😉
But honestly, if you find enough people to support your point of view, I will stop bragging about the new ABAP features immediately ...
Cheers!
Horst
maybe not the right place to discuss, but in my current project I develop a application from scratch. Some parts of the application are involing cross-cutting concern like authorisation and in some way DB-layer is also cross-cutting.
If I had time to write unit test I would write unit tests, but on the other hand it is a somehow a one-use solution.
For writing unit-test I need to encapsulate cross-cutting concerns.
How to encapsulate the behaviour of the cross-cuting depend on deployment phase (test or productive use)?
While writing this comment a possible solution came to my mind:
1. Built a interface around cross-cutting conerns
2. Having a configuration manager which delivers
a reference deployment-depend object
Is that way? Are there another solution on cross-cutting concern in ABAP?
All the best,
Guido
I know that you are not allowed to speak about ABAP renovation projects, but on my list would be
+ ABAP-MDA (model driven architecture)
+ deployment-dependent support
+ ABAP for RIA application
+ ABAP to UML (static AND dynamic) for documentation propose
All the best,
Guido
P. S.: By the way, why is support of JavaScript in Kernel stopped? In combination of WD4A element iFrame and BSP and JavaScript you can develop RIA application with MS Silverlight and Adobe Flash.
Maybe there is a good reason that they became popular 🙂
Peter
how to deal with cross-cutting concern in ABAP?
One possible way which came to my mind is to encapsulate the cross-cutting (authorisation, logging & DB-Layer) in a interface and having a configuration manager which delivers a enviroment-dependent (test & produtive) reference on the cross-cutting concern. By doing that for all cross-cutting concerns the component is unit-test enabled.
Is the idea valid? Are there ohter approaches?
All the best,
Guido
I have moved the discussion towards the forum
How to handeled cross-cutting concern in ABAP applicaton?
Beside interface-based handling there might be event-based handling of cross cutting concerns.
All the best,
Guido
Really a nice read, raises a lot a lot of questions in my mind.
I have always wondered can ABAP have a standalone compiler? If yes, then why don't we see it in the market?By standalone, I mean no SAP system is required essentially.
For example, you can compile Java Code in a standalone environment using Java Runtime Environment.
Does something similar exists for ABAP and if yes, then why can we not find it anywhere?
Best Regards
Ashish
P.S: I am a Java Developer, but really inquisitive about trying to find reasons why was/is built the way it is now.Any pointers would be deeply appreciated.