ABAP HANA 7.51: Let Expression
Let expression defines as well as initialize variables and field-symbols. This works as a local helper for the expression. Some important points to be noticed regarding LET expression are as follows:
- Variables or Field-symbols defined for LET expressions can’t be used outside scope of expression
- Variables or Field-symbols defined for LET expressions can’t be redefined even if they are not accessible outside LET scope
- LET expression can be encapsulated inside constructors, VALUE operator, FOR operator, COND operator, SWITCH operator etc.
Sample Source Code: Variant 1
Output: Variant 1
Check the video for Illustration and Example:
Find the code on GitHub: