The procedure for creating step loops differs depending on whether you are using the alphanumeric or the graphical Screen Painter.
Creating a Step Loop
The elements can appear on one line or on several lines. You can separate the elements by blank lines.
The Screen Painter changes to the Change Loop Definition screen. You can create several separate loop blocks on one screen, but nesting is not allowed.
The system automatically generates a fixed loop block with two repetitions. You can now either edit the step loop further, or choose Back to return to the normal fullscreen editor.
Step Loop Editing Functions
To edit a step loop, you must be in the Change Loop Definition screen. To edit an existing loop block, place the cursor on the block and choose Loop. The following functions are available for editing a step loop:
function |
Explanation |
End line of loop |
Defines the length of the loop area. The system automatically repeats the block within the defined area. |
Variable loop |
Defines a variable loop. With a variable loop, the system adjusts the number of repetitions dynamically in the screen program to suit the size of the current window. If the screen includes several loop blocks, you can define only one of these as variable. The maximum number of lines is 200. In order to be able to react to the variable loop size, the system always places the current number of loop blocks in the system field SY-LOOPC. With a fixed loop, the lower limit of the loop area always remains as originally defined. |
Dissolve |
Dissolves the loop by placing its fields in the screen. |
Move loop |
Moves the loop to a new location. |
You can make changes only in the definition block. Changes in the definition block automatically affect the repetition blocks. In the actual definition block, you can change the attributes of elements as usual. You can also define new elements or delete elements. However, you cannot insert or delete lines within the loop block.
If you choose either Edit
® Select or Edit ® Temporary storage ® Copy to temp.storage, you can work in the same way as for fields not in a loop. However, you can select only elements in the loop definition block. The selected block cannot exceed the loop limits.You can copy elements from outside to the loop block or vice versa. In both cases, the system adapts the element attributes accordingly. When you copy to a loop block, the elements are automatically added to the corresponding repetition elements. When you copy from a loop block, the same repetition elements are deleted.