Anda di halaman 1dari 3

LOOP AT SCREEN

Short Reference

Syntax
LOOP AT SCREEN [INTO wa].
...
ENDLOOP.

Effect

The statements LOOP AT SCREEN ... ENDLOOP define a loop around a statement block.
For every screen element of the current dynpro, to which a dynpro field is assigned, one
loop pass is executed. After the LOOP statement either the predefined workarea screen
or the workarea wa (when using INTO) contains the properties of the respective screen
element. wa must have the same data type as screen.

While processing a table control or a step loop (that is, within a LOOP loop of the dynpro
flow logic), for its screen elements the current properties are determined in the current
row or group. Outside of the processing of a table control or step loop, for its screen
elements the statically predefined properties of all rows or groups are determined.

The table below shows the components of screen and their assignment to the field
properties in the dynpro.

Component Length Type Attribute Description


name 132 c Name Name
group1 3 c Group1 Modification group
group2 3 c Group2 Modification group
group3 3 c Group3 Modification group
group4 3 c Group4 Modification group
required 1 c Required-entry field Mandatory field
input 1 c Input input-enabled field
output 1 c Output display field
intensified 1 c Intensified intensified field
invisible 1 c Invisible invisible element
length 1 x visLength Field length
active 1 c Input/Output/Invisible active field
display_3d 1 c Two-dimensional Box
value_help 1 c Input help Input help key
request 1 c - Input exists
values_in_combo 1 c Dropdown listbox Value help exists
The component name in the loop contains the name of the current dynpro field. The
components group1 to group4 can contain three-character IDs, which were assigned to
the current screen element in its definition. These IDs allow you to combine the screen
elements in up to four different modification groups. In the statement block after LOOP
AT SCREEN, these can be queried in logical expressions in order to process several
elements in the same way.

The other components of table screen represent the display properties of the current
screen element. With the exception of length, they can contain 0 or 1, where 1 is
"active" and 0 is "inactive".

Except active, all components of structure screen directly correspond to one attribute
of the current screen element. The component active has no match in the attributes. If
you change its content with MODIFY SCREEN, this affects the attributes Input, Output and
Invisible and thus the components input, output and invisible of structure screen.

Notes

• As of release 6.20, structure screen is described by data type SCREEN in the


ABAP Dictionary. With release 6.10, it was determined by type syscr_screen
of type group SYSCR. Before release 6.10, it was created system-internally with
a bound data type.
• The statement LOOP AT SCREEN behaves similarly to the statement LOOP in a
loop on an internal table with header line, where instead of an internal table a
system table is used.

MODIFY SCREEN

Short Reference

Syntax
MODIFY SCREEN [FROM wa].

Effect

This statement can be used in the statement block after LOOP AT SCREEN only and
makes sense only during PBO processing. If FROM is not specified, MODIFY SCREEN
modifies the attributes of the current screen element with the values from the predefined
screen work area. If a wa work area is specified, its contents are used for the
modification.

The wa work area must have the same data type as screen. The name component must
contain the name of the current screen element, otherwise the statement is not executed.
nweisung nicht ausgeführt. Up to the group1 to group4 and length components, all
remaining components of screen and wa must contain either the value 0 or 1. The value
0 deactivates the corresponding field attribute, and 1 activates it.

If MODIFY SCREEN is executed during PBO processing, the modified attributes for the
display of the screen affect the current dynpro after PBO processing. The attributes of
the screen element of the dynpro are reset to their static attributes at the start of each
PBO processing, so that the execution of MODIFY SCREEN during PAI processing does
not effect the display of the following screen.

The active component

The active component is used to set the input, output and invisible components at
once. At the start of PBO processing, the active component always has the value 1. If
active is set to 0 with MODIFY SCREEN, input and output are automatically set to 0
and invisible is set to 1. Other values in input, output and invisible are ignored.
Conversely, setting input and output to 0 and invisible to 1 automatically sets
active to 0 and a different value in active is ignored.

Modifications in Table Controls and Step Loops

During processing of a table control or a step loop, the changes affect the current line of
the table control or the current step loop group. Before the processing of a table control,
the change to the attributes of a screen element that is part of a line in the table control
does not effect the table control, since the values are transferred from the structure
created using CONTROLS. Before a step loop is processed, the change to the attributes of
a screen elements that is part of a step loop group affects all groups in the step loop.

Modifications to Tabstrip Controls

If the active component for a tab title of a tabstrip control is set to 0, the whole tabstrip
page is hidden.

Example

In the following PBO module, an input field called val is made mandatory and
converted to display in the foreground.

MODULE modify_0100 OUTPUT.


LOOP AT SCREEN.
IF screen-name = 'VAL'.
screen-required = '1'.
screen-intensified = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE.

Anda mungkin juga menyukai