Ansicht
Dokumentation

ABENNEWS-740_SP08-EXPRESSIONS - NEWS-740 SP08-EXPRESSIONS

ABENNEWS-740_SP08-EXPRESSIONS - NEWS-740 SP08-EXPRESSIONS

SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   General Material Data  
This documentation is copyright by SAP AG.
SAP E-Book

Expressions and Functions in Release 7.40, SP08





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.



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.



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.



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.



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

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.



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.



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.



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.
  • 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.





Addresses (Business Address Services)   Vendor Master (General Section)  
This documentation is copyright by SAP AG.

Length: 10105 Date: 20240420 Time: 001621     sap01-206 ( 125 ms )