Get Example source ABAP code based on a different SAP table
Expressions and Functions in ABAP Release 7.40, SP08 ITOC
ABAP_MODIFICATION_NN 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.
ABAP_MODIFICATION_NN 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.
ABAP_MODIFICATION_NN 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>.
ABAP_MODIFICATION_NN 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.
ABAP_MODIFICATION_NN 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>> in the basic form>
ABAP_MODIFICATION_NN 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.
ABAP_MODIFICATION_NN 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.
ABAP_MODIFICATION_NN 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.
ABAP_MODIFICATION_NN 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 allowed.
A bit expression> can now be converted to the character-like data types c> and string>. Previously only byte-like data types were allowed. 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.
If a casting operator CAST> > is specified in a result position>
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 allowed.
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 allowed. 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 allowed. All other types remain invalid.