‎2007 Jun 13 9:39 AM
Dear Abapers,
I want to enable or disable fields when a user command hits. pl. help.
vikas
‎2007 Jun 13 9:50 AM
Hello,
DO like this.
IF SY-UCOMM = 'DISABLE'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'FIELD'.
SCREEN-INPUT = 0.
SCREEN-OUTPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.Vasanth
‎2007 Jun 13 9:50 AM
Hello,
DO like this.
IF SY-UCOMM = 'DISABLE'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'FIELD'.
SCREEN-INPUT = 0.
SCREEN-OUTPUT = 1.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.Vasanth
‎2007 Jun 13 9:52 AM
Hi,
You need to use some flag and set that flag for your user command and then in the PBO or AT SELECTION-SCREEN OUTPUT you need to hide the fileds using
AT SELECTION SCREEN.
IF SY-UCOMM = 'Your use command'.
flag = 'X.
ENDIF.
AT SELECTION-SCREEN OUTPUT.
IF flag = 'X'.
LOOP AT SCREEN.
IF screen-name = 'field name'.
screen-active = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
Regards,
Sesh
‎2007 Jun 13 9:54 AM
Hi,
parameters: p_chk1 as checkbox user-command chk,
p_fld1 type c,
p_fld2 type c.
at selection-screen output.
if p_chk1 = space.
loop at screen.
if screen-name = 'P_FLD2'.
screen-input = '0'.
modify screen.
endif.
endloop.
endif.
[/code]
Regards
‎2007 Jun 13 10:32 AM
This can be done in the PBO of the screen if it is dialog programming
LOOP AT SCREEN.
IF screen-name = 'SCREEN FIELD NAME'.
screen-input = 0. " Disable
MODIFY SCREEN.
ENDIF.
ENDLOOP.If its a report.
AT SELECTION-SCREEN OUTPUT.
IF w_par2 = 'X'.
LOOP AT SCREEN.
IF screen-name = 'SCREEN FIELD NAME'.
screen-input = 1. " Enable
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF
Regards
Gopi