Skip to content

ABAP Keyword Documentation →  ABAP - Release-Specific Changes →  Changes in Release 7.40 →  Changes in Release 7.40, SP08 

Expressions and Functions in Release 7.40, SP08


1. Predicative method calls


2. New Boolean function


3. Iteration expressions


4. Table filtering


5. Start value for constructor expressions


6. Inserting table rows in constructed tables


7. Grouping internal tables


8. Default value for table expressions


9. Restrictions removed

Other versions: 7.31 | 7.40 | 7.54

Modification 1

Predicative Method Calls

The predicate expression

meth( ) IS NOT INITIAL

can now be specified in a short form a a predicate method call

... meth( ) ...

This makes is possible to use predicate methods in logical expressions as if their return value had a real boolean data type.

Modification 2

New Boolean Function

The new Boolean function xsdbool returns the value "X" or a blank of the type c with the length 1, depending on the truth value of the logical expression specified as the argument. This expands the existing function boolc, whose return value has the type string. This can produce unexpected results in comparisons with text fields and in checks on the initial value.

The return value of xsdbool still references the special type XSDBOOLEAN from ABAP Dictionary. This means it is handled like a real truth value in serializations and deserializations to or from asXML and asJSON.

Critical uses of boolc now produce a syntax check warning.

Modification 3

Iteration Expressions

The iteration expressions introduced using FOR (until now only available for table iterations in table comprehensions) have been expanded to include conditional iterations with the additions UNTIL and WHILE. This makes it possible to program any iteration in the constructor expressions NEW and VALUE for creating internal tables.

A new reduction operator REDUCEcan execute these conditional iterations and table iterations to construct the results of any data types. In the case of table iterations, this is also known as table reduction.

Modification 4

Table Filtering

The new filter operator FILTER can be used to perform table filtering in which conditions are used to select or remove rows from an internal table. The result is used to construct a new internal table.

Modification 5

Start Value for Constructor Expressions

The new addition BASE can be used to provide the return value of a constructor expression for structures or internal tables with a start value, before the actual construction starts. The addition BASE can be used in the following constructor expressions:

  • Instance operator NEW and value operator VALUE for structures
  • Instance operator NEW and value operator VALUE for internal tables
  • Component operator CORRESPONDING when using the components of an argument

Modification 6

Inserting Table Rows in Constructed Tables

When internal tables are constructed using the instance operator NEW and the value operator VALUE, LINES OF can now be used to insert multiple rows from an existing internal table in the target table.

Modification 7

Grouping Internal Tables

The new variants FOR GROUPS ... OF and FOR ... IN GROUP in an iteration expression for table iterations using FOR can be used to group the rows of internal tables and to evaluate the groups.

Modification 8

Default Value for Table Expressions

If the type of the result of a table expression or a chaining of table expressions is controlled using the constructor operators VALUE or REF, the additions OPTIONAL and DEFAULT can be used to specify a default value. If no rows are found, no exception is raised and the default value is returned instead.

Modification 9

Restrictions Removed

The following restrictions were removed:

  • In the conversion operator CONV:
  • A string expression can now be converted to any data type. Previously only character-like data types were permitted.
  • A bit expression can now be converted to the character-like data types c and string. Previously only byte-like data types were permitted. All other types remain invalid.
  • In conversions to a compatible type, a syntax check warning no longer appears when a LET expression exists.
This makes the conversion operator CONV a full replacement for the value operator VALUE for elementary data types. As before, the value operator cannot be used to construct any values for elementary data objects except for the initial value.
  • and the result of a string expression is assigned, any data type can now be specified after CAST. Previously only character-like data types were permitted.
  • and the result of a bit expression is assigned, the data type specified after CAST can now also be a character-like data type c and string. Previously only byte-like data types were permitted. All other types remain invalid.
  • A bit expression on the right side of an assignment can now also be assigned to character-like data types c and string. Previously only byte-like data types were permitted. All other types remain invalid.