Tag > 7.4
Supported by
Supported by Inetum

To all those whole criticize 7.4 syntax

images/thumbnail.jpg - Thumbnail

This post is addressed to the collective character that represents all the people who have told me that they like some things in the new 7.4 functional syntax but think that you shouldn’t overdo it and should avoid using REDUCE and all the other unnecessarily weird things because the code gets more obscure, it’s slower and they don’t see any advantages.

Are you serious?

Use BASE to not ruin what you already have

images/thumbnail.png - Thumbnail

We used to use the APPEND and INSERT commands to add rows to internal tables. Now that ABAP has grown, we can use VALUE, REDUCE, CORRESPONDING, etc. But what if the internal table already has rows and we don’t want to lose them?

Don't MESH with ABAP

images/thumbnail.jpg - Thumbnail

ABAP 7.4 brought a lot of lauded novelties. Of all of them, the one less talked about is MESH. Let’s analyse it and see how unfair that has been.

Easily modify internal table record

images/thumbnail.jpg - Thumbnail

The new way to get data from internal tables is also the new way to put data into internal tables.

ABAP inside SQL statements

images/thumbnail.jpg - Thumbnail

Did you know that, if you SAP is recent enough, you can use complex ABAP expressions in the middle of SQL commands?

Table lookup without having to deal with CX_SY_ITAB_LINE_NOT_FOUND

images/thumbnail.jpg - Thumbnail

Before the modernization of ABAP in 7.40, a table lookup required an auxiliary variable and at least 4 lines of code.

NOT

images/thumbnail.jpg - Thumbnail

No, ABAP will never have the NOT operator.

MOVE-CORRESPONDING between two tables with automatic look up

images/thumbnail.jpg - Thumbnail

Abapinho hasn’t been talking a lot about 7.40 because most of the new possibilities have already been widely discussed in other sites and we don’t want to reinvent the wheel.

But, here and there, I find small useful jewels which seem to still be under the radar. This is one of them.

The simplest route to go from SELECT to RANGE

images/thumbnail.jpg - Thumbnail

Today we’ll try to optimize the code to convert a SELECT into a RANGE

It's now so simple to convert a MESSAGE into an EXCEPTION

images/thumbnail.jpg - Thumbnail

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.

IF without IS INITIAL in boolean methods

images/thumbnail.jpg - Thumbnail

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.

GROUP BY in LOOPs on internal tables

images/thumbnail.jpg - Thumbnail

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.

Bye bye READ TABLE

images/thumbnail.jpg - Thumbnail

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.

So much new stuff in 7.4, I don't know where to begin

images/thumbnail.jpg - Thumbnail

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.