It's now so simple to convert a MESSAGE into an EXCEPTION
Some years agor I showed how to convert a normal MESSAGE into a typified exception. Meanwhile ABAP evolved a lot and now, since version 7.40, that complex solution is no longer needed.
Some years agor I showed how to convert a normal MESSAGE into a typified exception. Meanwhile ABAP evolved a lot and now, since version 7.40, that complex solution is no longer needed.
My current client’s system is finally being upgraded to 7.50 and, after all these years stuck with the old ABAP, I am now finally able to enjoy the wonders introduced in 7.40.
There are dozens of these wonders and I don’t intend to start making a post on all of them as there is already so much quality information on most of them. Besides, Abapinho always tries to write about something new or, at least, not very known.
But this simple functionality, although not that extraordinary, pleases me: you no longer need to add IS INITIAL in an IF command when the condition is a method returning a boolean.
We’ve all sorted internal tables to use AT NEW on a LOOP. But starting from 7.40, we can use GROUP BY on LOOPs.
The ability to group by values based on expressions or even methods is great.
The grouping is done on the first LOOP and can be processed afterwards. Try running the code below and I bet you’ll be as impressed as I was.
Pré 7.4:
DATA l_idade type i.
READ TABLE lt_folk
INTO ls_folk WITH KEY name = l_name.
l_age = ls_folk-age.Pós 7.4:
data(l_age) = lt_folk[ name = l_name ]-age )Thanks Sérgio Fraga for the tip.
Greeetings from Abapinho.
Abapinho will slowly start posting tips specific to AS ABAP 7.4. Slowly because there are still only a few people with access to this version. But there are so many new things to tell that I feel tempted to start posting all of them.
ABAP was a flabby middle aged guy with a beer belly. It underwent major plastic surgery and now looks like a lean 20 year old kid who can party until 9am, drink 7 gin tonics and then, before going to bed, do 100 burpees just to sleep better.