Hi,
Loop At screen.
Endloop
This will loop into each field of your screen. And within this loop you can set the properties of the field like, visible, editable, active etc.
For your requirement you can loop at the screen in PBO and check the field name and make it either editable or not editable.
Example:
LOOP AT SCREEN.
IF screen-name EQ <fieldname1> and fieldname1 = 'X'.
IF screen-name eq <filedname1>.
screen-input = 1.
MODIFY SCREEN.
ENDIF.
ENDIF.
ENDLOOP.