SAP TechEd BLR – CD263 – New ABAP Language Features
SAP TechEd Bangalore 2010 started today with the keynote by Vishal Sikka. One of the sessions on my Agenda was “New ABAP Language Features” which was a hands-on session. The crowd outside the session hall clearly indicated that this was one of the most sought after topics and the hall was full in no time.
The topics which were covered in the 4 hour session were
- Extended Expressions
- Internal Tables
- Decimals Floating Point
- Streams and Locators
- Boxed Components
In this blog, I will just focus on the first three topics.
1. Extended Expressions
ABAP now can handle expressions like most of the other programming languages. You can use expressions now in decision statements (like the “IF” statement) and also in Control statements. Even though this is a cool feature, it also has its disadvantages as mentioned in the session. The programmer has to be very careful so as to not overuse this feature. For example, the same expression repeated multiple times does not make sense if the output is the same and could be stored in a variable and used. So we need to introduce sufficient programming guidelines to handle these cases.
Another interesting part is the way String handling has changed. Concatenating a string just got easier (‘&’) and also a whole lot of string manipulation can be done very easily with expressions like string_after, string_before, find and replace just to name a few. Again it is upto the programmer to use these powerful features responsibly.
This being a hands-on session, the example given for the participants to try out did not bring out the complete nature of extended expressions and the things you can do with them. Maybe a couple of more exercises would have added value here.
2. Internal Tables
This is one of the interesting topics which was discussed in the session (atleast according to me). Internal tables can have secondary keys now and this has a huge impact on the performance especially if you are working with internal tables which have a huge number of rows.
The secondary key can be added by using the syntax as follows –
DATA: it_table_name TYPE SORTED TABLE of table_name WITH UNIQUE KEY pri_key WITH NON-UNIQUE SORTED KEY sec_key COMPONENTS column_name.
For this topic, the exercises were pretty good (with focus on performance) and the debugging session by the presenter was of immense use.
This is another topic which I found very interesting. It is now possible to mark an Exception as resumable and processing can continue even after the exception is caught. The slide which was presented explaining the features were pretty descriptive of the features. The important ABAP statements related to the feature are –
RAISE RESUMABLE EXCEPTION
CATCH BEFORE UNWIND
The statement CATCH BEFORE UNWIND especially adds a new twist to the whole flow of exception handling which I haven’t seen in most programming languages. I found this topic very interesting and it also has a lot of scope for use by developers.
In general, the session was of use to me but I found this as a lecture session and not exactly a hads-on session because the amount of time spent on the laptop was considerably less. Maybe it would make sense to reduce the topics from six to three and focus more time on these three. Otherwise, it was a good session and a good start to TechEd Bangalore this year.