WHILE Loop Processing
Task
Write ABAP logic using a WHILE loop to repeatedly execute statements until a condition is no longer met.
- Use WHILE loop
- Update loop counter correctly
- Avoid infinite loops
Write Your ABAP Code
Loading...
📥 Sample Input & Output
Initial value: lv_num = 1 Loop runs while lv_num <= 5 Final value after loop: 6
💡 Hint
Increment the loop variable inside the WHILE loop to ensure the condition eventually becomes false.
✅ View Reference Solution
WHILE lv_num <= 5. lv_num = lv_num + 1. ENDWHILE.