

The result is then used for the comparison with the column specified on the left side.īut you can introduce a lot more complexity using SQL expressions. In the example below a table expression is evaluated as a host expression on the right side of a where condition. For a complete list of operand positions for host expressions I like to point to the ABAP Keyword Documentation on this subject. Starting with host expressions, Host expressions are ABAP expressions that can be specified in operand positions in Open SQL.This really opens up a lot of possibilities you never had before. It will go too far to explain all new Open SQL features here but I want to show some examples of what new features are introduced in ABAP release 7.50. In fact the role of Open SQL in the ABAP framework has changed as is explained in detail in this excellent blog. In ABAP release 7.40 (SP05) a new foundation for Open SQL was laid by introducing a new SQL parser into the ABAP runtime environment. There are some nice examples in the standard SAP help you can find here. In release 7.50 a new system class CL_ABAP_CORRESPONDING has been introduced which makes it possible to assign components of structures or internal tables with dynamically specified mapping rules.Īs I said before this isn’t something I see myself use very much, but there might be some circumstances that it will be useful. Something that wasn’t possible with the classic MOVE-CORRESPONDING statement. In ABAP release 7.40 a new constructor operator CORRESPONDING was introduced that allows an explicit mapping of structure components with different names. The next feature is nice but I don’t see it as something I will user very often. If you wanted to achieve something similar before the 7.50 release you had to use a casting operation inside a TRY …. Nothing spectacular but convenient nonetheless. I often use the NEW constructor operator as it gives me, in combination with the inline declaration functionality, a quick and easy way to instantiate classes. The conditional operators COND and SWITCHĪll of the constructor operators mentioned above have their benefits but I will highlight some of them I find particularly useful or interesting in the examples below.Currently the following constructor operators exist: Rather cryptic right But I will try to clear things up in the examples below.

The parameters specified in parentheses are used to pass input values” Each constructor expression creates a result whose data type is determined using the specified type. “A constructor expression consists of a predefined constructor operator, a data type or object type that matches the operator and that can be derived implicitly from the operand position using #, and type-specified parameters specified in parentheses. Constructor ExpressionsĪnother useful feature introduced in the ABAP 7.40 release are the constructor expressions.

There is however a small price to pay, in the last example above you will lose the possibility to directly navigate to underlying classes by double clicking on the variables. It may at first glance seem like a small improvement but once you start using this feature (especially in combination with the other new features) you will see the benefits and you will use it all the time. In this example we use a string template on the right hand side so the variable LV_PARAMETER will be of type STRING. Simple assignment of a left hand side variable. It can be used in a lot of different circumstances of which some are shown in the examples below. By using the new declaration operator DATA(…) or FIELD-SYMBOL(…) you can declare your variables on the fly and it will speed up your development significantly as you don’t have to specifically type all your variables. Inline declarations are a new way of declaring variables and field symbols at operand positions in your ABAP statements. I would like to start with the inline declarations which is one of the major changes introduced in release 7.40. SAP NetWeaver AS ABAP 7.4 – Overview and Product Highlights Inline Declarations I will start right away with some examples, but if you want some more background information I recommend you to check the following links:ĪBAP News for Release 7.40 – What is ABAP 7.40? In this blog I will not try to cover all the new features introduced in the ABAP 7.40 release as it will actually take several blogs to cover it completely. In this first part of my blog I want to focus on the practical use of the new features available in the ABAP 7.40 release that allow you to write more compact and efficient code. The ABAP release 7.40 is around for some time now and as an ABAP developer it is bound to cross your path sooner or later.
