ABAP tricks #40/100: Reverse looping using STEP addition
- Smart Logic Academy
- 6 days ago
- 1 min read
The optional addition STEP n defines the step size and the direction of the loop.
• The step size is defined by the absolute value of n, and the direction is defined by the positive or negative sign of n. n is of operand type i.
• If the value of n is equal to 1, every line is read
• If the value of n is equal to 2, every second line is read
• If the value of n is equal to -1, every line is read in reverse order
• If the value of n is equal to -2, every second line is read in reverse order
• The addition STEP can be combined with the addition WHERE with n as 1 or -1.
• The addition STEP can be combined with the additions FROM and TO with n.
• AT FIRST, AT LAST, AT NEW, and AT END OF are not supported with STEP.

Please share with your ABAP friends and follow us.
To explore further, check out this course link - https://lnkd.in/dv6zbX6Q
Comments