2007 Feb 21 9:14 AM
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.
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.
2007 Feb 21 9:18 AM
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
2007 Feb 21 9:22 AM
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
2007 Feb 21 9:23 AM
Refer this link:
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbab6f35c111d1829f0000e829fbfe/content.htm
Regards,
Ravi
2007 Feb 21 9:24 AM
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
2007 Feb 21 11:17 AM
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
2007 Feb 21 11:26 AM
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.
2007 Feb 21 11:55 PM
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
2007 Feb 22 3:30 AM
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.
2007 Feb 22 8:01 PM
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.
2007 Feb 22 8:08 PM
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
2007 Feb 23 6:58 AM