Supported by
Supported by Inetum

Finally, expressions can be concatenated

images/thumbnail.jpg - Thumbnail

Finally, the SAP NetWeaver 7.0 Enhancement Package 2 makes ABAP start to seem like a normal programming language.

It even allows expressions to be concatenated, no less!

Admittedly, EhP2 was released a long time ago but there are many projects that still don’t have it. It only came to mine last month. Even among those who already have it, I believe they may have no idea of the countless possibilities now available to them in ABAP.

When you wanted to concatenate expressions in ABAP up to now, it would say: syntax error. And then you would have to do things in instalments. For instance:

x = a + b
y = c + d
IF x > y.
  z = e + f.
  DO z TIMES.
    CONCATENATE g h INTO i.
  ENDDO.
ENDIF

Now (or rather when your project is upgraded to EhP2) you can do the following:

IF a + b > c + d.
  DO e + f TIMES.
    i = g && h.
  ENDDO.
ENDIF.

And instead of having to do this:

DATA o_cl1 TYPE REF TO cl1.
o_cl1 = cl2=>da_cl1( ).
o_cl1->faz_algo( ).

you can do:

cl2=>da_cl1( )->faz_algo( ).

Did you notice above that && takes the place of the infamous CONCATENATE? There are also countless innovations in the processing of strings , but I’ll leave that for another article.

If you still don’t have EhP2, keep on dreaming. If you already have it, keep on experimenting because there are many new possibilities of this kind.

Thanks to KayVee.INC for the photo.

Greetings from Abapinho.