SAP NetWeaver AS ABAP Release 750, ©Copyright 2016 SAP AG. All rights reserved.
ABAP - Keyword Documentation → ABAP - Reference → Processing Internal Data → Internal Tables → Expressions and Functions for Internal Tables → table_exp - Table Expressions →table_exp - default
Syntax
... OPTIONAL|{DEFAULT def} ...
Effect
Specifies a default value for table rows not found. if the type of the result of a table expression table_exp is controlled using the value operator VALUE or the reference operator REF, a default value can be specified after the table expression:
If the row itab_line specified in the table expression is not found, an exception of the class CX_SY_ITAB_LINE_NOT_FOUND is not raised if a default value is specified and the table expression returns the default value instead. A data object def that is not compatible with the data type of the result of the expression is converted to this data type in accordance with the conversion rules.
If the argument of VALUE or REF is a single table expression, the default value applies to a single row in the table in question. If the argument is a chaining of table expressions, the default value applies to the result of the chaining (namely how it ends on the right, expressing either a structure component or a table row). A default value specified explicitly must match the result of the chaining accordingly. When a default value is specified for a chaining, the first exception for a missing row across the entire chaining is caught and the default value is returned as a result.
Notes
Example
See Table Expressions, Default Value .