Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

disable and enable items using code how?

Former Member
0 Likes
495

hi,

plz tell me how can i control from the code the properties of the component on the screen.

(i.e if i have txtbox on screen and i set it invisable on the design mode, how can i from the code change it to be visable.

also how to enable and disable elements...etc.

Thanks,

Sreekar Pande.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
438

Hi,

all you need to do is perform a loop at screen statement within the PBO of the screen and change the attributes of the particular field. I.e. to change an input field called 'PA9007-ID' from input to output use the following code:

loop at screen.

if screen-name = 'PA9007-ID'.

screen-input = 0.

modify screen.

endif.

endloop.

Reward points if found helpful....

Cheers,

Rakesh.

2 REPLIES 2
Read only

Former Member
0 Likes
438

in case of selection screen.

u need to add modif-id <name> to the parameters & select-options.

SELECT-OPTIONS: S_EBELN FOR EKKO-EBELN MODIF ID S1.

PARAMETER P_MATNR TYPE MARA-MATNR MODIF ID S2.

SELECTION-SCREEN END OF BLOCK B1.

PARAMETERS:R1 RADIOBUTTON GROUP G1 USER-COMMAND UC,

R2 RADIOBUTTON GROUP G1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF R1 = 'X' AND SCREEN-GROUP1 = 'S2'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

CLEAR SCREEN.

ENDIF.

IF R2 = 'X' AND SCREEN-GROUP1 = 'S1'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

CLEAR SCREEN.

ENDIF.

ENDLOOP.

Reward if useful

Regards

ANUPAM

Read only

Former Member
0 Likes
439

Hi,

all you need to do is perform a loop at screen statement within the PBO of the screen and change the attributes of the particular field. I.e. to change an input field called 'PA9007-ID' from input to output use the following code:

loop at screen.

if screen-name = 'PA9007-ID'.

screen-input = 0.

modify screen.

endif.

endloop.

Reward points if found helpful....

Cheers,

Rakesh.