ABAP - Keyword Documentation →  ABAP - ABAP Release News →  News for ABAP Release 7.40 and its SPs →  News for ABAP Release 7.40, SP08 → 
Mail Feedback

Expressions and Functions in ABAP 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 Lines in Constructed Tables

7. Grouping Internal Tables

8. Default Value for Table Expressions

9. Restrictions Removed



Modification 1  

Predicative Method Calls

The predicate expression

meth( ) IS NOT INITIAL

can now be specified in a short form as 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 REDUCE can 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 lines 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:





Modification 6  

Inserting Table Lines 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 lines 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 lines 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 lines are found, no exception is raised and the default value is returned instead.



Modification 9  

Restrictions Removed

The following restrictions were removed: