ABAP Keyword Documentation → ABAP − Reference → SAP GUI User Dialogs → General Dynpros → ABAP Statements for Dynpros → LOOP AT SCREEN
MODIFY SCREEN
Other versions: 7.31 | 7.40 | 7.54
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. A work area wa
of the type
SCREEN from ABAP Dictionary must be specified after
FROM. The statement modifies the attributes of the current screen element with the values from the work area.
The name
component must contain the name of the current screen element, otherwise
the statement is not executed. Apart from the components group1
through
group4 and length
, all other components of wa
have either the value 0 or 1. The value 0 deactivates the corresponding field property; the value 1
activates it. In addition, required
and value_help
can also have the value 2:
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 elements 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 affect the display of the following screen.
The active component
The active
component is used to set the input
,
output
, and invisible
components at the same time.
When PBO processing starts, the component active
is always 1. If active
is set to 0 by MODIFY SCREEN
, input
and
output are set to 0 and invisible
is set to 1. Any 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 any other values in active
are ignored.
Special Cases
The following special cases should be noted:
-
If the current dynpro field with the property output field only is defined
in Screen Painter, it cannot be set to ready for input and the assignment of the value 1 to the component
input
is ignored. -
If the current dynpro field with the property required is defined in Screen
Painter or if the component
required
is set to 1, the componentinput
should stay as 1. Otherwise, settinginput
to 0 would cancel the required property.
Modifications in Table Controls and Step Loops
When processing a table control or a
step loop, the changes affect
the current row 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 row in the table control
does not affect the table control, since the values are passed 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.
Notes
-
More specifically, the statement
MODIFY SCREEN
can be used for selection screens during the selection screen eventAT SELECTION-SCREEN OUTPUT
in selection screen processing. -
This statement has an obsolete short form
that works with the obsolete built-in structure
screen
. -
The obsolete built-in structure
screen
should not be specified explicitly afterFROM
.
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 INTO DATA(screen_wa).
IF screen_wa-name = 'VAL'.
screen_wa-required = '1'.
screen_wa-intensified = '1'.
MODIFY SCREEN FROM screen_wa.
ENDIF.
ENDLOOP.
ENDMODULE.
Executable Example
The program DEMO_DYNPRO_MODIFY_SCREEN demonstrates all possible dynamic screen modifications.