Tuesday, 7 January 2014

Nested While Loops in SAP ABAP

Nested While Loops in SAP ABAP

Just as with DO loops, WHILE loops can be nested. The process is exactly the same for both. Below is an example of nested WHILE loop statements.
                                       
Nested While Loops in SAP ABAP


The output for this code would appear exactly the same as our nested DO loop example. The values of ‘b’ have also been indented slightly here for ease of reading.
Nested While Loops in SAP ABAP

5 comments:

  1. Best to use: WHILE a < 16.
    In (WHILE a <> 15) if A is higher than 15 at the begining, it will be loop without ending

    ReplyDelete