MODIFY SCREEN FROM wa.
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.
name component must contain the name of the current screen element, otherwise
the statement is not executed. Apart from the components
length, all other components of
have either the value 0 or 1. The value 0 deactivates the corresponding field property; the value 1
activates it. In addition,
value_help can also have the value 2:
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
active component is used to set the
invisible components at the same time.
When PBO processing starts, the component
active is always 1. If
is set to 0 by
MODIFY SCREEN, then
output are set to 0 and
invisible is set to 1. Any other values in
are ignored. Conversely, setting
to 0 and
invisible to 1 automatically sets
active to 0 and any other values in
active are ignored.
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
inputhas no effect.
If the current dynpro field with the property required is defined in Screen
Painter or if the component
requiredis set to 1, then the component input should stay as 1. Otherwise, setting
inputto 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 effect 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
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.
The program DEMO_DYNPRO_MODIFY_SCREEN demonstrates all possible dynamic screen modifications.