Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  User Dialogs →  Screens →  ABAP Statements for Screens →  LOOP AT SCREEN 

MODIFY SCREEN

Short Reference

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 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 the same time. When PBO processing starts, the component active is always 1. If active is set to 0 by MODIFY SCREEN, then 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 has no effect.
  • If the current dynpro field with the property required is defined in Screen Painter or if the component required is set to 1, then the component input should stay as 1. Otherwise, setting input to 0 would cancel the required property.

Modifications in Table Controls and Step Loops

Wheh 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 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

  • This statement has the obsolete short form which works with an obsolete predefined structure screen.
  • The obsolete predefined structure screen should not be specified explicitly after FROM.

Example

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

DATA screen_wa TYPE screen. 

MODULE modify_0100 OUTPUT. 
  LOOP AT SCREEN INTO 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.