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

Making a field on screen input enabled or disabled

Former Member
38,328

Dear Friends,

Please suggest how can I make a field on my dialog-program screen input enabled or disabled through coding. I understand that the same can be done by setting screen parameters but i wish to do that through programming only.

Regards,

Alok.

11 REPLIES 11
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
12,200

Hi,

you can do that using the following code in PBO.

LOOP AT SCREEN.

if SCREEN-NAME = 'Field name'.

screen-active = 1. "enable 0 for disable.

endif.

MODIFY SCREEN.

ENDLOOP.

Regards,

Sesh

Read only

Former Member
0 Likes
12,200

Hello,

In the PBO pf your screen,write this:

LOOP AT SCREEN.

IF screen-name = 'FIELDNAME'.

screen-active ='1'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Regards,

Beejal

**reward if this helps

Read only

Former Member
Read only

Former Member
0 Likes
12,200

HI ALOK,

do this way

LOOP AT SCREEN.
IF SCREEN-NAME = 'FLD NAME'.
SCREEN-ACTIVE = 1.  "enable
*SCREEN-ACTIVE = 0. " diable
ENDIF.
MODIFY SCREEN.
ENDLOOP.

Regards,

Santosh

Read only

Former Member
0 Likes
12,200

Hi,

In PBO

MODULE STATUS_0100 OUTPUT.

SET PF-STATUS ' xxxx'.

loop at screen.

IF screen-name = 'field1'.

SCREEN-INPUT = 0.

ENDIF.

MODIFY SCREEN.

endloop.

ENDMODULE. " STATUS_0100 OUTPUT

SCREEN-INPUT = 0 IS ENABLED MODE

SCREEN-ACTIVE = 0 IS ENABLED MODE

Read only

Former Member
0 Likes
12,200

Hi,

Check this.

LOOP AT SCREEN.

IF screen-group1 = 'MOD'.

IF flag = ' '.

screen-input = '0'.

ELSEIF flag = 'X'.

screen-input = '1'. Field is ready for input

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Regards,

Sruthi.

Read only

Former Member
0 Likes
12,200

Hi Alok,

A field can Enabled or Disabled by setting its attributes.

As it is a element placed on screen and modify the screen you need to modify the screen table.

loop at screen.

screen-group1 = 'SC1'.

Enable:

if screen-name = 'PA_MATNR':

screen-input = '1'.

screen-output = '0'.

modify screen.

endif.

DISABLE:

if screen-name = 'PA_MATNR':

screen-input = '0'.

screen-output = '1'.

modify screen.

endif.

endloop.

Some more Info :

1 --- Active

1 --- Input

1 --- Output

0 --- Invisible

Screen field is displayed, even if Invisible is set statically.

Field contents are displayed.

Ready for input, even if Input is not set statically. However, not ready for input if the Output only is set statically.

1

1

0

0

Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.

Field contents are not displayed.

Ready for input, even if Input is not set statically.

1

0

1

0

Screen field is displayed, even if Invisible is set statically.

Field contents are displayed.

Not ready for input, even if Input is set statically.

1

0

0

0

Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.

Field contents are not displayed.

Not ready for input, even if Input is set statically.

1

1

1

1

Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.

Field contents are not displayed.

Ready for input, even if Input is not set statically. User input is masked by asterisks (*).

1

1

0

1

Screen field is displayed, even if Invisible is set statically, except when Output only is set statically.

Output is masked by asterisks (*).

Ready for input, even if Input is not set statically. User input is masked by asterisks (*).

1

0

1

1

Screen field inactive.

Screen field is not displayed, regardless of the static attributes.

0

0

0

1

Screen field inactive.

Screen field is not displayed, regardless of the static attributes.

Br,

Laxmi

Read only

Former Member
0 Likes
12,200

Hello Alok ,

Loop at screen , where screen is an internal wrkarea and one can set properties of screen elements dynamically.

Ex :

LOOP AT SCREEN.

IF screen-name CS lwa_hide_fields.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Read only

Former Member
0 Likes
12,200

Hi Man... Many of the answers are correct. Please reward points to them and close the question...

You know people spend their time on SDN to answer the questions with one hope that they will get acknowledgement... Please do not deprive them from that.

It's always good to say thank u to some one who has helped us... What Say

Cheers

Darshan.

Read only

Former Member
0 Likes
12,200

Hi alok,

try the following code:

LOOP AT SCREEN.

IF screen-group1 = 'MOD'.

IF flag = ' '.

screen-input = '0'. no input

ELSEIF flag = 'X'.

screen-input = '1'. input enabled

ENDIF.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Ashvender

Read only

Former Member
0 Likes
12,200

Sincere thanks to all the Contributors!

Regards,

Alok.