SAP TABLE EXP DEFAULT ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_ITABEXP - Default Value
This example demonstrates default values for table expressions.

ABAP_SOURCE_CODE
DEMO CL_DEMO_TAB_EXP_DEFAULT

ABAP_DESCRIPTION
The result result1 of the first table expression has the line type of the internal table itab. The specified line is not found, which means that the structure def specified after DEFAULT is returned instead.
The result result2 of the second table expression results from a chaining with the structure component selector and is a component with the type string. Here, only the corresponding component of the structure def is specified as the default value.
The result result3 of the third table expression again has the line type of the internal table itab. Further table expressions with default values are specified as the default value. In the case shown here, the table expression in the second default value finds a line and returns it. If no searches are successful, an initial line is returned due to the closing OPTIONAL.