Copyright 2020 - BV TallVision IT

Manipulating the look and feel of screen elements (fields) from PBO processing, changing the attributes of fields before they are placed on the screen. At runtime... The SCREEN table is an internal table that is available in ABAP runtime. It contains the attribute data for the screen fields. of the currently active screen. The field attributes of any field can be changed during runtime by manipulating the SCREEN table. An example for KNA1-KUNNR

 

Example: The SCREEN table implemented

Somewhere in Process Before Output the following logic is called (from a PBO module)

LOOP AT SCREEN.
  IF SCREEN-NAME = 'KNA1-KUNNR'.
* Set field to read-only  
    SCREEN-INPUT = '0'.		
    MODIFY SCREEN.
  ENDIF.
ENDLOOP.

All the fields in the group ABC must become invisible:

LOOP AT SCREEN.
  IF SCREEN-GROUP1 = 'ABC'.
    SCREEN-INPUT = '0'.
    SCREEN-INVISIBLE = '1'.	
    MODIFY SCREEN.
  ENDIF.
ENDLOOP.

Note: LOOP AT SCREEN WHERE GROUP1 = ‘ABC’. cannot be used, LOOP AT SCREEN. is a look-alike statement to LOOP AT ITAB. but they are not the same. SCREEN is an internal table, but does not inherit all features. Why ? Ask SAP.

Another note: changes to the SCREEN table in Process After Input will never make it to the next Process Before Output. Thus always alter the field attributes in PBO.

The following attributes can be retrieved or maintained at runtime in the flow logic of any screen. At runtime the SCREEN table will be available as if it's an internal table.

FieldnameDescriptionTypeNote
NAME The name of the screen field Char 30 Do not change
GROUP1 First group-id Char 3 Do not change
GROUP2   Char 3 Do not change
GROUP3   Char 3 Do not change
GROUP4   Char 3 Do not change
ACTIVE Field attributes are active Char 1 "0" or "1"
REQUIRED Field entry required (obligatory) Char 1 "0" or "1"
INPUT Input field Char 1 "0" or "1"
OUTPUT Output field Char 1 "0" or "1"
INTENSIFIED Intensified display Char 1 "0" or "1"
INVISIBLE Field invisible, when input field: *** display,
when output field: invisible
Char 1 "0" or "1"
ACTIVE Flag: column selected Char 1 "0" or "1"
DISPLAY_3D Internal use only    
VALUE_HELP Internal use only    
REQUEST Internal use only