SAP NESTING DEPTH - Guide
Get Example source ABAP code based on a different SAP table
Nesting Depth
ABAP_BACKGROUND
The nesting depth is the number of statement blocks that are nested due to the use of control structures (branches, loops). We will discuss the nesting depth at the level of a procedure (
The maximum nesting depth is restricted to 256 by ABAP Compiler.
ABAP_RULE
Restrict the maximum nesting depth within a procedure (
ABAP_DETAILS
In addition to the
A maximum nesting depth of five levels is considered tolerable. A deeper nesting requires a great deal of effort to trace the program flow based on the source code. This would considerably constrain maintenance and further development.
Note
The use of modern language elements can help to restrict the maximum nesting depth. This is the case if a statement or a built-in function replaces an entire control structure, for instance, for
Example ABAP Coding
The transition from the bad to the good example in the rule for
ABAP_EXAMPLE_END