Tuesday, December 19, 2017

Table Expression Default Value

Demo program DEMO_TAB_EXP_DEFAULT is good enough to understand the usage of DEFAULT and OPTIONAL additions while using table expression to read line.

Using OPTIONAL, we can get similar behavior as read table. Still there would be one difference. The work area of read table remains unchanged if record is not found. When table expression is used, work area will be cleared or filled with found row. So, OPTIONAL helps you to prevent the expression from throwing exception of line not found. Value is always passes, be it initial row type or the one specified in DEFAULT addition.

No comments: